EN4_PRC8/_module/nss/rd_houseexit.nss
Jaysyn904 b464d8da05 Initial Commit
Initial Commit [v1.32PRC8]
2025-04-03 13:38:45 -04:00

39 lines
893 B
Plaintext

void main()
{
object oPC;
object oSpawnPoint;
object oArea;
object oMob;
int iHouse;
oPC = GetEnteringObject();
oSpawnPoint = GetObjectByTag(GetLocalString(oPC,"EN4Return"));
if (!GetIsObjectValid(oSpawnPoint))
oSpawnPoint=GetObjectByTag("EN4_Respawn");
AssignCommand(oPC,JumpToLocation(GetLocation(oSpawnPoint)));
iHouse=GetLocalInt(oPC,"EN4House");
if (iHouse == 1)
SetLocalInt(GetModule(),"House1InUse",0);
if (iHouse == 2)
SetLocalInt(GetModule(),"House2InUse",0);
if (iHouse == 3)
SetLocalInt(GetModule(),"House3InUse",0);
SetLocalInt(oPC,"EN4House",0);
oArea=GetArea(oPC);
oMob = GetFirstObjectInArea(oArea);
while (GetIsObjectValid(oMob))
{
if (GetObjectType(oMob) == OBJECT_TYPE_CREATURE && !GetIsPC(oMob) && !GetIsPC(GetMaster(oMob)))
{
AssignCommand(oMob,ClearAllActions(TRUE));
}
oMob = GetNextObjectInArea(oArea);
}
}