Re: [Newbie] Skills

From: John Evans (evansj@HI-LINE.NET)
Date: 01/14/98

On Wed, 14 Jan 1998, Mike Carpenter wrote:

> Okay i have added a new skill (i have patch12)  and this is my first time
> entering a skill.  I have the skill defined in spells.h and then I
> have it assigned to a class in class.c  I also put it in interpreter.c and
> spell_parser.c.  It is showing up at the right level for the class but
> if any person at any level typed the command they could do it.

Of course. It's a command. The only thing the keeps people from typing a
command is the level restriction. If you're below the level needed to use
the command, you get the "Huh?" message, otherwise it gets passed on to
the ACMD() function.

> I guess my question is, where do I code that this skill is only for class
> bard... I didn't think i needed to put a check in the actual ACMD
> function...I check do_steal and didnt see a check to make sure only
> thieves are using this?  How do I do this?   What did i forget?

I trashed the idea of doing a check for class at the top of skill usages.
That way I can add in classes more easily in the future if I feel like I
need to.

What I did is like so:

  if (!GET_SKILL(ch, SKILL_KICK)) {
    send_to_char("You better keep both feet on the ground.\r\n";

Stick code like that at the top of each funtion, and the person won't be
able to use that particular skill unless they have the skill. That allows
for giving monks the kick skill without having to remember to alter the
ACMD(do_kick) function to include a check for monks. It simply makes it
easier to make the classes more dynamic. That's a vital thing when
playtesting and getting the game balanced.

PS: I don't have do_kick, do_punch, etc.. functions anymore. I merged
them all together in a ACMD(do_gen_attack) function because they were all
identical in code with only slight differences in damage and maybe a
message or two that were easily handled with a switch() call.

John Evans <>  --

Any sufficiently advanced technology is indistinguishable from magic.
--Arthur C. Clarke

     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | |

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