kts.ZombifyTarget – turn target knight into a monster
result = kts.ZombifyTarget(monster_type)
If the current target (as given by cxt.victim
) is a knight, then they are turned into a monster of the given MonsterType.
This counts as "killing" the knight, and any items they were carrying are dropped. No corpse is created.
If cxt.victim
is a creature other than a knight, or is nil
, then nothing happens.
This function returns true if a valid target was found and successfully turned into the given monster type, or false otherwise.
Even though the function is called "Zombify", this can actually be used to turn knights into any kind of monster, not just zombies.
Only knights can be affected by this function – other types of creatures are immune.
Knights are affected even if they have Invulnerability.
This function is perfect for calling from within the melee_action
of a weapon. For example, this is used by the Wand of Undeath for turning knights into zombies; see items.lua.