HoS_PRC8/_mod/_module/nss/use_trial_fire.nss
Jaysyn904 04165202c0 Initial upload
Initial upload
2024-11-25 19:36:07 -05:00

45 lines
1.7 KiB
Plaintext

void main()
{
object oMe=OBJECT_SELF;
object oMod=GetModule();
object oSpawnLoc;
object oPC=GetLastUsedBy();
object oCreature;
int nCount=GetLocalInt(oMod,"nPeliosTrialTwo");
string sRes;
object oTmp;
if (GetLocalInt(oMe,"nUsed")!=TRUE)
{ // first time used
AssignCommand(oMe,ActionPlayAnimation(ANIMATION_PLACEABLE_ACTIVATE,1.0,500000.0));
SetLocalInt(oMe,"nUsed",TRUE);
nCount++;
SetLocalInt(oMod,"nPeliosTrialTwo",nCount);
if (nCount==1)
{ // first guardian
sRes="airhuge001"; // air elemental
oSpawnLoc=GetObjectByTag("TRIAL_FIRE1");
oTmp=CreateObject(OBJECT_TYPE_PLACEABLE,"plc_flamelarge",GetLocation(oSpawnLoc),FALSE);
} // first guardian
else if (nCount==2)
{ // second guardian
sRes="firehuge001"; // fire elemental
oSpawnLoc=GetObjectByTag("TRIAL_FIRE2");
oTmp=CreateObject(OBJECT_TYPE_PLACEABLE,"plc_flamelarge",GetLocation(oSpawnLoc),FALSE);
} // second guardian
else if (nCount==3)
{ // third guardian
sRes="earthhuge001"; // earth elemental
oSpawnLoc=GetObjectByTag("COLUMN_TRIAL");
oTmp=CreateObject(OBJECT_TYPE_PLACEABLE,"plc_solpurple",GetLocation(oSpawnLoc),FALSE);
oTmp=GetObjectByTag("TrialTwoDoor");
SetLocked(oTmp,FALSE);
SetPlotFlag(oTmp,FALSE);
DestroyObject(oTmp);
oSpawnLoc=GetObjectByTag("TRIAL_FIRE3");
oTmp=CreateObject(OBJECT_TYPE_PLACEABLE,"plc_flamelarge",GetLocation(oSpawnLoc),FALSE);
} // third guardian
oCreature=CreateObject(OBJECT_TYPE_CREATURE,sRes,GetLocation(oSpawnLoc),FALSE);
DelayCommand(2.0,AssignCommand(oCreature,PlayVoiceChat(VOICE_CHAT_THREATEN,oCreature)));
} // first time used
}