damage

Settable:
no
Arguments:
(1) character, integer
(2) character, character, integer
(3) character, integer, string
(4) character, character, integer, string
Return Value:
none

This function inflicts damage on a character. It can also be used to set two characters to fighting each other without damaging either by calling it with 0 for the integer argument. Otherwise, the integer argument specifies the amount of damage inflicted.

If the function is called in one of the forms with a single character argument (1 or 3) then the damage is inflicted on that character by himself. This can affect the message associated with the damage, and also means that the damage does not start a fight. This is a good form to use if the damage is inflicted by a trap or some other foe that the character cannot directly attack in response.

Finally, if a string argument is included then the damage is of the specified type. This can be used to produce specific messages associated with the damage, but also to produce damage of a sort that is affected properly by certain defenses (for example, fire damage that is partially blocked by a 'resist fire' spell and totally blocked on a fire elemental.) The string argument should either be a spell name (in which case the damage will produce the appropriate message associated with that spell) or one of the following strings: