Fixed raidboss random instant spawn.
This commit is contained in:
@@ -1124,7 +1124,7 @@ public class Npc extends Creature
|
|||||||
super.onDecay();
|
super.onDecay();
|
||||||
|
|
||||||
// Decrease its spawn counter
|
// Decrease its spawn counter
|
||||||
if (_spawn != null)
|
if ((_spawn != null) && !DBSpawnManager.getInstance().isDefined(getId()))
|
||||||
{
|
{
|
||||||
_spawn.decreaseCount(this);
|
_spawn.decreaseCount(this);
|
||||||
}
|
}
|
||||||
|
@@ -1124,7 +1124,7 @@ public class Npc extends Creature
|
|||||||
super.onDecay();
|
super.onDecay();
|
||||||
|
|
||||||
// Decrease its spawn counter
|
// Decrease its spawn counter
|
||||||
if (_spawn != null)
|
if ((_spawn != null) && !DBSpawnManager.getInstance().isDefined(getId()))
|
||||||
{
|
{
|
||||||
_spawn.decreaseCount(this);
|
_spawn.decreaseCount(this);
|
||||||
}
|
}
|
||||||
|
@@ -1124,7 +1124,7 @@ public class Npc extends Creature
|
|||||||
super.onDecay();
|
super.onDecay();
|
||||||
|
|
||||||
// Decrease its spawn counter
|
// Decrease its spawn counter
|
||||||
if (_spawn != null)
|
if ((_spawn != null) && !DBSpawnManager.getInstance().isDefined(getId()))
|
||||||
{
|
{
|
||||||
_spawn.decreaseCount(this);
|
_spawn.decreaseCount(this);
|
||||||
}
|
}
|
||||||
|
@@ -1124,7 +1124,7 @@ public class Npc extends Creature
|
|||||||
super.onDecay();
|
super.onDecay();
|
||||||
|
|
||||||
// Decrease its spawn counter
|
// Decrease its spawn counter
|
||||||
if (_spawn != null)
|
if ((_spawn != null) && !DBSpawnManager.getInstance().isDefined(getId()))
|
||||||
{
|
{
|
||||||
_spawn.decreaseCount(this);
|
_spawn.decreaseCount(this);
|
||||||
}
|
}
|
||||||
|
@@ -1124,7 +1124,7 @@ public class Npc extends Creature
|
|||||||
super.onDecay();
|
super.onDecay();
|
||||||
|
|
||||||
// Decrease its spawn counter
|
// Decrease its spawn counter
|
||||||
if (_spawn != null)
|
if ((_spawn != null) && !DBSpawnManager.getInstance().isDefined(getId()))
|
||||||
{
|
{
|
||||||
_spawn.decreaseCount(this);
|
_spawn.decreaseCount(this);
|
||||||
}
|
}
|
||||||
|
@@ -1124,7 +1124,7 @@ public class Npc extends Creature
|
|||||||
super.onDecay();
|
super.onDecay();
|
||||||
|
|
||||||
// Decrease its spawn counter
|
// Decrease its spawn counter
|
||||||
if (_spawn != null)
|
if ((_spawn != null) && !DBSpawnManager.getInstance().isDefined(getId()))
|
||||||
{
|
{
|
||||||
_spawn.decreaseCount(this);
|
_spawn.decreaseCount(this);
|
||||||
}
|
}
|
||||||
|
@@ -1124,7 +1124,7 @@ public class Npc extends Creature
|
|||||||
super.onDecay();
|
super.onDecay();
|
||||||
|
|
||||||
// Decrease its spawn counter
|
// Decrease its spawn counter
|
||||||
if (_spawn != null)
|
if ((_spawn != null) && !DBSpawnManager.getInstance().isDefined(getId()))
|
||||||
{
|
{
|
||||||
_spawn.decreaseCount(this);
|
_spawn.decreaseCount(this);
|
||||||
}
|
}
|
||||||
|
@@ -1124,7 +1124,7 @@ public class Npc extends Creature
|
|||||||
super.onDecay();
|
super.onDecay();
|
||||||
|
|
||||||
// Decrease its spawn counter
|
// Decrease its spawn counter
|
||||||
if (_spawn != null)
|
if ((_spawn != null) && !DBSpawnManager.getInstance().isDefined(getId()))
|
||||||
{
|
{
|
||||||
_spawn.decreaseCount(this);
|
_spawn.decreaseCount(this);
|
||||||
}
|
}
|
||||||
|
@@ -185,14 +185,12 @@ public class RaidBossSpawnManager
|
|||||||
|
|
||||||
final int RespawnMinDelay = boss.getSpawn().getRespawnMinDelay();
|
final int RespawnMinDelay = boss.getSpawn().getRespawnMinDelay();
|
||||||
final int RespawnMaxDelay = boss.getSpawn().getRespawnMaxDelay();
|
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 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() + respawn_delay;
|
final long respawnTime = Calendar.getInstance().getTimeInMillis() + respawnDelay;
|
||||||
info.set("currentHP", boss.getMaxHp());
|
info.set("currentHP", boss.getMaxHp());
|
||||||
info.set("currentMP", boss.getMaxMp());
|
info.set("currentMP", boss.getMaxMp());
|
||||||
info.set("respawnTime", respawnTime);
|
info.set("respawnTime", respawnTime);
|
||||||
ScheduledFuture<?> futureSpawn;
|
_schedules.put(boss.getNpcId(), ThreadPool.schedule(new SpawnSchedule(boss.getNpcId()), respawnDelay));
|
||||||
futureSpawn = ThreadPool.schedule(new SpawnSchedule(boss.getNpcId()), respawn_delay);
|
|
||||||
_schedules.put(boss.getNpcId(), futureSpawn);
|
|
||||||
|
|
||||||
// To update immediately the database, used for website to show up RaidBoss status.
|
// To update immediately the database, used for website to show up RaidBoss status.
|
||||||
if (Config.SAVE_RAIDBOSS_STATUS_INTO_DB)
|
if (Config.SAVE_RAIDBOSS_STATUS_INTO_DB)
|
||||||
|
@@ -39,6 +39,7 @@ import org.l2jmobius.gameserver.instancemanager.CustomNpcInstanceManager;
|
|||||||
import org.l2jmobius.gameserver.instancemanager.DimensionalRiftManager;
|
import org.l2jmobius.gameserver.instancemanager.DimensionalRiftManager;
|
||||||
import org.l2jmobius.gameserver.instancemanager.FortManager;
|
import org.l2jmobius.gameserver.instancemanager.FortManager;
|
||||||
import org.l2jmobius.gameserver.instancemanager.QuestManager;
|
import org.l2jmobius.gameserver.instancemanager.QuestManager;
|
||||||
|
import org.l2jmobius.gameserver.instancemanager.RaidBossSpawnManager;
|
||||||
import org.l2jmobius.gameserver.model.DropCategory;
|
import org.l2jmobius.gameserver.model.DropCategory;
|
||||||
import org.l2jmobius.gameserver.model.DropData;
|
import org.l2jmobius.gameserver.model.DropData;
|
||||||
import org.l2jmobius.gameserver.model.Skill;
|
import org.l2jmobius.gameserver.model.Skill;
|
||||||
@@ -2920,7 +2921,7 @@ public class NpcInstance extends Creature
|
|||||||
super.onDecay();
|
super.onDecay();
|
||||||
|
|
||||||
// Decrease its spawn counter
|
// Decrease its spawn counter
|
||||||
if (_spawn != null)
|
if ((_spawn != null) && !RaidBossSpawnManager.getInstance().isDefined(getNpcId()))
|
||||||
{
|
{
|
||||||
_spawn.decreaseCount(this);
|
_spawn.decreaseCount(this);
|
||||||
}
|
}
|
||||||
|
@@ -47,6 +47,7 @@ import org.l2jmobius.gameserver.handler.IBypassHandler;
|
|||||||
import org.l2jmobius.gameserver.instancemanager.CHSiegeManager;
|
import org.l2jmobius.gameserver.instancemanager.CHSiegeManager;
|
||||||
import org.l2jmobius.gameserver.instancemanager.CastleManager;
|
import org.l2jmobius.gameserver.instancemanager.CastleManager;
|
||||||
import org.l2jmobius.gameserver.instancemanager.FortManager;
|
import org.l2jmobius.gameserver.instancemanager.FortManager;
|
||||||
|
import org.l2jmobius.gameserver.instancemanager.RaidBossSpawnManager;
|
||||||
import org.l2jmobius.gameserver.instancemanager.TownManager;
|
import org.l2jmobius.gameserver.instancemanager.TownManager;
|
||||||
import org.l2jmobius.gameserver.instancemanager.WalkingManager;
|
import org.l2jmobius.gameserver.instancemanager.WalkingManager;
|
||||||
import org.l2jmobius.gameserver.instancemanager.ZoneManager;
|
import org.l2jmobius.gameserver.instancemanager.ZoneManager;
|
||||||
@@ -1311,7 +1312,7 @@ public class Npc extends Creature
|
|||||||
super.onDecay();
|
super.onDecay();
|
||||||
|
|
||||||
// Decrease its spawn counter
|
// Decrease its spawn counter
|
||||||
if (_spawn != null)
|
if ((_spawn != null) && !RaidBossSpawnManager.getInstance().isDefined(getId()))
|
||||||
{
|
{
|
||||||
_spawn.decreaseCount(this);
|
_spawn.decreaseCount(this);
|
||||||
}
|
}
|
||||||
|
@@ -47,6 +47,7 @@ import org.l2jmobius.gameserver.handler.IBypassHandler;
|
|||||||
import org.l2jmobius.gameserver.instancemanager.CHSiegeManager;
|
import org.l2jmobius.gameserver.instancemanager.CHSiegeManager;
|
||||||
import org.l2jmobius.gameserver.instancemanager.CastleManager;
|
import org.l2jmobius.gameserver.instancemanager.CastleManager;
|
||||||
import org.l2jmobius.gameserver.instancemanager.FortManager;
|
import org.l2jmobius.gameserver.instancemanager.FortManager;
|
||||||
|
import org.l2jmobius.gameserver.instancemanager.RaidBossSpawnManager;
|
||||||
import org.l2jmobius.gameserver.instancemanager.TownManager;
|
import org.l2jmobius.gameserver.instancemanager.TownManager;
|
||||||
import org.l2jmobius.gameserver.instancemanager.WalkingManager;
|
import org.l2jmobius.gameserver.instancemanager.WalkingManager;
|
||||||
import org.l2jmobius.gameserver.instancemanager.ZoneManager;
|
import org.l2jmobius.gameserver.instancemanager.ZoneManager;
|
||||||
@@ -1311,7 +1312,7 @@ public class Npc extends Creature
|
|||||||
super.onDecay();
|
super.onDecay();
|
||||||
|
|
||||||
// Decrease its spawn counter
|
// Decrease its spawn counter
|
||||||
if (_spawn != null)
|
if ((_spawn != null) && !RaidBossSpawnManager.getInstance().isDefined(getId()))
|
||||||
{
|
{
|
||||||
_spawn.decreaseCount(this);
|
_spawn.decreaseCount(this);
|
||||||
}
|
}
|
||||||
|
@@ -1124,7 +1124,7 @@ public class Npc extends Creature
|
|||||||
super.onDecay();
|
super.onDecay();
|
||||||
|
|
||||||
// Decrease its spawn counter
|
// Decrease its spawn counter
|
||||||
if (_spawn != null)
|
if ((_spawn != null) && !DBSpawnManager.getInstance().isDefined(getId()))
|
||||||
{
|
{
|
||||||
_spawn.decreaseCount(this);
|
_spawn.decreaseCount(this);
|
||||||
}
|
}
|
||||||
|
@@ -1124,7 +1124,7 @@ public class Npc extends Creature
|
|||||||
super.onDecay();
|
super.onDecay();
|
||||||
|
|
||||||
// Decrease its spawn counter
|
// Decrease its spawn counter
|
||||||
if (_spawn != null)
|
if ((_spawn != null) && !DBSpawnManager.getInstance().isDefined(getId()))
|
||||||
{
|
{
|
||||||
_spawn.decreaseCount(this);
|
_spawn.decreaseCount(this);
|
||||||
}
|
}
|
||||||
|
@@ -1124,7 +1124,7 @@ public class Npc extends Creature
|
|||||||
super.onDecay();
|
super.onDecay();
|
||||||
|
|
||||||
// Decrease its spawn counter
|
// Decrease its spawn counter
|
||||||
if (_spawn != null)
|
if ((_spawn != null) && !DBSpawnManager.getInstance().isDefined(getId()))
|
||||||
{
|
{
|
||||||
_spawn.decreaseCount(this);
|
_spawn.decreaseCount(this);
|
||||||
}
|
}
|
||||||
|
@@ -1136,7 +1136,7 @@ public class Npc extends Creature
|
|||||||
super.onDecay();
|
super.onDecay();
|
||||||
|
|
||||||
// Decrease its spawn counter
|
// Decrease its spawn counter
|
||||||
if (_spawn != null)
|
if ((_spawn != null) && !DBSpawnManager.getInstance().isDefined(getId()))
|
||||||
{
|
{
|
||||||
_spawn.decreaseCount(this);
|
_spawn.decreaseCount(this);
|
||||||
}
|
}
|
||||||
|
@@ -1136,7 +1136,7 @@ public class Npc extends Creature
|
|||||||
super.onDecay();
|
super.onDecay();
|
||||||
|
|
||||||
// Decrease its spawn counter
|
// Decrease its spawn counter
|
||||||
if (_spawn != null)
|
if ((_spawn != null) && !DBSpawnManager.getInstance().isDefined(getId()))
|
||||||
{
|
{
|
||||||
_spawn.decreaseCount(this);
|
_spawn.decreaseCount(this);
|
||||||
}
|
}
|
||||||
|
@@ -1136,7 +1136,7 @@ public class Npc extends Creature
|
|||||||
super.onDecay();
|
super.onDecay();
|
||||||
|
|
||||||
// Decrease its spawn counter
|
// Decrease its spawn counter
|
||||||
if (_spawn != null)
|
if ((_spawn != null) && !DBSpawnManager.getInstance().isDefined(getId()))
|
||||||
{
|
{
|
||||||
_spawn.decreaseCount(this);
|
_spawn.decreaseCount(this);
|
||||||
}
|
}
|
||||||
|
@@ -1124,7 +1124,7 @@ public class Npc extends Creature
|
|||||||
super.onDecay();
|
super.onDecay();
|
||||||
|
|
||||||
// Decrease its spawn counter
|
// Decrease its spawn counter
|
||||||
if (_spawn != null)
|
if ((_spawn != null) && !DBSpawnManager.getInstance().isDefined(getId()))
|
||||||
{
|
{
|
||||||
_spawn.decreaseCount(this);
|
_spawn.decreaseCount(this);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user