Re: [NEWBIE][CODE] Blocking Skills

From: Maximum Carnage (carnage@games2.mudsrus.com)
Date: 02/09/99


OK well I can tell ya the general places to hit with this and alittle bit
of theory, but the way I did mine is rather hard to understand and even so
its not completely finished:>  Anyways, pretty much as you probley know
your gonna have to add a skill called dodge, block, etc.  Than in fight.c
inside the perform violence function you are gonna have to think about
this kinda backwards cause this routine is called when were talking about
doing damage.  With this thought in mind you are going to want to check if
your victim has the skill Dodge and if they do run a variable number like
so:
   if(!IS_NPC(FIGHTING(ch)) && GET_SKILL(FIGHTING(ch),SKILL_DODGE)) {
       temp_prob=GET_SKILL(FIGHTING(ch),SKILL_DODGE);
             prob= number(1,120);

        if(temp_prob>prob)
        {
          defense_type=SKILL_DODGE;
        }
  }
NOTE: I have to work on that number thing because its appears the victim
affected dodges just alittle too much.
ALSO NOTE: at the top where everything else is intilized you must add this
too:
   int defense_type = 0;
   int temp_prob, prob = 0;


So lastly, depending on weather or not you have multi-hit or not, you
could do two of the following things:
1) add an extra claus before the hit at the end of your routine that if
the defense type is = to zero hit, because the defense type won't be 0 if
they are sappose to dodge.
2) If U have Multi-hit just simply put an apr -- in I think within your
check at the top to see if your enemy is able to dodge.

Um thats the general behind it, I originally seen this in the pheonixMUD
base on circleMUD 2.0 src and thats how I grasped the concept.  Um I hope
this helps.  LAterz.

-Smillie, IMP
MAximum Carnage
Carnage.mudsrus.com 6669

On Tue, 9 Feb 1999, Beau Perrizo wrote:

> Hello,
>    I am fairly new to coding and my C++ experience is zero.  I do have some
> idea of how to use it but I'm afraid my knowledge is fairly limited.  I wanted
> to know if anyone could tell me how I would go about adding a skill which a
> player could use to block attacks.  My basic idea is to have the skill work
> like second attack or third attack (the better you are the higher the chance
> you'll get your extra hit) but instead of hitting, block hits so that a
> message is displayed and the character suffers no damage.  I have seen this on
> some MUDs in the form of parry, block, and dodge skills.  If it is relevant or
> helps any I am currently running Circlemud 3.0 bpl11 in a Win95 Dos shell.  My
> version is rather heavily modified skillwise at this point and so most patches
> aren't going to work.  I will greatly appreciate any kind of help.
>
> Thanks,
> Turgantarganath
>
>
>      +------------------------------------------------------------+
>      | Ensure that you have read the CircleMUD Mailing List FAQ:  |
>      |  http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html  |
>      +------------------------------------------------------------+
>


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



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