Battledale_PRC8/_module/nss/nk_fp_mrealmexit.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

84 lines
1.6 KiB
Plaintext

void main()
{
{
object oObject = GetFirstObjectInArea();
int nPCinArea=FALSE;
location lLoc;
object oItem;
object oPC = GetExitingObject();
//get rid of all keys
if (GetIsPC(oPC))
{
object oKey = GetFirstItemInInventory(oPC);
while (oKey != OBJECT_INVALID)
{
if ((GetTag(oKey) == "nk_fp_keybronze") || (GetTag(oKey) == "nk_fp_keysilver") || (GetTag(oKey) == "nk_fp_keygold"))
{
DestroyObject(oKey);
SendMessageToPC(oPC, "Upon leaving the area, the " + GetName(oKey) + " crumbles to dust.");
}
oKey = GetNextItemInInventory(oPC);
}
}
// 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)
{
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") || (GetTag(oObject) == "nk_fp_balor"))
{
oItem = GetFirstItemInInventory(oObject);
while (GetIsObjectValid(oItem) == TRUE)
{
DestroyObject(oItem);
oItem=GetNextItemInInventory(oObject);
}
SetPlotFlag(oObject,FALSE);
DestroyObject(oObject);
}
oObject=GetNextObjectInArea();
}
}
}
}