generated from Jaysyn/ModuleTemplate
132 lines
4.5 KiB
Plaintext
132 lines
4.5 KiB
Plaintext
// PLACEHOLDER
|
|
|
|
int preEvent()
|
|
{
|
|
return 1;
|
|
}
|
|
|
|
void postEvent()
|
|
{
|
|
object oItem=GetItemActivated();
|
|
object oUser=GetItemActivator();
|
|
object oOther=GetItemActivatedTarget();
|
|
string sItemTag=GetTag(oItem);
|
|
if((sItemTag=="ControlShapeTool")&&(oUser==oOther))
|
|
{
|
|
int iFullMoon = GetLocalInt(oUser,"WOLF_DAYS");
|
|
int iIsWolf = GetLocalInt(oUser,"HAS_WEREWOLF_EFFECT");
|
|
int iUsed = GetLocalInt(oUser,"WOLF_TOOL_CHARGE");
|
|
if((iFullMoon < 4) && iIsWolf)
|
|
{
|
|
int iChange =WillSave(oUser,25);
|
|
if((iChange)&&(!(iUsed)))
|
|
{
|
|
int iInvol = GetLocalInt(oUser,"INVOLUNTARY");
|
|
/*if(!(iInvol))
|
|
{
|
|
SetLocalInt(oUser,"HAS_WEREWOLF_EFFECT",0);
|
|
AssignCommand(oUser, ActionRest());
|
|
ActionWait(2.5);
|
|
AssignCommand(oUser, ClearAllActions());
|
|
}*/
|
|
if(iInvol)
|
|
{
|
|
object oWerewolf = GetLocalObject(oUser,"MY_WOLF");
|
|
location lWerewolf = GetLocation(oWerewolf);
|
|
AssignCommand(oUser,JumpToLocation(lWerewolf));
|
|
DestroyObject(oWerewolf);
|
|
SetLocalInt(oUser, "HAS_WEREWOLF_EFFECT", 0);
|
|
SetLocalInt(oUser,"ONE_CHANGE",0);
|
|
SetLocalInt(oUser,"INVOLUNTARY",0);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
SendMessageToPC(oUser,"You have failed to change.");
|
|
int iWait=GetCalendarDay();
|
|
int iWait1=(iWait+1);
|
|
SetLocalInt(oUser,"iWait",iWait1);
|
|
SetLocalInt(oUser,"WOLF_TOOL_CHARGE",1);
|
|
}
|
|
}
|
|
if((iFullMoon <4) && !(iIsWolf))
|
|
{
|
|
int iChange =WillSave(oUser,10);
|
|
if((iChange)&&(!(iUsed)))
|
|
{
|
|
ExecuteScript("wwamrbrk",oUser);
|
|
SetLocalInt(oUser,"HAS_WEREWOLF_EFFECT",1);
|
|
effect eMorph = EffectPolymorph(POLYMORPH_TYPE_WEREWOLF);
|
|
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eMorph, oUser);
|
|
AdjustAlignment(oUser,ALIGNMENT_EVIL,50);
|
|
//effect eSilver = EffectDamageReduction(15,DAMAGE_POWER_PLUS_ONE);
|
|
//ApplyEffectToObject(DURATION_TYPE_PERMANENT,eSilver,oUser);
|
|
}
|
|
else
|
|
{
|
|
SendMessageToPC(oUser,"You have failed to change.");
|
|
int iWait=GetCalendarDay();
|
|
int iWait1=(iWait+1);
|
|
SetLocalInt(oUser,"iWait",iWait1);
|
|
SetLocalInt(oUser,"WOLF_TOOL_CHARGE",1);
|
|
}
|
|
}
|
|
if((iFullMoon >= 4) && iIsWolf)
|
|
{
|
|
int iChange =WillSave(oUser,20);
|
|
if((iChange)&&(!(iUsed)))
|
|
{
|
|
int iInvol = GetLocalInt(oUser,"INVOLUNTARY");
|
|
/*if(!(iInvol))
|
|
{
|
|
SetLocalInt(oUser,"HAS_WEREWOLF_EFFECT",0);
|
|
AssignCommand(oUser, ActionRest());
|
|
ActionWait(2.5);
|
|
AssignCommand(oUser, ClearAllActions());
|
|
}*/
|
|
if(iInvol)
|
|
{
|
|
object oWerewolf = GetLocalObject(oUser,"MY_WOLF");
|
|
location lWerewolf = GetLocation(oWerewolf);
|
|
AssignCommand(oUser,JumpToLocation(lWerewolf));
|
|
DestroyObject(oWerewolf);
|
|
SetLocalInt(oUser, "HAS_WEREWOLF_EFFECT", 0);
|
|
SetLocalInt(oUser,"ONE_CHANGE",0);
|
|
SetLocalInt(oUser,"INVOLUNTARY",0);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
SendMessageToPC(oUser,"You have failed to change.");
|
|
int iWait=GetCalendarDay();
|
|
int iWait1=(iWait+1);
|
|
SetLocalInt(oUser,"iWait",iWait1);
|
|
SetLocalInt(oUser,"WOLF_TOOL_CHARGE",1);
|
|
}
|
|
}
|
|
if((iFullMoon >= 4) && !(iIsWolf))
|
|
{
|
|
int iChange =WillSave(oUser,15);
|
|
if((iChange)&&(!(iUsed)))
|
|
{
|
|
ExecuteScript("wwamrbrk",oUser);
|
|
SetLocalInt(oUser,"HAS_WEREWOLF_EFFECT",1);
|
|
effect eMorph = EffectPolymorph(POLYMORPH_TYPE_WEREWOLF);
|
|
ApplyEffectToObject(DURATION_TYPE_PERMANENT,eMorph,oUser);
|
|
AdjustAlignment(oUser,ALIGNMENT_EVIL,50);
|
|
//effect eSilver = EffectDamageReduction(15,DAMAGE_POWER_PLUS_ONE);
|
|
//ApplyEffectToObject(DURATION_TYPE_PERMANENT,eSilver,oUser);
|
|
}
|
|
else
|
|
{
|
|
SendMessageToPC(oUser,"You have failed to change.");
|
|
int iWait=GetCalendarDay();
|
|
int iWait1=(iWait+1);
|
|
SetLocalInt(oUser,"iWait",iWait1);
|
|
SetLocalInt(oUser,"WOLF_TOOL_CHARGE",1);
|
|
}
|
|
}
|
|
}
|
|
return;
|
|
}
|