Difference between revisions of "Manual:DIL Manual/SFB COM"

From DikuMUD Wiki
Jump to navigation Jump to search
(XML import)
 
Line 1: Line 1:
 +
= SFB_COM =
  
 +
SFB_COM is a combat message that is sent during combat.
  
<span id="sfbcom"></span>
+
When this flag is used in a wait() statement, it will trigger on combat messages.
SFB_COM            Combat message
+
The unit containing the DIL program needs not be involved in the combat itself,
 +
it will react to any combat in it's local environment. The combat message is sent
 +
just prior to the hit.
  
  When this flag is set, the routine gets activated whenever a combat is in
+
Only the following global value is set in a SFB_COM combat message:
  progress. The unit containing the DIL program needs not be involved in the
+
  'activator' : is a unitptr to the PC/NPC about to hit someone else.
  combat itself:
 
  
      'activator'... is a unitptr to the PC/NPC about to hit someone else.
+
Note that:
      'argument'.... is empty.
+
  command(CMD_AUTO_COMBAT)
  
      command(CMD_AUTO_COMBAT) will evaluate to TRUE.
+
will evaluate to TRUE.
---~---~---~---~---~---~---~---~---
+
 
 +
Example:
 +
  wait(SFB_COM, activator == self);
 +
 
 +
Example:
 +
  wait(SFB_COM, activator == self.fighting);
 +
 
 +
Example:
 +
  wait(SFB_ALL, TRUE);
 +
  if (command(CMD_AUTO_COMBAT))
 +
    exec("flee", self);
 +
 
 +
See also:
 +
  > wait

Revision as of 08:16, 17 August 2022

SFB_COM

SFB_COM is a combat message that is sent during combat.

When this flag is used in a wait() statement, it will trigger on combat messages. The unit containing the DIL program needs not be involved in the combat itself, it will react to any combat in it's local environment. The combat message is sent just prior to the hit.

Only the following global value is set in a SFB_COM combat message:

 'activator' : is a unitptr to the PC/NPC about to hit someone else.

Note that:

 command(CMD_AUTO_COMBAT) 

will evaluate to TRUE.

Example:

 wait(SFB_COM, activator == self);

Example:

 wait(SFB_COM, activator == self.fighting);

Example:

 wait(SFB_ALL, TRUE);
 if (command(CMD_AUTO_COMBAT))
   exec("flee", self);

See also:

 > wait