Re: [NEWBIE] Parry Dodge Block

From: Christopher Avans (parka@CDC.NET)
Date: 03/15/98


On Sun, 15 Mar 1998, Ben Britton wrote:

> Greetings!
>
> Im stuck on how to code a parry, dodge or block skill.  Could anyone send
> me a snippet, or maybe put me on my feet?
>
> Thanks!
> Ben
 at top of void hit under calls add:
bool DODGE = FALSE;
int hurm, hurm1;

then anywhere before the mess below add:

 if (GET_SKILL(victim, SKILL_DODGE)){
  if (GET_POS(victim) >POS_SITTING) {
  hurm = number (45, 131);
  hurm += GET_HITROLL(ch);
  hurm1 = number (0, 19);
  hurm1 += dex_app[GET_DEX(victim)].defensive;
  hurm1 += GET_SKILL(victim, SKILL_DODGE);
          if (hurm1 > hurm) {
   DODGE = TRUE;
 }
  }       }


then at bottom of hit after you see this.

if (type == SKILL_BACKSTAB) {
  dam *= backstab_mult(GET_LEVEL(ch));
  damage(ch, victim, dam, SKILL_BACKSTAB);
 }

change it to this

if (type == SKILL_BACKSTAB) {
  dam *= backstab_mult(GET_LEVEL(ch));
  damage(ch, victim, dam, SKILL_BACKSTAB);
 }else{

if (DODGE) {
        act("&7You dodge $n's attack.&0", TRUE, ch, 0, victim, TO_VICT);
act("&7$N dodges your attack.&0", TRUE, ch, 0, victim, TO_CHAR);
act("&7$N dodges $n's attack.&0", TRUE, ch, 0, victim, TO_NOTVICT);
improve_skill(victim, SKILL_DODGE);
}else
damage(ch, victim, dam, w_type);
        }
Okay may have to add/subtract a '}' for I am cuting and pasting >:)
Okay why set a bool and check it at bottom instead of a 'punt' out if true
at top. Well this way have to add zero checks for pos_fighting if not set
fighting and all the stuff associated with it. I dont think you notice the
difrence in speed >:) if you do please quit taking drugs

                Banyal

p.s. if you have some sorta dual wield have to add it to void You use for
secound hand. Also you prob can see how to make a parry and rippost out
this. O yeah comment out improve_skill and define skill_dodge if need more
info mail me direct


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/15/00 PST