198 lines
8.2 KiB
Plaintext
198 lines
8.2 KiB
Plaintext
|
void wolf_form(object oActivator)
|
||
|
{
|
||
|
object oItem = GetItemActivated();
|
||
|
object oOther=GetItemActivatedTarget();
|
||
|
string sItemTag=GetTag(oItem);
|
||
|
if((sItemTag=="wolfformtool")&&(oActivator==oOther))
|
||
|
{
|
||
|
object oMod = GetModule();
|
||
|
int iFullMoon1 = GetLocalInt(oMod,"FullMoon1");
|
||
|
int iFullMoon2 = GetLocalInt(oMod,"FullMoon2");
|
||
|
int iFullMoon3 = GetLocalInt(oMod,"FullMoon3");
|
||
|
int iCurrentDay = GetCalendarDay();
|
||
|
int iIsWolf = GetLocalInt(oActivator,"HAS_WEREWOLF_EFFECT");
|
||
|
int iUsed = GetLocalInt(oActivator,"WOLF_TOOL_CHARGE");
|
||
|
|
||
|
if((iFullMoon1==iCurrentDay||iFullMoon2==iCurrentDay||iFullMoon3==iCurrentDay) && !(iIsWolf))
|
||
|
{
|
||
|
int iChange =WillSave(oActivator,10);
|
||
|
if((iChange)&&(!(iUsed)))
|
||
|
{
|
||
|
ExecuteScript("wwamrbrk",oActivator);
|
||
|
SetCampaignInt("WWData","HAS_WEREWOLF_EFFECT",1,oActivator);
|
||
|
SetLocalInt(oActivator,"HAS_WEREWOLF_EFFECT",1);
|
||
|
//Polymorping to wolf form.
|
||
|
effect ePolymorphWolf = EffectPolymorph(POLYMORPH_TYPE_WOLF);
|
||
|
ApplyEffectToObject(DURATION_TYPE_PERMANENT, ePolymorphWolf, oActivator);
|
||
|
AdjustAlignment(oActivator,ALIGNMENT_EVIL,50);
|
||
|
|
||
|
SetCampaignInt("WWData","WOLF_TOOL_CHARGE",1,oActivator);
|
||
|
SetLocalInt(oActivator,"WOLF_TOOL_CHARGE",1);
|
||
|
|
||
|
location lPC = GetLocation(oActivator);
|
||
|
object oFirstNPC = GetFirstObjectInShape(SHAPE_SPHERE,10.0,lPC,FALSE,OBJECT_TYPE_CREATURE);
|
||
|
while(oFirstNPC != OBJECT_INVALID)
|
||
|
{
|
||
|
int iSeen = GetObjectSeen(oActivator,oFirstNPC);
|
||
|
if (iSeen)
|
||
|
{
|
||
|
SetLocalInt(oActivator,"WasSeen",1);
|
||
|
}
|
||
|
//Get next object.
|
||
|
oFirstNPC = GetNextObjectInShape(SHAPE_SPHERE,10.0,lPC,FALSE,OBJECT_TYPE_CREATURE);
|
||
|
}
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
SendMessageToPC(oActivator,"You have failed to change.");
|
||
|
int iWait=GetCalendarDay();
|
||
|
int iWait1=(iWait+1);
|
||
|
SetCampaignInt("WWData","iWait",iWait1,oActivator);
|
||
|
SetLocalInt(oActivator,"iWait",iWait1);
|
||
|
SetCampaignInt("WWData","WOLF_TOOL_CHARGE",1,oActivator);
|
||
|
SetLocalInt(oActivator,"WOLF_TOOL_CHARGE",1);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
if((iFullMoon1!=iCurrentDay||iFullMoon2!=iCurrentDay||iFullMoon3!=iCurrentDay) && !(iIsWolf))
|
||
|
{
|
||
|
int iChange =WillSave(oActivator,15);
|
||
|
if((iChange)&&(!(iUsed)))
|
||
|
{
|
||
|
ExecuteScript("wwamrbrk",oActivator);
|
||
|
SetCampaignInt("WWData","HAS_WEREWOLF_EFFECT",1,oActivator);
|
||
|
SetLocalInt(oActivator,"HAS_WEREWOLF_EFFECT",1);
|
||
|
//Polymorping to wolf form.
|
||
|
effect ePolymorphWolf = EffectPolymorph(POLYMORPH_TYPE_WOLF);
|
||
|
ApplyEffectToObject(DURATION_TYPE_PERMANENT, ePolymorphWolf, oActivator);
|
||
|
AdjustAlignment(oActivator,ALIGNMENT_EVIL,50);
|
||
|
|
||
|
SetCampaignInt("WWData","WOLF_TOOL_CHARGE",1,oActivator);
|
||
|
SetLocalInt(oActivator,"WOLF_TOOL_CHARGE",1);
|
||
|
|
||
|
location lPC = GetLocation(oActivator);
|
||
|
object oFirstNPC = GetFirstObjectInShape(SHAPE_SPHERE,10.0,lPC,FALSE,OBJECT_TYPE_CREATURE);
|
||
|
while(oFirstNPC != OBJECT_INVALID)
|
||
|
{
|
||
|
int iSeen = GetObjectSeen(oActivator,oFirstNPC);
|
||
|
if (iSeen)
|
||
|
{
|
||
|
SetLocalInt(oActivator,"WasSeen",1);
|
||
|
}
|
||
|
//Get next object.
|
||
|
oFirstNPC = GetNextObjectInShape(SHAPE_SPHERE,10.0,lPC,FALSE,OBJECT_TYPE_CREATURE);
|
||
|
}
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
SendMessageToPC(oActivator,"You have failed to change.");
|
||
|
int iWait=GetCalendarDay();
|
||
|
int iWait1=(iWait+1);
|
||
|
SetCampaignInt("WWData","iWait",iWait1,oActivator);
|
||
|
SetLocalInt(oActivator,"iWait",iWait1);
|
||
|
SetCampaignInt("WWData","WOLF_TOOL_CHARGE",1,oActivator);
|
||
|
SetLocalInt(oActivator,"WOLF_TOOL_CHARGE",1);
|
||
|
}
|
||
|
}
|
||
|
SendMessageToPC(oActivator,"You may only use this tool once per day.");
|
||
|
}
|
||
|
}
|
||
|
|
||
|
void werewolf_form(object oActivator)
|
||
|
{
|
||
|
object oItem = GetItemActivated();
|
||
|
object oOther=GetItemActivatedTarget();
|
||
|
string sItemTag=GetTag(oItem);
|
||
|
if((sItemTag=="controlshapetool")&&(oActivator==oOther))
|
||
|
{
|
||
|
object oMod = GetModule();
|
||
|
int iFullMoon1 = GetLocalInt(oMod,"FullMoon1");
|
||
|
int iFullMoon2 = GetLocalInt(oMod,"FullMoon2");
|
||
|
int iFullMoon3 = GetLocalInt(oMod,"FullMoon3");
|
||
|
int iCurrentDay = GetCalendarDay();
|
||
|
int iIsWolf = GetLocalInt(oActivator,"HAS_WEREWOLF_EFFECT");
|
||
|
int iUsed = GetLocalInt(oActivator,"WOLF_TOOL_CHARGE");
|
||
|
|
||
|
if((iFullMoon1==iCurrentDay||iFullMoon2==iCurrentDay||iFullMoon3==iCurrentDay) && !(iIsWolf))
|
||
|
{
|
||
|
int iChange =WillSave(oActivator,10);
|
||
|
if((iChange)&&(!(iUsed)))
|
||
|
{
|
||
|
ExecuteScript("wwamrbrk",oActivator);
|
||
|
SetCampaignInt("WWData","HAS_WEREWOLF_EFFECT",1,oActivator);
|
||
|
SetLocalInt(oActivator,"HAS_WEREWOLF_EFFECT",1);
|
||
|
effect eMorph = EffectPolymorph(POLYMORPH_TYPE_WEREWOLF);
|
||
|
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eMorph, oActivator);
|
||
|
AdjustAlignment(oActivator,ALIGNMENT_EVIL,50);
|
||
|
|
||
|
SetCampaignInt("WWData","WOLF_TOOL_CHARGE",1,oActivator);
|
||
|
SetLocalInt(oActivator,"WOLF_TOOL_CHARGE",1);
|
||
|
|
||
|
location lPC = GetLocation(oActivator);
|
||
|
object oFirstNPC = GetFirstObjectInShape(SHAPE_SPHERE,10.0,lPC,FALSE,OBJECT_TYPE_CREATURE);
|
||
|
while(oFirstNPC != OBJECT_INVALID)
|
||
|
{
|
||
|
int iSeen = GetObjectSeen(oActivator,oFirstNPC);
|
||
|
if (iSeen)
|
||
|
{
|
||
|
SetLocalInt(oActivator,"WasSeen",1);
|
||
|
}
|
||
|
//Get next object.
|
||
|
oFirstNPC = GetNextObjectInShape(SHAPE_SPHERE,10.0,lPC,FALSE,OBJECT_TYPE_CREATURE);
|
||
|
}
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
SendMessageToPC(oActivator,"You have failed to change.");
|
||
|
int iWait=GetCalendarDay();
|
||
|
int iWait1=(iWait+1);
|
||
|
SetCampaignInt("WWData","iWait",iWait1,oActivator);
|
||
|
SetLocalInt(oActivator,"iWait",iWait1);
|
||
|
SetCampaignInt("WWData","WOLF_TOOL_CHARGE",1,oActivator);
|
||
|
SetLocalInt(oActivator,"WOLF_TOOL_CHARGE",1);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
if((iFullMoon1!=iCurrentDay||iFullMoon2!=iCurrentDay||iFullMoon3!=iCurrentDay) && !(iIsWolf))
|
||
|
{
|
||
|
int iChange =WillSave(oActivator,15);
|
||
|
if((iChange)&&(!(iUsed)))
|
||
|
{
|
||
|
ExecuteScript("wwamrbrk",oActivator);
|
||
|
SetCampaignInt("WWData","HAS_WEREWOLF_EFFECT",1,oActivator);
|
||
|
SetLocalInt(oActivator,"HAS_WEREWOLF_EFFECT",1);
|
||
|
effect eMorph = EffectPolymorph(POLYMORPH_TYPE_WEREWOLF);
|
||
|
ApplyEffectToObject(DURATION_TYPE_PERMANENT,eMorph,oActivator);
|
||
|
AdjustAlignment(oActivator,ALIGNMENT_EVIL,50);
|
||
|
|
||
|
SetCampaignInt("WWData","WOLF_TOOL_CHARGE",1,oActivator);
|
||
|
SetLocalInt(oActivator,"WOLF_TOOL_CHARGE",1);
|
||
|
|
||
|
location lPC = GetLocation(oActivator);
|
||
|
object oFirstNPC = GetFirstObjectInShape(SHAPE_SPHERE,10.0,lPC,FALSE,OBJECT_TYPE_CREATURE);
|
||
|
while(oFirstNPC != OBJECT_INVALID)
|
||
|
{
|
||
|
int iSeen = GetObjectSeen(oActivator,oFirstNPC);
|
||
|
if (iSeen)
|
||
|
{
|
||
|
SetLocalInt(oActivator,"WasSeen",1);
|
||
|
}
|
||
|
//Get next object.
|
||
|
oFirstNPC = GetNextObjectInShape(SHAPE_SPHERE,10.0,lPC,FALSE,OBJECT_TYPE_CREATURE);
|
||
|
}
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
SendMessageToPC(oActivator,"You have failed to change.");
|
||
|
int iWait=GetCalendarDay();
|
||
|
int iWait1=(iWait+1);
|
||
|
SetCampaignInt("WWData","iWait",iWait1,oActivator);
|
||
|
SetLocalInt(oActivator,"iWait",iWait1);
|
||
|
SetCampaignInt("WWData","WOLF_TOOL_CHARGE",1,oActivator);
|
||
|
SetLocalInt(oActivator,"WOLF_TOOL_CHARGE",1);
|
||
|
}
|
||
|
}
|
||
|
SendMessageToPC(oActivator,"You may only use this tool once per day.");
|
||
|
}
|
||
|
}
|