Manual:DIL Manual/defensive

From DikuMUD Wiki
Jump to navigation Jump to search

defensive

Field (integer, read/write; units: characters).

ch.defensive : integer

A flat bonus (or, below 0, penalty) to the character's defence. It is taken off the attack bonus of every spell and melee attack on the character, against the attacker's offensive; in melee only while the character is awake. A zone file sets it with defensive in an NPC; it is saved with players.

Notes

  • On an object, a room or null it fails.
  • Stored as a signed 16-bit number: values outside -32768 to 32767 wrap around. There is no other limit, and no access level is needed to assign it.

Example

dilbegin stone_skin(dur : integer);
code
{
   self.defensive := self.defensive + 15;
   act("$1n's skin turns grey and hard.", A_ALWAYS, self, null, null, TO_ROOM);
   heartbeat := PULSE_SEC * dur;
   pause;
   self.defensive := self.defensive - 15;
   act("$1n's skin softens again.", A_ALWAYS, self, null, null, TO_ROOM);
   quit;
}
dilend

Makes an NPC harder to hit for a while.

See also