I posted this in another thread, but think it got lost in the rest of the text.
I want to use SETONNEARBY to spawn containers that are placed around the spawner. Im talking on pre placed containers from RunUO basic deco. But i dont want to spawn all of the containers, just a set amount of them.
Ex. I have 4 containers within the spawners range. But i only want two of them to contain loot at any given time. And on next spawn tick, i want it to respawn the containers, picking 2 random containers out of the four.
Is this possible? If not, is this something you have plans, or could consider adding to XmlSpawner2?
Okay, judging from the silence, i guess it's not possible atm then. Too bad, it would have made it very easy to create a few default spawners that i just could plop in where needed.
I guess i will have to find some other way to do this i guess.
Arte: Consider this functionality a feature request. Do you want me to post it on the requests forum?
if you did something like
SETONNEARBY,4,,container/ADD,0.5/ARMOR,1,2
that would go through all of the nearby containers, and then ADD stuff 50% of the time (that's your 2 out of 4 on average)
SETONNEARBY,4,,basearmor,true/DELETE
would go through all nearby containers and delete any armor that it found in them.
So putting the two together in a subgroup should do what you want. First clear them, then spawn them.
subgroup 1: SETONNEARBY,4,,basearmor,true/DELETE
subgroup 1: SETONNEARBY,4,,container/ADD,0.5/ARMOR,1,2
you dont have to use the basearmor type in the DELETE entry. You could just specify an Item type and that would wipe everything in there (the most general case).
subgroup 1: SETONNEARBY,4,,item,true/DELETE
subgroup 1: SETONNEARBY,4,,container/ADD,0.5/ARMOR,1,2
If you wanted to add more than one thing added to each container, you could do something like
subgroup 1: SETONNEARBY,4,,item,true/DELETE
subgroup 1: SETONNEARBY,4,,container/ADD,0.5/<bag/ADD/ARMOR,1,2/ADD/WEAPON,1,2/ADD/gold,{RND,100,200}>
which would put a magical weapon, a magical piece of armor, and a random amount of gold into a bag and then add the bag to a container 50% of the time.
Thanks for the reply. But most of that i already knew. And the Add,0.5 is a decent workaround, but it still can end up with all 4 of the containers spawned, or none. I was kind of hoping i could specify how many containers i wanted spawned, and then it would spawn random containers up to that max. As it is, in some areas of the dungeons, there are well over 20 containers in a small area, and there the 0.5 factor all of a sudden gets big. Lots of containers with loot. And i really dont want to remove any, since they are part of the OSI decor.
And besides, my ideal would be one spawner that could spawn all containers in a dungeon level. Just place it in the middle, set the range to encompas the dungeon level, and an max amount of containers spawned. After that, it chooses random containers, and spawn them.
yeah, you want specify the number of object to be selected by SETONNEARBY.
Of course, as the number of objects increases, the overall variance in terms of number of objects deviating from exactly 0.5, decreases.
When you have only 4 objects, varying the number by 2 is huge. When you have 40 it is small.
Precicely. Well if this feature would be considered and make it for a future release, that would be wonderful. But i know you have your hands full already, and i really dont want to increase your burden, so if you consider it a low priority, or not gonna happen, i fully understand, and respect the descission.
But you cant blame me for trying