dodge and parry in fight code

From: Alex Mann (
Date: 03/10/01


I am trying to add dodging and parrying of attacks into my fight code. Atm i
am doing it like this:

// Top of hit code //
      damage(ch, victim, 0, w_type);
  } else {

    /* Now we check to we wether the victim parries or dodges.*/
    if (IS_NPC(victim)){
    dodge = (number(1, 40)+ (GET_LEVEL(victim)/2));
    faildodge = (number(1, 20));
    dodge = (number(1, 20)+ (GET_DEX(victim) + (GET_LEVEL(victim)/2)));
    faildodge = (GET_DEX(ch) + (GET_STR(ch) + number(1,20)));
     if (dodge > faildodge) {
       act("&bYou dodge out of the way of $N's attack!&w\r\n", FALSE,
victim, 0, ch, TO_CHAR);
       act("&b$n attacks $N who dodges out of the way!&w\r\n", FALSE,
victim, 0, ch, TO_NOTVICT);
       act("&bYou attempt to attack $n who dodges out of the way!&w\r\n",
FALSE, victim, 0, ch, TO_VICT);
     /* okay, we know the guy has been hit.  now calculate damage. */

// Rest of hit //

My querie is with the calculations i am using, do NPC's have str dex etc
values which would mean I could use just 1 equasion taking str dex etc into

If they don't which is what i think, then is the way i have coded the above
bit correct. I want to use the IS_NPC check to use a different exquasion for
npcs when they attack, and for when players use do_hit. Have I done this
correct in order to achieve this. because my npcs seem to only dodge very
rarely which sugegsts that it is using the player equasion not the npc


Get Your Private, Free E-mail from MSN Hotmail at

   | FAQ: |
   | Archives: |

This archive was generated by hypermail 2b30 : 12/04/01 PST