Aschbourne_PRC8/_module/nss/_map_chst_spawn.nss
Jaysyn904 f5ffe7d0b9 Module commit
Module commit.
2024-06-14 10:48:20 -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)));
}
}