84 lines
1.6 KiB
Plaintext
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();
|
||
|
}
|
||
|
|
||
|
|
||
|
}
|
||
|
|
||
|
}
|
||
|
}
|