/************************************************************************** * Why I wrote this code: * * This code is for the mega-lazy. It is for people who cannot be bothered * with making aliases to do spellups. Its for the kind of people who * can't be bothered making triggers to check to see if they have stopped * being affected. And it is to bridge that gap between imms who are * sure that players are cheating by using aliases/triggers and players * who want to be spelled up in peace without being accused of cheating. * * If you are reading this, it is because you can't be bothered writing * your own spellup command. This command took me all of 20 minutes to * write, and if you are a good coder, you could probably do it in 15, nay, * 10 minutes. What I have written here should work for you without * changing a thing. * * Indeed, a small proportion of MUDs out there already have some kind of * a spellup command. It is possible that one of them might let you use * their code. Of course, I have never seen one that does the checks * like mine does, but hey there is probably a better one out there. * * For the mega lazy, feel free to use this. Just put it in, bingo it * will work first time. * * Works perfectly for Rom 2.4b. May work on other code bases. * * Written by Ichike from World of Naruto on 20th April 2008. * * Rewritten by Ichike to work for stock muds on 23rd April 2008. * * Come visit us at http://narutomud.mudmagic.com/ * or telnet://narutomud.mudmagic.com:9000 * * E-mail me if you have problems with this, or would like to say * thanks, offer coin, etc: * therealadrian@hotmail.com * **************************************************************************/ /* ==== Add to interp.c ====== */ {"battle", do_battle_ready, POS_RESTING, 0, LOG_NORMAL, 1}, /* ==== Add to interp.h ====== */ DECLARE_DO_FUN( do_battle_ready ); /* ===== Add to healer.c ===== */ /* You can actually add this in a lot of places, or make its own .c file, * but since it is doing a similar thing to healer.c, it is easier to just * add it there */ void do_battle_ready (CHAR_DATA * ch, char * argument) { char buf[MAX_STRING_LENGTH]; act ("You spell yourself up", ch, NULL, NULL, TO_CHAR); act ("$n spells $sself up", ch, NULL, NULL, TO_ROOM); if (!is_affected (ch, skill_lookup ("armor"))) { do_cast (ch, "armor"); if (ch->mana > 5) ch->mana -= 5; else ch->mana = 0; WAIT_STATE (ch, 6); } if (!is_affected (ch, skill_lookup ("bless"))) { do_cast (ch, "bless"); if (ch->mana > 5) ch->mana -= 5; else ch->mana = 0; WAIT_STATE (ch, 6); } if (is_affected (ch, skill_lookup ("blindness"))) { sprintf (buf, "'cure blindness' %s", ch->name); do_cast (ch, buf); if (ch->mana > 5) ch->mana -= 5; else ch->mana = 0; WAIT_STATE (ch, 6); } if (is_affected (ch, skill_lookup ("plague"))) { sprintf (buf, "'cure disease' %s", ch->name); do_cast (ch, buf); if (ch->mana > 5) ch->mana -= 5; else ch->mana = 0; WAIT_STATE (ch, 6); } if (is_affected (ch, skill_lookup ("poison"))) { sprintf (buf, "'cure poison' %s", ch->name); do_cast (ch, buf); if (ch->mana > 5) ch->mana -= 5; else ch->mana = 0; WAIT_STATE (ch, 6); } if (!is_affected (ch, skill_lookup ("detect evil"))) { sprintf (buf, "'detect evil' %s", ch->name); do_cast (ch, buf); if (ch->mana > 5) ch->mana -= 5; else ch->mana = 0; WAIT_STATE (ch, 6); } if (!is_affected (ch, skill_lookup ("detect good"))) { sprintf (buf, "'detect good' %s", ch->name); do_cast (ch, buf); if (ch->mana > 5) ch->mana -= 5; else ch->mana = 0; WAIT_STATE (ch, 6); } if (!is_affected (ch, skill_lookup ("detect hidden"))) { sprintf (buf, "'detect hidden' %s", ch->name); do_cast (ch, buf); if (ch->mana > 5) ch->mana -= 5; else ch->mana = 0; WAIT_STATE (ch, 6); } if (!is_affected (ch, skill_lookup ("detect invis"))) { sprintf (buf, "'detect invis' %s", ch->name); do_cast (ch, buf); if (ch->mana > 5) ch->mana -= 5; else ch->mana = 0; WAIT_STATE (ch, 6); } if (!is_affected (ch, skill_lookup ("detect magic"))) { sprintf (buf, "'detect magic' %s", ch->name); do_cast (ch, buf); if (ch->mana > 5) ch->mana -= 5; else ch->mana = 0; WAIT_STATE (ch, 6); } if (!is_affected (ch, skill_lookup ("fly"))) { do_cast (ch, "fly"); if (ch->mana > 5) ch->mana -= 5; else ch->mana = 0; WAIT_STATE (ch, 6); } if (!is_affected (ch, skill_lookup ("frenzy"))) { do_cast (ch, "frenzy"); if (ch->mana > 5) ch->mana -= 5; else ch->mana = 0; WAIT_STATE (ch, 6); } if (!is_affected (ch, skill_lookup ("haste"))) { do_cast (ch, "haste"); if (ch->mana > 5) ch->mana -= 5; else ch->mana = 0; WAIT_STATE (ch, 6); } if (!is_affected (ch, skill_lookup ("infravision"))) { sprintf (buf, "'infravision' %s", ch->name); do_cast (ch, buf); if (ch->mana > 5) ch->mana -= 5; else ch->mana = 0; WAIT_STATE (ch, 6); } if (!is_affected (ch, skill_lookup ("invis"))) { do_cast (ch, "invis"); if (ch->mana > 5) ch->mana -= 5; else ch->mana = 0; WAIT_STATE (ch, 6); } if (!is_affected (ch, skill_lookup ("giant strength"))) { sprintf (buf, "'giant strength' %s", ch->name); do_cast (ch, buf); if (ch->mana > 5) ch->mana -= 5; else ch->mana = 0; WAIT_STATE (ch, 6); } if (!is_affected (ch, skill_lookup ("pass door"))) { sprintf (buf, "'pass door' %s", ch->name); do_cast (ch, buf); if (ch->mana > 5) ch->mana -= 5; else ch->mana = 0; WAIT_STATE (ch, 6); } if (is_affected (ch, skill_lookup ("curse"))) { sprintf (buf, "'remove curse' %s", ch->name); do_cast (ch, buf); if (ch->mana > 5) ch->mana -= 5; else ch->mana = 0; WAIT_STATE (ch, 6); } if (!is_affected (ch, skill_lookup ("sanctuary"))) { do_cast (ch, "sanctuary"); if (ch->mana > 5) ch->mana -= 5; else ch->mana = 0; WAIT_STATE (ch, 6); } if (!is_affected (ch, skill_lookup ("shield"))) { do_cast (ch, "shield"); if (ch->mana > 5) ch->mana -= 5; else ch->mana = 0; WAIT_STATE (ch, 6); } if (!is_affected (ch, skill_lookup ("stone skin"))) { sprintf (buf, "'stone skin' %s", ch->name); do_cast (ch, buf); if (ch->mana > 5) ch->mana -= 5; else ch->mana = 0; WAIT_STATE (ch, 6); } WAIT_STATE (ch, 18); return; /* That's it! */ /* For the mega-lazy, I include the help file too - although you will * likely want to change it to suit your mud */ 0 'BATTLE READY SPELLS'~ Syntax: Battle Prerequisite: You have knowledge of at least one of the battle ready spells : You have enough mana to perform the battle ready spells + 5 mana per spell that you can perform : You are not already affected by the said spells Note: This does not perform protection evil or protection good A skilled cleric can cast spells on themselves before battle, and has enough knowledge to know whether they are already affected by the spells, and whether they need to be cast. Below is a list of spells that will be performed on you with this command, if you have learned them, and if you are not already affected by them: 'armor', 'bless', 'cure blindness', 'cure disease', 'cure poison', 'det evil', 'det good', 'det hidden', 'det invis', 'det magic', 'fly', 'frenzy', 'giant strength', 'haste', 'infravision', 'invisibility', 'pass door', 'remove curse', 'sanctuary', 'shield', 'stone skin' ~