Full Version : Remove Default Loot with XMLSpawner
xmlspawner >>Q&A >>Remove Default Loot with XMLSpawner


<< Prev | Next >>

Morticie- 11-14-2006
hello,

I would like to remove default loot with XMLSpawner - is it possible? I cant work it out...

does anyone have solution?

ArteGordon- 11-14-2006
I'm not exactly sure what you mean. Can you give an example of what you want to do.

Morticie- 11-14-2006
For example black/red solen warrior - when you kill it you can find in loot gold, zoogi fungus and some gems. But I want to remove all of this, so when you open solen warrior's corpse, you find simply nothing.

I dont want to change the solen's loot in scripts (for I need this adjustment only in few cases, not for all solen warriors) and I dont want to create new npc with new loot in scripts (I dont have access to them and I dont want to bother our scripter so often).

ArteGordon- 11-14-2006
because some loot is generated only when the creature is killed, you need to delete the contents after death.
The way to do this without scripting is to use the XmlDeathAction attachment that will allow you to specify an action that is taken on creature death.

So if you spawn something like this

redsolenwarrior/ATTACH/<xmldeathaction/action/@SETONNEARBY,0,,item,true/DELETE>

it will add the XmlDeathAction attachment with an action that uses the SETONNEARBY keyword (range of zero, items, no name requirement, search containers) and DELETE keyword to delete all items in the corpse container on creature death.

from xmlspawner2.txt
QUOTE

- added the ability to access container contents in the SETONNEARBY keyword with the new 'searchcontainers' argument.  The new syntax is

SETONNEARBY,range,name[,type][,searchcontainers]/prop/value/prop/value...

where searchcontainers is a flag set to true or false (default is false).  This will only access containers that are placed in the world, not containers carried by mobiles.  If searchcontainers is set, then only items in containers will be included.

So, to delete all ginseng found in containers within 5 tiles of the spawner but not on the ground, you could use the spawn entry

SETONNEARBY,5,,ginseng,true/DELETE

Without the searchcontainers argument, or setting it to false it would delete all ginseng on the ground within 5 tiles of the spawner but not in containers.

An example of the use of this for filling and deleting contents of nearby boxes can be found in the nearbyboxes.xml example in xmlextras.zip (thanks to snicker7 for the idea).


If you also wanted to replace the default loot with your own stuff, you could add another xmldeathaction attachment to do that, like this

subgroup 1:
redsolenwarrior/ATTACH/<xmldeathaction/name/delete/action/@SETONNEARBY,0,,item,true/DELETE>
subgroup 1: SETONSPAWN,1/ATTACH/<xmldeathaction/name/add/action/@SETONTHIS/ADD/ARMOR,1,3/ADD/<questholder/name/Antsy/objective1/KILL,blacksolenwarrior,10/autoreward/true/rewardstring/gold,2000>


this will add the first xmldeathaction attachment named 'delete' that will remove the contents of the corpse. The next entry will add the xmldeathaction attachment named 'add' (note the two xmldeathaction attachments need different names otherwise they will just replace the other one) that adds a random piece of magical armor and a questholder with a quest to kill 10 black solen warriors.

So when this creature is killed, it will have the armor and the quest and none of the default loot.

morganm- 01-23-2007
Similar issue.... I know the MOBs I'll be spawning will have some amount of gold on them. I want to delete the gold out of the MOB's pack right when it's spawned. I tried a few things but none worked.

Using this XML attachment wont help in my case. I don't want thieves to steal the gold out either. The gold needs to be deleted when the monster is spawned.

Thanks!

ArteGordon- 01-24-2007
take a look at this thread which describes how to access things in a mobs pack so that you can do things like change or delete them
http://xmlspawner.15.forumer.com/index.php?showtopic=506

morganm- 01-24-2007
Ah, I was close! I wasn't specifying the TRIGGERMOB =P

Thanks Arte, I think this will do the trick!