kts.ZombieKill

Name

kts.ZombieKill – kill target if it has a particular monster type

Synopsis

result = kts.ZombieKill(monster_type)

Description

If the current target (as given by cxt.victim) is a monster of the given MonsterType, then they are instantly killed.

This counts as a normal monster death (e.g. a corpse is left behind as normal).

Return Value

This function returns true if a valid target (of the correct monster type) was found and successfully killed, or false otherwise.

Notes

Even though the function is called "ZombieKill", it can actually be used to kill any given type of monster, not just zombies.

Knights cannot be killed by this function (since they are not monsters).

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 instantly killing zombies struck by the wand; see items.lua.

See Also

The cxt table

kts.ZombifyTarget