102 lines
3.2 KiB
Plaintext
102 lines
3.2 KiB
Plaintext
////////////////////////////////////////////////////////////////////////////////
|
|
// ou_level3_temple - Level 3 temple portal
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
#include "header_sounds"
|
|
|
|
|
|
void fnWarnAllPlayers(string sMsg)
|
|
{
|
|
object oPC=GetFirstPC();
|
|
while(oPC!=OBJECT_INVALID)
|
|
{
|
|
SendMessageToPC(oPC,sMsg);
|
|
AssignCommand(oPC,fnSoundAlert("as_an_dragonror1"));
|
|
oPC=GetNextPC();
|
|
}
|
|
} // fnWarnAllPlayers()
|
|
|
|
void fnJump(object oDest)
|
|
{
|
|
object oMe=OBJECT_SELF;
|
|
if (GetArea(oMe)!=GetArea(oDest)||GetDistanceBetween(oMe,oDest)>1.0)
|
|
{ // jump
|
|
AssignCommand(oMe,ClearAllActions(TRUE));
|
|
AssignCommand(oMe,JumpToObject(oDest));
|
|
DelayCommand(0.5,fnJump(oDest));
|
|
} // jump
|
|
} // fnJump()
|
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
void main()
|
|
{
|
|
object oMe=OBJECT_SELF;
|
|
object oPC=GetLastUsedBy();
|
|
int nALC=GetAlignmentLawChaos(oPC);
|
|
int nAGE=GetAlignmentGoodEvil(oPC);
|
|
int bEvil=FALSE;
|
|
string sTag=GetTag(oMe);
|
|
object oMod=GetModule();
|
|
object oItem;
|
|
object oGod;
|
|
int nPR;
|
|
int nCount=GetLocalInt(oMod,"nElderGodDisturb");
|
|
object oWP;
|
|
int bQualified=FALSE;
|
|
nCount++;
|
|
SetLocalInt(oMod,"nElderGodDisturb",nCount);
|
|
nCount=nCount*10;
|
|
nPR=d100();
|
|
if (nPR<=nCount)
|
|
{ // wake one or both gods
|
|
oGod=GetObjectByTag("Aisada");
|
|
if (oGod==OBJECT_INVALID)
|
|
{ // might be woken
|
|
oWP=GetWaypointByTag("POST_Aisada");
|
|
oGod=CreateObject(OBJECT_TYPE_CREATURE,"aisada",GetLocation(oWP));
|
|
fnWarnAllPlayers("The elder goddess Aisada has awakened from her centuries of slumber!");
|
|
} // might be woken
|
|
oGod=GetObjectByTag("Umnuikal");
|
|
if (oGod==OBJECT_INVALID)
|
|
{ // might be woken
|
|
oWP=GetWaypointByTag("POST_Umnuikal");
|
|
oGod=CreateObject(OBJECT_TYPE_CREATURE,"umnuikal",GetLocation(oWP));
|
|
fnWarnAllPlayers("The elder god Umnuikal has awakened from her centuries of slumber!");
|
|
} // might be woken
|
|
} // wake one or both gods
|
|
if (sTag=="rts_darkminion"||sTag=="rts_darkartifact") bEvil=TRUE;
|
|
if (bEvil&&nAGE!=ALIGNMENT_GOOD)
|
|
{ // not good
|
|
bQualified=TRUE;
|
|
} // not good
|
|
else if (!bEvil&&nAGE!=ALIGNMENT_EVIL)
|
|
{ // not evil
|
|
bQualified=TRUE;
|
|
} // not evil
|
|
SetLocalInt(oPC,"bTEGodsCompleted",TRUE);
|
|
nCount=GetLocalInt(oPC,"nQuests");
|
|
nCount++;
|
|
SetLocalInt(oPC,"nQuests",nCount);
|
|
if (bQualified)
|
|
{ // give item
|
|
if (sTag!="rts_darkminion"&&sTag!="rts_lightminion")
|
|
{ // artifact
|
|
oItem=CreateItemOnObject(sTag,oPC);
|
|
oWP=GetWaypointByTag("TEMPLE_COMPLETED");
|
|
AssignCommand(oPC,fnJump(oWP));
|
|
} // artifact
|
|
else
|
|
{ // powerup
|
|
if (bEvil) SetLocalInt(oPC,"bTempleQuestPowerUp",2);
|
|
else { SetLocalInt(oPC,"bTempleQuestPowerUp",1); }
|
|
ExecuteScript("temple_powerup",oPC);
|
|
} // powerup
|
|
} // give item
|
|
else
|
|
{ // expell
|
|
oWP=GetWaypointByTag("TEMPLE_COMPLETED");
|
|
AssignCommand(oPC,fnJump(oWP));
|
|
SendMessageToPC(oPC,"You have chosen poorly. The elder gods do not reward you.");
|
|
} // expell
|
|
}
|
|
////////////////////////////////////////////////////////////////////////////////
|