Full Version : Accessing npc-carried items
xmlspawner >>XMLSpawner Mods and Tips >>Accessing npc-carried items
<< Prev | Next >>
ArteGordon- 06-13-2006
To access the contents of a spawned mobs pack, you can use the SETONCARRIED or GETONCARRIED keywords. Those keywords will act on the mobile that is referred to by the 'TriggerMob' property of the spawner which is normally the triggering player, but you can force it to refer to any mob you like by first assigning TriggerMob and then using the keyword, like this
subgroup 1: brigand
subgroup 1: SETONTHIS/TriggerMob/GETONSPAWN,1,serial
subgroup 1: SETONCARRIED,,gold/DELETE
subgroup 1: SETONCARRIED,,nightshade/DELETE
the GETONSPAWN,1,serial will refer to the serial number of the spawn on subgroup 1, which will be the brigand. Then the following SETONCARRIED keywords will refer to things that the brigand is carrying. I used an empty name argument for things like gold and nightshade.
Note, all the entries are in the same subgroup, so they will always spawn together and in the order listed.
morganm- 01-24-2007
Works great for doing one creature. Here's some... limitations? I ran into.
Setup subgroup 1 as described above; worked perfect. Tried to increase Max for spawn entry 1 to, say, 6 orcs. It only deletes the gold from the first orc and not the other 5.
Then I tried to setup subgroup 2 as described; does not work. Would I have to set the spawner to be a Sequential Spawner so that it ran one SubGroup at a time?
Perhaps I should just setup a spawner for each monster I'm spawning that I want to delete the gold from.
Thx
ArteGordon- 01-25-2007
yes, unfortunately the strategy that I described will only work with single mobs.
You could do it with multiple subgroups on a single spawner like
subgroup 1: brigand
subgroup 1: SETONTHIS/TriggerMob/GETONSPAWN,1,serial
subgroup 1: SETONCARRIED,,gold/DELETE
subgroup 2: orc
subgroup 2: SETONTHIS/TriggerMob/GETONSPAWN,2,serial
subgroup 2: SETONCARRIED,,gold/DELETE
but on each spawner tick it is only going to pick one of the subgroups to spawn unless you force a full respawn.
To have more than one spawn at a time, you would need to set it up sequentially or with separate spawners for the different mobs as you mentioned.