I would like to see a plugin where it places random chests around the world with random items.
Its possible to do that? Pick random coordinates and place a chest on the location.
- If possible, a config to edit how many chests to place and what items include in the random table.
Solved Random chest placement
Discussion in 'Plugin Requests' started by RogerHN, Jan 26, 2016.
-
Yes this is quite possible.
-
That would be epic
-
Hmm, this is trickier than I first thought.
I have everything working, it spawns a chest at a random location, puts random items in it from an array of possible items and how many, then destroys the chest after xx time. I've had to use Raycast to find the ground when spawning the chests, so the initial location is in the sky, then Raycast detects the ground directly under it to spawn the chest.
Now to stop them spawning on top of someones base I'm also going to need to check if the area has been claimed (Someone has an Ownership Stake) and if it is, to generate a different location and try again. But this won't stop them from spawning ontop of a building that has no ownership so I may need to check the raycast location object name to see if is a building component before spawning.
Thought I'd give ya an update
[DOUBLEPOST=1453912587][/DOUBLEPOST]Okay instead of doing an ownership I've just checked if it's placed on a building object or a cliff.
So the boxes can still spawn in peoples "Gardens" but not on walls, roofs, cliffs etc
This is actually pretty neatLast edited by a moderator: Jan 27, 2016 -
Very nice good job!
-
@Noviets PM me the file
-
Awesome @Noviets! Can't wait to see the plugin working!
Also I have an Idea for the name of the plugin: Random Loot Chest -
I have it pretty much done, I'm just trying to figure out how to write the configs for ease-of-use for the items.
As I'm sure you are all going to want different amounts of items, and would need to check what they are, so you can ahve for example 100 stones, but not 100 engines, etc. -
I have a suggestion for the configs:
Code:{ "RandomChests": 100, Quntity of chests to spawn "RandomChestsRefreshTime": 60, In minutes, the time to destroy all placed chests and place new ones "Items": { "Owrong": Item name{ "IncludeOnChest": true, Self explanatory "Quantity": 5, Initial quantity of the item "RandomVariace": 2, The variance of the quantity, in this example, I can find 5 up to 7 owrongs inside chests "ItemChance": 30, The percentage for the item appear on a chest }, "IronOre": { "IncludeOnChest": true, "Quantity": 2, "RandomVariace": 50, "ItemChance": 10, The percentage for the item appear on a chest } } }
Last edited by a moderator: Jan 28, 2016 -
All done, just testing everything before I publish.
[DOUBLEPOST=1454011665][/DOUBLEPOST]
Right now it's random for a list of items that you have added.
[DOUBLEPOST=1454018078][/DOUBLEPOST]Plugin has been published. Keep an eye out for LootChestsLast edited by a moderator: Jan 28, 2016