Module commit
Module commit.
This commit is contained in:
31
_module/nss/_map_chst_spawn.nss
Normal file
31
_module/nss/_map_chst_spawn.nss
Normal file
@@ -0,0 +1,31 @@
|
||||
|
||||
|
||||
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)));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user