Diku (and older versions of circle) keep track in skillo() of each class and the level they needed for using a skill. That way, if you wanted to add a skill to a character class, just change the min. level from 0 to whatever level you want. It was, however, a pain to add new classes, as you had to add an argument to every single skillo() call... ;) However, I agree that checking for the skill itself (as per below) is probably the best solution, and I use it myself. Should probably go into stock! =) >---------- >From: John Evans[SMTP:evansj@HI-LINE.NET] >Sent: Wednesday, January 14, 1998 12:08 PM >To: CIRCLE@POST.QUEENSU.CA >Subject: Re: [Newbie] Skills > >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"; > return; > } > > +------------------------------------------------------------+ | 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