--- Albert Brauneis <Dajawu36@aol.com> wrote: > I need a little help here, I am tring to make a guard skill. What it > does is you type guard <name> and that makes you guard <name> Then if > anyone attacks <name> The person who is guarding automaticly rescues > them. How would I go about this. Please no flames, just help. :) Actually, someone sent some codes on this a week or so ago to the mailing list, asking for help. Maybe you can look thru the archive for it. Anyway, basically it's supposed to be something like this: 1. Add these into the char_data structure (struct.h), something like below, into... maybe struct char_special_data or something. The GUARDING will point to the person who player is guarding, and the GUARDED_BY will point to the person who is guarding the player. struct char_data *guarding struct char_data *guarded_by 2. Create some shortcuts for easy reference (utils.h). Look at FIGHTING(ch) as an example. 3. Create a ACMD(guard) function that will be called when someone type "guard <name>". Where to put? Anywhere you think is suitable. In the function: ACMD(guard) { if (no argument) give error message to player else if (anyone around with name) /* found someone with specified name in room */ if (person specified is player) if (player is guarding someone right now) { /* make player stop guarding */ set person being guarded by player to null set player guarding to null } else give error message to player else { set player to guard person set person to be guarded by player } else /* no one is around with specified name */ give error message to player } 4. Place "guard" into the command_info table (interpreter.c), with all relevent info. 5. If you're making this as a skill, then you need to: - define it's skill number in spells.h - set up the skill info under skillo() in spell_parser.c - specify the skill's class and level in init_spell_level in class.c Hmm... did I missed anything? Hopefully not. Better check out the WTFAQ and FAQ for more detail info. This is just a simple outline... G'luck! :) === Afizal Mustapa Petaling Jaya, Malaysia (amustapa@hotmail.com) _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com +------------------------------------------------------------+ | 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