Battledale_PRC8/_module/nss/jw_wolf_script.nss
Jaysyn904 7b9e44ebbb Initial upload
Initial upload.  PRC8 has been added.  Module compiles, PRC's default AI & treasure scripts have been integrated.  Started work on top hak for SLA / Ability / Scripting modifications.
2024-03-11 23:44:08 -04:00

119 lines
1.9 KiB
Plaintext

// 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);
}