Battledale_PRC8/_module/nss/jw_dungeon_exit.nss
Jaysyn904 7b9e44ebbb Initial upload
Initial upload.  PRC8 has been added.  Module compiles, PRC's default AI & treasure scripts have been integrated.  Started work on top hak for SLA / Ability / Scripting modifications.
2024-03-11 23:44:08 -04:00

126 lines
2.3 KiB
Plaintext

void main()
{
object oLeaving=GetExitingObject();
if (!GetIsPC(oLeaving))
{
return;
}
object oObject = GetFirstObjectInArea();
int nPCinArea=FALSE;
location lLoc;
int nIdx;
object oGolem;
//location lLoc;
object oItem;
object oTest=GetFirstPC();
while (GetIsObjectValid(oTest) == TRUE)
{
if ((GetArea(oTest) == OBJECT_SELF)&&(!GetIsDM(oTest)))
{
nPCinArea = TRUE;
return;
}
oTest=GetNextPC();
}
/// this returns true if there are any PCs in the area that are NOT
/// the object that just entered the area
if (nPCinArea != TRUE)
{
object oItem;
oObject = GetFirstObjectInArea();
while (GetIsObjectValid(oObject) == TRUE)
{
//if (GetIsEncounterCreature(oObject)&&!GetPlotFlag(oObject))
// {
// DestroyObject(oObject);
// }
// if (GetObjectType(oObject)==OBJECT_TYPE_TRIGGER)
// {
// SetEncounterActive(TRUE,oObject);
// }
if (GetTag(oObject) == "BodyBag")
{
oItem = GetFirstItemInInventory(oObject);
while (GetIsObjectValid(oItem) == TRUE)
{
DestroyObject(oItem);
oItem=GetNextItemInInventory(oObject);
}
SetPlotFlag(oObject,FALSE);
DestroyObject(oObject);
}
if (GetResRef(oObject)=="jw_trap_trigger")
{
SetLocalInt(oObject,"done",0);
SetLocalInt(oObject,"triggered",FALSE);
}
if (GetTag(oObject) == "jw_trap_1_plate"||GetTag(oObject) == "jw_trap_2_plate"||GetTag(oObject) == "jw_trap_3_plate"||GetTag(oObject) == "jw_trap_4_plate"||GetTag(oObject) == "jw_trap_5_plate")
{
SetPlotFlag(oObject,0);
DestroyObject(oObject);
}
oObject=GetNextObjectInArea();
}
nIdx=0;
oObject=GetObjectByTag("jw_neutral_gol",nIdx);
while (GetIsObjectValid(oObject))
{
SetPlotFlag(oObject,FALSE);
DestroyObject(oObject);
nIdx++;
oObject=GetObjectByTag("jw_neutral_gol",nIdx);
}
nIdx=0;
oObject=GetObjectByTag("jw_fake_tres",nIdx);
while (GetIsObjectValid(oObject))
{
SetPlotFlag(oObject,FALSE);
DestroyObject(oObject);
nIdx++;
oObject=GetObjectByTag("jw_fake_tres",nIdx);
}
if (GetIsObjectValid(GetObjectByTag("Kethoth")))
{
DestroyObject(GetObjectByTag("Kethoth"));
}
}
}