kts.PoisonImmunity – give the current actor Poison Immunity
kts.PoisonImmunity(duration, message)
If the current actor (as given by cxt.actor) is a knight, then that knight gains the Poison Immunity magical effect, for the next duration milliseconds. The string message will also flash on screen above the knight a number of times.
If the knight already has Poison Immunity, then the existing Poison Immunity timer is cancelled and replaced with the new one.
If the current actor is not a knight then nothing happens.
None.
Poison Immunity gives the knight immunity to both Poison and Paralyzation.
The duration (first argument to kts.PoisonImmunity) is usually set to some kind of random number, to provide some unpredictability for the players. The duration value is not made visible to the player.
To give a knight Poison Immunity for a random number of seconds between 1 and 60:
kts.PoisonImmunity(kts.RandomRange(1, 60) * 1000, "Poison Immunity")
The actual game code uses a slightly more complicated method for determining the duration of potion effects; details can be found in magic.lua.