/************************************************************************** * Selfclass snippet designed for Godwars/LOW4 but should work for other * * godwars derivatives with little to no tweaking. I decided not to use * * the mages in stock low4 because they were very buggy. I am planning * * on writing a unique mage class in the future and will probably release * * that as well. I will release an updated version of this snippet when * * I do that. I don't ask for any credits in a helpfile or an email or * * anything. All I ask is that if you use this snippet you leave the * * comments intact. You can delete this header but leave the comments * * alone. * * * * * * Sharmair recoded my original selfclass snippet and gave me a lot of * * suggestions. I was going to put his version of it in this release as * * a second option of functions, but when I got to editing it and using * * some of his suggestions I realized that mine wasn't that different. * * So if you really wanna see exactly what his function was, look for * * the thread on mudbytes.net where we discuss this snippet. Thanks to * * everybody who posted constructive criticism on this snippet. * * * * * * Don't forget to add this to interp.c and merc.h they should look like * * this: * * * * merc.h * * DECLARE_DO_FUN( do_selfclass ); * * * * interp.c * * {"selfclass", do_selfclass, POS_STANDING, 3, LOG_NORMAL }, * * * *************************************************************************/ /* Add this function to any file you like. Mine is in low_act.c for no real * reason. Leave this comment out of the code. */ /* * Selfclass command by Igabod with a good bit of help from Sharmair of * the forums at http://www.mudbytes.net */ void do_selfclass(CHAR_DATA *ch,char *argument) { char arg1[MAX_INPUT_LENGTH]; const char* cname = ""; if (IS_NPC(ch)) return; if (ch->level < 3) { do_huh(ch,""); return; } argument = one_argument(argument,arg1); if (ch->class != 0 || IS_SET(ch->special,SPC_CHAMPION)) { stc("You already have a class!\r\n",ch); return; } if (arg1[0] == '\0') { stc("Syntax: selfclass \r\n\r\n" "Class being one of:\r\n" "Monk Drow Ninja Vampire Werewolf Demon Highlander\r\n\r\n",ch); return; } /* * Monk */ if (!str_cmp(arg1,"monk")) { ch->class = CLASS_MONK; cname = "a Monk"; } /* * Drow */ else if (!str_cmp(arg1,"drow")) { ch->class = CLASS_DROW; cname = "a Drow"; } /* *Ninja */ else if (!str_cmp(arg1,"ninja")) { ch->class = CLASS_NINJA; cname = "a Ninja"; } /* * Vampire */ else if (!str_cmp(arg1,"vampire")) { ch->class = CLASS_VAMPIRE; SET_BIT(ch->immune,IMM_SUNLIGHT); cname = "a Vampire"; } /* * Werewolf */ else if (!str_cmp(arg1,"werewolf")) { ch->class = CLASS_WEREWOLF; cname = "a Werewolf"; } /* * Demon */ else if (!str_cmp(arg1,"demon")) { ch->class = CLASS_DEMON; ch->special = SPC_DEMON_LORD; cname = "a Demon"; } /* * Highlander */ else if (!str_cmp(arg1,"highlander")) { ch->class = CLASS_HIGHLANDER; ch->pcdata->powers[0] = 1; cname = "a Highlander"; } else { do_selfclass(ch,""); return; } free_string(ch->lord); ch->lord = str_dup(""); ch->pcdata->stats[UNI_GEN] = 1; do_mclear(ch,""); sprintf(arg1,"%s is now %s.",ch->name,cname); do_info(ch,arg1); log_string(arg1); sprintf(arg1,"You are now %s!\r\n",cname); stc(arg1,ch); return; } /* Now delete this comment and do a clean compile and you are ready to * go. * * You may want to change the UNI_GEN to a different number depending * on your mud. On my mud I've changed up generation quite a bit so I * set it to 10 by default but it's set as 1 here. * * Igabod */