Manual:DIL Manual/offensive

From DikuMUD Wiki
Jump to navigation Jump to search

offensive

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

ch.offensive : integer

A flat bonus (or, below 0, penalty) to the character's attacks. Every melee and spell attack the character makes gets offensive minus the target's defensive added to its attack bonus, which with the dice roll decides the damage. A zone file sets it with offensive 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 battle_rage(dur : integer);
var
   bonus : integer;
code
{
   bonus := 10;
   self.offensive := self.offensive + bonus;
   act("$1n roars and attacks wildly!", A_ALWAYS, self, null, null, TO_ROOM);
   heartbeat := PULSE_SEC * dur;
   pause;
   self.offensive := self.offensive - bonus;
   act("$1n calms down.", A_ALWAYS, self, null, null, TO_ROOM);
   quit;
}
dilend

Gives an NPC a better attack for a while and takes it back.

See also