Not really a function but it seems to fit best here.
CODE
ON=@Death
If <Findlayer.22>
tag.robe=<Findlayer.22.uid>
If <Findlayer.3>
tag.feet=<Findlayer.3.uid>
Endif
Endif
ON=@DeathCorpse
If <tag0.robe>
Uid.<tag.robe>.z = 3
Uid.<tag.feet>.z = 8
tag.robe=
tag.feet=
Argo.Update
endif
If <Findlayer.22>
tag.robe=<Findlayer.22.uid>
If <Findlayer.3>
tag.feet=<Findlayer.3.uid>
Endif
Endif
ON=@DeathCorpse
If <tag0.robe>
Uid.<tag.robe>.z = 3
Uid.<tag.feet>.z = 8
tag.robe=
tag.feet=
Argo.Update
endif
Any player or NPC who dies while wearing a robe does not have it displayed on their corpse. This fixes that by setting the robe to take the place of your boots/shoes and setting your shoes to take the place of a neck item which wont be shown anyway if you are wearing a robe.
I used the tags because the Z is reset between death and deathcorpse and because a timerf on the items causes the player or npc to lose the robe for a noticeable amount of time.
I had to use the feet layer because all other layers seem to be displayed under feet for a corpse (i.e. the boots would always overlap the robe).
(this works for all layer 22 items, including death robes. Kind of annoying when you have a cave full of evil cultists and the last thing they do before dying is get necked