Aschbourne_PRC8/_module/nss/_map_chst_spawn.nss
GetOffMyYarn 69879d6957 Areas and Fixes
Added CCOH and missing areas
Changed some areas to be craftable,
Fixed some on death issues,
Fixed the Gaurd
2024-08-30 11:38:44 -04:00

32 lines
846 B
Plaintext

void main()
{
object oSelf=OBJECT_SELF;
ApplyEffectAtLocation(DURATION_TYPE_INSTANT,EffectVisualEffect(VFX_FNF_SUMMON_UNDEAD,FALSE),GetLocation(oSelf));
int iMapLevel = GetLocalInt(oSelf,"iChestLevel");
object oPC = GetLocalObject(oSelf,"oDiggingPC");
//Avoid PC logout exploit.. to log out to avoid spawn.. *NOT ALLOWED*
if (GetIsObjectValid(oPC)==FALSE)
{
ExecuteScript("onclose_clear",oSelf);
return;
}
int iMonsterMaxCount = (d4(10)/2)+iMapLevel;
int iSpawnNow = d4(1)+2;
iMonsterMaxCount = iMonsterMaxCount-iSpawnNow;
SetLocalInt(oSelf,"iMaxMonster",iMonsterMaxCount);//Max number of monsters remaining for chest
float fDelay=1.0;
for (iSpawnNow; iSpawnNow>0; iSpawnNow--)
{
fDelay=fDelay+0.1;
AssignCommand(oSelf,DelayCommand(fDelay,ExecuteScript("_map_chst_spawn2",oSelf)));
}
}