// returns TRUE if the player has the wolf effect, else returns FALSE int iswolf(object oPC); // removes the werewolf effect void removewolf(object oPC); // turns the PC into a werewolf void makewolf(object oPC); // main werewolfscript void dowolf(object oPC); void dowolf(object oPC) { if (!GetIsObjectValid(GetItemPossessedBy(oPC,"jw_wolf_item"))) { removewolf(oPC); return; } if (iswolf(oPC)) { removewolf(oPC); return; } else { makewolf(oPC); RemoveFromParty(oPC); } string sSound; int nRandom=d4(); switch (nRandom) { case 1: sSound="c_werewolf_slct"; break; case 2: sSound="c_werewolf_bat2"; break; case 3: sSound="c_werewolf_bat1"; break; case 4: sSound="c_werewolf_hit1"; break; } AssignCommand(oPC,PlaySound(sSound)); } int iswolf(object oPC) { effect eEffect=GetFirstEffect(oPC); int nWolf=FALSE; while (GetIsEffectValid(eEffect)) { if ((GetEffectType(eEffect)==EFFECT_TYPE_POLYMORPH)&&(GetEffectSubType(eEffect)==SUBTYPE_EXTRAORDINARY)) { nWolf=1; } eEffect=GetNextEffect(oPC); } if (nWolf==TRUE) { // SpeakString("I am a wolf"); } else { //SpeakString("I am not a wolf"); } return (nWolf); } void removewolf(object oPC) { effect eEffect=GetFirstEffect(oPC); int nWolf=FALSE; while (GetIsEffectValid(eEffect)&&nWolf==0) { if ((GetEffectType(eEffect)==EFFECT_TYPE_POLYMORPH)&&(GetEffectSubType(eEffect)==SUBTYPE_EXTRAORDINARY)) { RemoveEffect(oPC,eEffect); nWolf=1; } eEffect=GetNextEffect(oPC); } // SpeakString("removing wolf effect"); } void makewolf(object oPC) { // SpeakString("polymorphing"); effect eEffect=EffectPolymorph(POLYMORPH_TYPE_WEREWOLF); eEffect=ExtraordinaryEffect(eEffect); ApplyEffectToObject(DURATION_TYPE_PERMANENT,eEffect,oPC); }