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

63 lines
2.2 KiB
Plaintext

void fnPurgeShadowItems()
{
object oPC=OBJECT_SELF;
object oItem=GetFirstItemInInventory(oPC);
string sTag;
while(oItem!=OBJECT_INVALID)
{
sTag=GetTag(oItem);
if (sTag=="rts_it_light"||sTag=="rts_it_blast"||sTag=="rts_it_negprot") DelayCommand(2.0,DestroyObject(oItem));
else if(sTag=="rts_it_shd1"||sTag=="rts_it_shd4"||sTag=="rts_it_shd2"||sTag=="rts_it_shd3"||sTag=="rts_it_shd3"||sTag=="rts_it_shd5") DelayCommand(2.0,DestroyObject(oItem));
oItem=GetNextItemInInventory(oPC);
}
oItem=GetItemInSlot(INVENTORY_SLOT_RIGHTHAND,oPC);
sTag=GetTag(oItem);
if (sTag=="rts_it_light"||sTag=="rts_it_blast"||sTag=="rts_it_negprot"||
sTag=="rts_it_shd1"||sTag=="rts_it_shd2"||sTag=="rts_it_shd3"||
sTag=="rts_it_shd3"||sTag=="rts_it_shd4"||sTag=="rts_it_shd5") DelayCommand(2.0,DestroyObject(oItem));
}
void main()
{
object oPC=GetEnteringObject();
string sID=GetLocalString(oPC,"sTeamID");
object oWP=GetWaypointByTag(sID+"_START");
object oMod=GetModule();
int nLives=GetLocalInt(oMod,"nElimLives");
int nGT=GetLocalInt(oMod,"nGameType");
int nDeaths=GetLocalInt(oPC,"nDeaths");
int bEscapeOk=TRUE;
if (GetIsPC(oPC)==TRUE)
{ // is a PC
if (GetIsPC(oPC)==TRUE&&nGT==0)
{ // elimination style game
if (nDeaths>=nLives) bEscapeOk=FALSE;
} // elimination style game
if (oWP!=OBJECT_INVALID&&bEscapeOk==TRUE)
{
AssignCommand(oPC,ClearAllActions());
fnPurgeShadowItems();
AssignCommand(oPC,JumpToObject(oWP));
SetLocalInt(oPC,"nDied",0);
}
else if (bEscapeOk==FALSE)
{ // escape not allowed
SendMessageToPC(oPC,"You have used up your lives. You cannot escape the outer planes.");
oWP=GetWaypointByTag("ENTER_THE_SHADOW");
AssignCommand(oPC,ClearAllActions());
AssignCommand(oPC,JumpToObject(oWP));
} // escape not allowed
else
{
SendMessageToPC(oPC,"Cannot find point "+sID+"_START");
}
} // is a PC
else
{ // entered by an NPC
oWP=GetWaypointByTag("ENTER_THE_SHADOW");
AssignCommand(oPC,ClearAllActions());
AssignCommand(oPC,JumpToObject(oWP));
DeleteLocalInt(oPC,"nShadowJump"); // move the NPC back to the start
} // entered by an NPC
}