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.
This commit is contained in:
125
_module/nss/jw_dungeon_exit.nss
Normal file
125
_module/nss/jw_dungeon_exit.nss
Normal file
@@ -0,0 +1,125 @@
|
||||
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"));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user