Manual:DIL Manual/meleedamage()

From DikuMUD Wiki
Jump to navigation Jump to search

Function:  
meleedamage ( c : unitptr, v : unitptr, b : integer, wt : integer );
  c
         the character that should make an additional attack
  v
         the character being attacked
  b
         any penalty or bonus added to the attack.
  wt
         the weapon type of the attack, if a valid type then that is used for the attack purpose, otherwise the default weapon/hand attack is used.
  returns
         The amount of damage done or -1 for failed
ch' performs an attack (using whatever weapon is wielded or his bare hands) against 'vict'.
If wtype is within a valid weapon range (WPN_XXX) any weapon will be bypassed,
and the value will be used as the attacktype.  Good for things like "meleeattack
(ch, vict, bonus, WPN_CIRCLE_KICK)"  If you want person to be able to perform an
extra attack even though wielding a weapon or something.  Note that this will
require BOTH a weapon type WPN_CIRCLE_KICK and a skill "kick" in order for it to
work.
Example:

---~---~---~---~---~---~---~---~---
dilbegin kick(arg : string);
external
   provoked_attack (victim : unitptr, ch : unitptr);
var
   bonus : integer;
   targ  : unitptr;
code

dilend

---~---~---~---~---~---~---~---~---

Function:  
meleedamage ( c : unitptr, v : unitptr, b : integer, wt : integer );
  c
         the character that should make an additional attack
  v
         the character being attacked
  b
         any penalty or bonus added to the attack.
  wt
         the weapon type of the attack, if a valid type then that is used for the attack purpose, otherwise the default weapon/hand attack is used.
  returns
         The amount of damage done or -1 for failed
ch' performs an attack (using whatever weapon is wielded or his bare hands) against 'vict'.
If wtype is within a valid weapon range (WPN_XXX) any weapon will be bypassed,
and the value will be used as the attacktype.  Good for things like "meleeattack
(ch, vict, bonus, WPN_CIRCLE_KICK)"  If you want person to be able to perform an
extra attack even though wielding a weapon or something.  Note that this will
require BOTH a weapon type WPN_CIRCLE_KICK and a skill "kick" in order for it to
work.
Example:

---~---~---~---~---~---~---~---~---
dilbegin kick(arg : string);
external
   provoked_attack (victim : unitptr, ch : unitptr);
var
   bonus : integer;
   targ  : unitptr;
code

dilend

---~---~---~---~---~---~---~---~---