/* ********************************************************************* *\ | Author: Martin Landar, Edsbyn, Sweden - 6th of March 2001 | | | | File content: A guide to implement a skill named 'whirlwind' | | | | Skill is: A skill that will make warriors hit EVERY OPPONENT| | in the room! | | | | No rights reserved, !Copyright, you may copy, distrubate, sell etc. | | No need to credit me... infact, please don't. =) | | No responsability taken for what this may do to your mud, YOU | | downloaded it, YOU installed it, and YOU didn't pay ANY money for it! | \* ********************************************************************* */ First of all, I want to make clear that this is one of the easiest changes one can make to a mud. (Infact, spells are easier, but that's it I belive) This little guide was meant for people that have a mud of their own and don't have coding skills, but yet wishes to change the mud content. (Like myself) You pro-programmers won't probably need this, but may of course use it if you like. =) Well, here we go.. 6 files will need editing: class.c, act.offensive.c, intrepeter.c, spells.h, spell_parser.c and lib\misc\messages Let's start off with ------------spells.h------------ This is where we declare the skill and assign it with the correct skill number. Only ONE thing need to be added here, and that's near the top of the file. So, find this: #define SKILL_TRACK 140 /* Reserved Skill[] DO NOT CHANGE */ and below this, add: #define SKILL_WHIRLWIND 141 /* My own, wohoo! */ Now close and save spells.h and move on to ------------spell_parser.c------------ yet again, only ONE thing needs to be added. Go to the bottom of the file and you should find: skillo(SKILL_TRACK, "track"); First thing below this, add: skillo(SKILL_WHIRLWIND, "whirlwind"); Close and save spell_parser.c and move on to ------------intrepeter.c------------ In this file, we'll add the command 'whirlwind' to the master command list. Find ACMD(do_where); And directly below add: ACMD(do_whirlwind); Now we have declared the commando, now we just have to fill in the rest. Find { "who" , POS_DEAD , do_who , 0, 0 }, and directly below, add: { "whirlwind", POS_FIGHTING, do_whirlwind, 1, 0 }, That's that. Move on to ------------class.c------------ Here we'll assign the skill to the correct class and level. Of course, you MUSTN'T set it as a warrior skill or at level 25, but that's at least what I'm going to do. Find spell_level(SKILL_BASH, CLASS_WARRIOR, 12); and directly below, add: spell_level(SKILL_WHIRLWIND, CLASS_WARRIOR, 25); And it's there! Now to the hard work. Goto ------------act.offensive.c------------ we'll place the skill code itself in here, start off by finding ACMD(do_kick); directly below this, add: ACMD(do_whirlwind); Then go to the bottom of the file, and below the very last '}' add what's between the rows of *** : ************************************************************************* ACMD(do_whirlwind) { struct char_data *tch, *next_tch; int percent, prob; one_argument(argument, arg); /* If player is a mob or skill isn't learned, we can't do this. */ if (IS_NPC(ch) || !GET_SKILL(ch, SKILL_AGR_POS)) { send_to_char("You have no idea how.\r\n", ch); return; } /* Neither can we do this in a peaceful room */ if (ROOM_FLAGGED(IN_ROOM(ch), ROOM_PEACEFUL)) { send_to_char("No, not in here...\r\n", ch); return; } /* And finally, the show costs 30 moves, so the player must be able to pay */ if (GET_MOVE(ch) < 30) { send_to_char("You don't have the energy to do that just now!\r\n", ch); return; } /* Now we just need to calculate the chance for sucess before we begin. */ percent = number(1, 101); /* 101% is a complete failure */ prob = GET_SKILL(ch, SKILL_AGR_POS); if (percent > prob) { send_to_char("You fail to complete your whirlwind!\r\n", ch); return; } else /* Find first target, hit it, then move on to next one */ for (tch = world[ch->in_room].people; tch; tch = next_tch) { next_tch = tch->next_in_room; /* We'll leave out immortals, players (for !pk muds) and pets from the * hit list */ if (tch == ch) continue; if (!IS_NPC(tch) && GET_LEVEL(tch) >= LVL_IMMORT) continue; if (!pk_allowed && !IS_NPC(ch) && !IS_NPC(tch)) continue; if (!IS_NPC(ch) && IS_NPC(tch) && AFF_FLAGGED(tch, AFF_CHARM)) continue; /* GET_LEVEL(ch) is the damage value, change if you like */ damage(ch, tch, GET_LEVEL(ch), SKILL_WHIRLWIND); GET_MOVE(ch)=GET_MOVE(ch) - 30; } WAIT_STATE(ch, PULSE_VIOLENCE * 2); } ************************************************************************* Now all we need is some kewl messages. Go to the lib\misc\ lib and open up the file named 'messages'. In there, find * Kick M 134 (alot of messages) M 134 (more messages) now BEFORE *************************************************************************** * Weapon Attacks * *************************************************************************** Add the following: (Or any message that you would want) * Whirlwind M 141 $N falls down dead due to you terrible whirlwind! $n makes a horrible whirlwind-like attack! You should NOT see this, please report! You fail to complete your whirlwind! $n fails with $S whirlwind attack! $n fails with $S whirlwind attack! You make a whirlwind attack, wounding ALL of your opponents! $n attacks widely about, hitting everyone! You should NOT see this, please report! You cannot attack a GOD! $n forgets that you're in the room, and makes a whirlwind attack. What a pity... $n forgets all about $N's presence and makes a whirlwind attack! And with that, you're totally done. Save and close all files - recompile your mud and cheer! No e-mail support on this, it's far too easy to go wrong. Hope it's helpful. / Martin Landar