Fixed raidboss random instant spawn.

This commit is contained in:
MobiusDevelopment
2020-05-28 23:34:14 +00:00
parent de8acc68bd
commit 5de5ecdaae
19 changed files with 24 additions and 23 deletions

View File

@@ -1124,7 +1124,7 @@ public class Npc extends Creature
super.onDecay();
// Decrease its spawn counter
if (_spawn != null)
if ((_spawn != null) && !DBSpawnManager.getInstance().isDefined(getId()))
{
_spawn.decreaseCount(this);
}

View File

@@ -1124,7 +1124,7 @@ public class Npc extends Creature
super.onDecay();
// Decrease its spawn counter
if (_spawn != null)
if ((_spawn != null) && !DBSpawnManager.getInstance().isDefined(getId()))
{
_spawn.decreaseCount(this);
}

View File

@@ -1124,7 +1124,7 @@ public class Npc extends Creature
super.onDecay();
// Decrease its spawn counter
if (_spawn != null)
if ((_spawn != null) && !DBSpawnManager.getInstance().isDefined(getId()))
{
_spawn.decreaseCount(this);
}

View File

@@ -1124,7 +1124,7 @@ public class Npc extends Creature
super.onDecay();
// Decrease its spawn counter
if (_spawn != null)
if ((_spawn != null) && !DBSpawnManager.getInstance().isDefined(getId()))
{
_spawn.decreaseCount(this);
}

View File

@@ -1124,7 +1124,7 @@ public class Npc extends Creature
super.onDecay();
// Decrease its spawn counter
if (_spawn != null)
if ((_spawn != null) && !DBSpawnManager.getInstance().isDefined(getId()))
{
_spawn.decreaseCount(this);
}

View File

@@ -1124,7 +1124,7 @@ public class Npc extends Creature
super.onDecay();
// Decrease its spawn counter
if (_spawn != null)
if ((_spawn != null) && !DBSpawnManager.getInstance().isDefined(getId()))
{
_spawn.decreaseCount(this);
}

View File

@@ -1124,7 +1124,7 @@ public class Npc extends Creature
super.onDecay();
// Decrease its spawn counter
if (_spawn != null)
if ((_spawn != null) && !DBSpawnManager.getInstance().isDefined(getId()))
{
_spawn.decreaseCount(this);
}

View File

@@ -1124,7 +1124,7 @@ public class Npc extends Creature
super.onDecay();
// Decrease its spawn counter
if (_spawn != null)
if ((_spawn != null) && !DBSpawnManager.getInstance().isDefined(getId()))
{
_spawn.decreaseCount(this);
}

View File

@@ -185,14 +185,12 @@ public class RaidBossSpawnManager
final int RespawnMinDelay = boss.getSpawn().getRespawnMinDelay();
final int RespawnMaxDelay = boss.getSpawn().getRespawnMaxDelay();
final long respawn_delay = Rnd.get((int) (RespawnMinDelay * 1000 * Config.RAID_MIN_RESPAWN_MULTIPLIER), (int) (RespawnMaxDelay * 1000 * Config.RAID_MAX_RESPAWN_MULTIPLIER));
final long respawnTime = Calendar.getInstance().getTimeInMillis() + respawn_delay;
final long respawnDelay = Rnd.get((int) (RespawnMinDelay * 1000 * Config.RAID_MIN_RESPAWN_MULTIPLIER), (int) (RespawnMaxDelay * 1000 * Config.RAID_MAX_RESPAWN_MULTIPLIER));
final long respawnTime = Calendar.getInstance().getTimeInMillis() + respawnDelay;
info.set("currentHP", boss.getMaxHp());
info.set("currentMP", boss.getMaxMp());
info.set("respawnTime", respawnTime);
ScheduledFuture<?> futureSpawn;
futureSpawn = ThreadPool.schedule(new SpawnSchedule(boss.getNpcId()), respawn_delay);
_schedules.put(boss.getNpcId(), futureSpawn);
_schedules.put(boss.getNpcId(), ThreadPool.schedule(new SpawnSchedule(boss.getNpcId()), respawnDelay));
// To update immediately the database, used for website to show up RaidBoss status.
if (Config.SAVE_RAIDBOSS_STATUS_INTO_DB)

View File

@@ -39,6 +39,7 @@ import org.l2jmobius.gameserver.instancemanager.CustomNpcInstanceManager;
import org.l2jmobius.gameserver.instancemanager.DimensionalRiftManager;
import org.l2jmobius.gameserver.instancemanager.FortManager;
import org.l2jmobius.gameserver.instancemanager.QuestManager;
import org.l2jmobius.gameserver.instancemanager.RaidBossSpawnManager;
import org.l2jmobius.gameserver.model.DropCategory;
import org.l2jmobius.gameserver.model.DropData;
import org.l2jmobius.gameserver.model.Skill;
@@ -2920,7 +2921,7 @@ public class NpcInstance extends Creature
super.onDecay();
// Decrease its spawn counter
if (_spawn != null)
if ((_spawn != null) && !RaidBossSpawnManager.getInstance().isDefined(getNpcId()))
{
_spawn.decreaseCount(this);
}

View File

@@ -47,6 +47,7 @@ import org.l2jmobius.gameserver.handler.IBypassHandler;
import org.l2jmobius.gameserver.instancemanager.CHSiegeManager;
import org.l2jmobius.gameserver.instancemanager.CastleManager;
import org.l2jmobius.gameserver.instancemanager.FortManager;
import org.l2jmobius.gameserver.instancemanager.RaidBossSpawnManager;
import org.l2jmobius.gameserver.instancemanager.TownManager;
import org.l2jmobius.gameserver.instancemanager.WalkingManager;
import org.l2jmobius.gameserver.instancemanager.ZoneManager;
@@ -1311,7 +1312,7 @@ public class Npc extends Creature
super.onDecay();
// Decrease its spawn counter
if (_spawn != null)
if ((_spawn != null) && !RaidBossSpawnManager.getInstance().isDefined(getId()))
{
_spawn.decreaseCount(this);
}

View File

@@ -47,6 +47,7 @@ import org.l2jmobius.gameserver.handler.IBypassHandler;
import org.l2jmobius.gameserver.instancemanager.CHSiegeManager;
import org.l2jmobius.gameserver.instancemanager.CastleManager;
import org.l2jmobius.gameserver.instancemanager.FortManager;
import org.l2jmobius.gameserver.instancemanager.RaidBossSpawnManager;
import org.l2jmobius.gameserver.instancemanager.TownManager;
import org.l2jmobius.gameserver.instancemanager.WalkingManager;
import org.l2jmobius.gameserver.instancemanager.ZoneManager;
@@ -1311,7 +1312,7 @@ public class Npc extends Creature
super.onDecay();
// Decrease its spawn counter
if (_spawn != null)
if ((_spawn != null) && !RaidBossSpawnManager.getInstance().isDefined(getId()))
{
_spawn.decreaseCount(this);
}

View File

@@ -1124,7 +1124,7 @@ public class Npc extends Creature
super.onDecay();
// Decrease its spawn counter
if (_spawn != null)
if ((_spawn != null) && !DBSpawnManager.getInstance().isDefined(getId()))
{
_spawn.decreaseCount(this);
}

View File

@@ -1124,7 +1124,7 @@ public class Npc extends Creature
super.onDecay();
// Decrease its spawn counter
if (_spawn != null)
if ((_spawn != null) && !DBSpawnManager.getInstance().isDefined(getId()))
{
_spawn.decreaseCount(this);
}

View File

@@ -1124,7 +1124,7 @@ public class Npc extends Creature
super.onDecay();
// Decrease its spawn counter
if (_spawn != null)
if ((_spawn != null) && !DBSpawnManager.getInstance().isDefined(getId()))
{
_spawn.decreaseCount(this);
}

View File

@@ -1136,7 +1136,7 @@ public class Npc extends Creature
super.onDecay();
// Decrease its spawn counter
if (_spawn != null)
if ((_spawn != null) && !DBSpawnManager.getInstance().isDefined(getId()))
{
_spawn.decreaseCount(this);
}

View File

@@ -1136,7 +1136,7 @@ public class Npc extends Creature
super.onDecay();
// Decrease its spawn counter
if (_spawn != null)
if ((_spawn != null) && !DBSpawnManager.getInstance().isDefined(getId()))
{
_spawn.decreaseCount(this);
}

View File

@@ -1136,7 +1136,7 @@ public class Npc extends Creature
super.onDecay();
// Decrease its spawn counter
if (_spawn != null)
if ((_spawn != null) && !DBSpawnManager.getInstance().isDefined(getId()))
{
_spawn.decreaseCount(this);
}

View File

@@ -1124,7 +1124,7 @@ public class Npc extends Creature
super.onDecay();
// Decrease its spawn counter
if (_spawn != null)
if ((_spawn != null) && !DBSpawnManager.getInstance().isDefined(getId()))
{
_spawn.decreaseCount(this);
}