Full Version : NPC Clothing/Armor
xmlspawner >>Q&A >>NPC Clothing/Armor
<< Prev | Next >>
DrussRob- 01-16-2006
Is it possible to alter the clothing or armor that a scripted NPC spawns with.
For example, a regular knight lets say would spawn with a plate armor suit with no hue. Would it be possible to spawn that knight through XMLSpawner and change the hue of a certain or all peices of armor that he spawns with?
thx
ArteGordon- 01-16-2006
The easiest direct way to alter equipped items on a spawned mob is to UNEQUIP and then EQUIP the appropriate layer with the altered items that you want.
There is an indirect way to directly manipulate already equipped/carried items that uses the SETONCARRIED keyword to gain access to items on the triggering mob.
This would fall under the category of 'advanced' spawner fiddling.
Various keywords, such as SETONCARRIED automatically refer to the triggering mob when performing their functions.
Normally, that triggering mob would be a player, but you can set the TriggerMob property directly on the spawner to refer to any mob you like, and then use the SETONCARRIED keyword to fiddle with their carried items.
It would look like this
put all of these on subgroup 1 in the order listed
brigand
SETONTHIS/triggermob/GETONSPAWN,1,Serial
SETONCARRIED,,baseweapon/hue/200
SETONCARRIED,,hair/hue/200
and you will spawn a brigand that has its default weapon and his hair hued to the color 200.
What happens is that the first entry spawns the mob.
The second entry sets the TriggerMob property on the spawner to point to that mob.
The third entry accesses the carried baseweapon on that triggermob and sets the Hue property on it to 200. Note that the 'itemname' argument to SETCARRIED is empty since you are not referring to a named baseweapon.
The last entry changes his hair hue.
You can add as many of those SETONCARRIED entries as you like, to change as many things as you like.
You could refer to other things like platearms if that is what they were equipped with by default, or anything else that they were carrying.
ArteGordon- 01-16-2006
This is how you would do it using the EQUIP and UNEQUIP keywords
from xmlspawner2.txt

QUOTE
-added the new "UNEQUIP,layer[,delete]" keyword that allows you strip a mobile of an equipped item on the specified layer. If the optional "delete" argument is specified, then the removed item will be destroyed, otherwise it will simply be dropped into the the mobiles pack.
For example, you could disarm a one-handed weapon from a triggering player using
SETONTRIGMOB/UNEQUIP,OneHanded
or spawn a mobile, remove existing equipment, and replace it with new equipment with something like
banker/UNEQUIP,pants/UNEQUIP,shoes,delete/EQUIP/sandals/SAY/Hey, where are my pants?
This will create a banker, take off his pants and put them in his pack, take off his shoes and delete them, and then put on a pair of sandals in their place.

Also, from this thread http://xmlspawner.15.forumer.com/index.php?showtopic=60

QUOTE
The EQUIP keyword is just like ADD, so you can use the grouping <> delimiters to set properties on the object that you are equipping, like balron/bodyvalue/400/hue/46/EQUIP/leatherchest/EQUIP/<longpants/hue/500>/EQUIP/<longhair/hue/40>