mirror of
http://prc.nwn.ee:3000/Jaysyn/PRC8.git
synced 2025-12-17 02:57:15 -05:00
Further file organization
Further file organization
This commit is contained in:
39
nwn/nwnprc/trunk/scripts/mord_exit.nss
Normal file
39
nwn/nwnprc/trunk/scripts/mord_exit.nss
Normal file
@@ -0,0 +1,39 @@
|
||||
void main()
|
||||
{
|
||||
PrintString("mord_exit entering");
|
||||
|
||||
// Get the person walking through the door and their area, i.e.
|
||||
// the mansion.
|
||||
object oActivator = GetLastUsedBy();
|
||||
object aActivator = GetArea(oActivator);
|
||||
|
||||
// Get the saved return location for the activator, we want to boot all
|
||||
// players who have this location saved on them. This will solve the
|
||||
// problem of 2 parties getting mixed somehow, only the party that clicks
|
||||
// on the door actually gets booted.
|
||||
location lActivatorReturnLoc = GetLocalLocation(oActivator, "MMM_RETURNLOC");
|
||||
|
||||
// Loop through all the players and check to see if they are in
|
||||
// the mansion and dump them out if they are.
|
||||
object oPC = GetFirstPC();
|
||||
while (GetIsObjectValid(oPC))
|
||||
{
|
||||
// If the PC's are in the same area and have the same return location
|
||||
// on them then boot the current PC.
|
||||
if (aActivator == GetArea (oPC) &&
|
||||
lActivatorReturnLoc == GetLocalLocation(oPC, "MMM_RETURNLOC"))
|
||||
{
|
||||
// Get the return location we saved on the PC and send them there.
|
||||
DeleteLocalLocation(oPC, "MMM_RETURNLOC");
|
||||
AssignCommand(oPC, DelayCommand(1.0,
|
||||
ActionJumpToLocation(lActivatorReturnLoc)));
|
||||
}
|
||||
|
||||
oPC = GetNextPC();
|
||||
}
|
||||
|
||||
// Now that all are moved, destroy the mansion door.
|
||||
object oGate = GetLocalObject(OBJECT_SELF, "MMM_ENTRANCE");
|
||||
DeleteLocalObject(OBJECT_SELF, "MMM_ENTRANCE");
|
||||
if (GetIsObjectValid(oGate)) DestroyObject(oGate, 1.0);
|
||||
}
|
||||
Reference in New Issue
Block a user