I spawned a monster that as a chance to drop a reward item when it dies using the ondeathaction. I was trying to rename the item so it included the name of the player that killed the monster like :
playername, legendary mongbat killer
is there anyway to do this?
thanks
For the XmlDeathAction attachment, the triggermob is set to be the killer, so you should be able to use {GETONTRIGMOB,name} to substitute the killers name into your item name.
so an Action like
SETONTHIS/ADD/<longsword/name/{GETONTRIGMOB,name}, legendary mongbat killer>
would add the named longsword to the corpse.
thank you Arte but this doesnt seem to work, it leaves the name out, i tested this with a regular player char.
i tried with name/{GETONTRIGMOB,name}/
the object is named : ~1_NOTHING~
i then tested name/GETONTRIGMOB,name/
the object is named : playername
but if i do name/GETONTRIGMOB,name, legendary mongbat killer/
the object is name : GETONTRIGMOB,name, legendary mongbat killer
what is the exact Action string that you are using?
Also, open up the attachment on the mob and look at the Action property to make sure that it is what you think it is.
The issue may be that the {GETONTRIGMOB,name} may be substituted at the time you actually add the attachment.
whitewyrm/ATTACH/<xmldeathaction/action/@SETONTHIS/ADD/<mounteddragon/hue/1150/name/a mounted white wyrm trophy killed by {GETONTRIGMOB,name}>>
i get the mounted head on each death (that what i want to test it) and its hued 1150 but its named "a mounted white wyrm killed by"
yes, what happens is that the {GETONTRIGMOB,name} is substituted at the time you spawn it, so the Action string ends up being set to
SETONTHIS/ADD/<mounteddragon/hue/1150/name/a mounted white wyrm trophy killed by _BLANK_>
What you need to do is to get the special chars { and } past the substitution phase at spawn time, since you want those to be a part of the actual Action string. You can substitute each of the individual brackets to get them past.
Try it like this
whitewyrm/ATTACH/<xmldeathaction/action/@SETONTHIS/ADD/<mounteddragon/hue/1150/name/a mounted white wyrm trophy killed by {{}GETONTRIGMOB,name{}}>>
this should give you an Action string that looks like this
SETONTHIS/ADD/<mounteddragon/hue/1150/name/a mounted white wyrm trophy killed by {GETONTRIGMOB,name}>
which is what you want.
Thank you very much it works perfectly.
This method was unknown to me, thanks for taking the time to help me out
B.