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

43 lines
969 B
Plaintext

#include "rd_spawnzones"
//#include "rd_questinc"
void main()
{
object oPC;
location lLoc;
int iEvil;
int iGoodEvil;
oPC = GetEnteringObject();
if (GetIsPC(oPC))
{
if (GetLocalInt(OBJECT_SELF,"EvilSpawn")==0)
{
SetLocalInt(OBJECT_SELF,"EvilSpawn",1);
iEvil = FALSE;
iGoodEvil = GetGoodEvilValue(oPC);
if (iGoodEvil > 40 && iGoodEvil < 60)
if (Random(3)==0)
iEvil = TRUE;
if (iGoodEvil < 40)
iEvil = TRUE;
if (iEvil==TRUE)
{
lLoc = GetLocation(GetObjectByTag("OC_Evil"));
CreateObject(OBJECT_TYPE_CREATURE,"en3_dmessenger",lLoc);
}
}
if (GetLocalInt(OBJECT_SELF,"Spawned") == 0)
{
RespawnCampsAE(GetEnteringObject());
RespawnMobsAE(GetEnteringObject());
SetLocalInt(OBJECT_SELF,"Spawned",1);
SetLocalInt(OBJECT_SELF,"RandomEncounter",1);
}
}
}