kts.ZombifyTarget

Name

kts.ZombifyTarget – turn target knight into a monster

Synopsis

result = kts.ZombifyTarget(monster_type)

Description

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.

Return Value

This function returns true if a valid target was found and successfully turned into the given monster type, or false otherwise.

Notes

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.

Examples

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.

See Also

The cxt table

kts.ZombifyActor

kts.ZombieKill