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

45 lines
1.0 KiB
Plaintext

//#include "rd_spawnzones"
#include "rd_questinc"
void main()
{
int iLevel;
string sTag;
location lLoc;
object oGuard;
object oPC;
int iMinLevel;
int iMaxLevel;
int iTreasure;
object oChest;
oPC = GetEnteringObject();
if (GetIsPC(oPC))
{
if (GetLocalInt(OBJECT_SELF,"EN4_SetupZone") == 0 && GetLocalInt(OBJECT_SELF,"AdventureZone") > 0)
SetupZone(oPC);
CheckZone(oPC);
if (GetLocalInt(OBJECT_SELF,"Spawned") == 0)
{
iLevel = GetHitDice(oPC);
iLevel = ZoneLevel(OBJECT_SELF,iLevel);
RespawnCampsAE(GetEnteringObject(),0, iLevel+2, GetLocalInt(OBJECT_SELF,"SpecialSpawn"));
RespawnMobsAE(GetEnteringObject(),0, iLevel+2);
SetTrapsAndDoors(GetEnteringObject());
SetLocalInt(OBJECT_SELF,"Spawned",1);
SetLocalInt(OBJECT_SELF,"RandomEncounter",1);
iTreasure = Random(5)+1;
sTag = "GD1_C" + IntToString(iTreasure) + "_Treasure";
oChest = GetObjectByTag(sTag);
SetLocalInt(oChest,"GDSpecialTreasure",1);
}
}
}