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:
101
_module/nss/tri_device_exit.nss
Normal file
101
_module/nss/tri_device_exit.nss
Normal file
@@ -0,0 +1,101 @@
|
||||
void main()
|
||||
{
|
||||
|
||||
|
||||
|
||||
{
|
||||
object oObject = GetFirstObjectInArea();
|
||||
int nPCinArea=FALSE;
|
||||
location lLoc;
|
||||
object oItem;
|
||||
|
||||
|
||||
// first of all, check every object in the area and see if it is a PC.
|
||||
|
||||
while (GetIsObjectValid(oObject))
|
||||
{
|
||||
if (GetIsPC(oObject))
|
||||
{
|
||||
nPCinArea = TRUE;
|
||||
}
|
||||
oObject=GetNextObjectInArea();
|
||||
}
|
||||
|
||||
|
||||
// if not, then run the next bit of the script
|
||||
|
||||
if (nPCinArea != TRUE)
|
||||
{
|
||||
// create the device if it's destroyed
|
||||
if (!GetIsObjectValid(GetObjectByTag("tri_device")))
|
||||
|
||||
{
|
||||
lLoc=GetLocation(GetObjectByTag("WP_tri_device"));
|
||||
CreateObject(OBJECT_TYPE_PLACEABLE,"tri_device",lLoc);
|
||||
}
|
||||
if (!GetIsObjectValid(GetObjectByTag("tri_magicspa")))
|
||||
|
||||
{
|
||||
lLoc=GetLocation(GetObjectByTag("WP_tri_magicspa"));
|
||||
CreateObject(OBJECT_TYPE_PLACEABLE,"tri_magicspa",lLoc);
|
||||
}
|
||||
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (GetResRef(oObject)=="secretitemtrigge"||GetResRef(oObject)=="secretitemtri001"||GetResRef(oObject)=="jw_secret_dr_tri")
|
||||
{
|
||||
SetLocalInt(oObject,"triggered",FALSE);
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (GetResRef(oObject)=="jw_mobstransf_tr")
|
||||
{
|
||||
SignalEvent(oObject,EventUserDefined(50));
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (GetLocalInt(oObject,"jw_hidden_int")==TRUE)
|
||||
{
|
||||
SetPlotFlag(oObject,0);
|
||||
DestroyObject(oObject);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user