Addition of RaidBossStatus enum.
This commit is contained in:
@@ -19,8 +19,8 @@ package quests.Q604_DaimonTheWhiteEyed_Part2;
|
||||
import java.util.logging.Level;
|
||||
|
||||
import org.l2jmobius.commons.util.Rnd;
|
||||
import org.l2jmobius.gameserver.enums.RaidBossStatus;
|
||||
import org.l2jmobius.gameserver.instancemanager.RaidBossSpawnManager;
|
||||
import org.l2jmobius.gameserver.instancemanager.RaidBossSpawnManager.StatusEnum;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.NpcInstance;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.RaidBossInstance;
|
||||
@@ -91,7 +91,7 @@ public class Q604_DaimonTheWhiteEyed_Part2 extends Quest
|
||||
if (event.equals("check"))
|
||||
{
|
||||
RaidBossInstance raid = RaidBossSpawnManager.getInstance().getBosses().get(DAIMON_THE_WHITE_EYED);
|
||||
if ((raid != null) && (raid.getRaidStatus() == StatusEnum.ALIVE))
|
||||
if ((raid != null) && (raid.getRaidStatus() == RaidBossStatus.ALIVE))
|
||||
{
|
||||
if ((_status >= 0) && (_status-- == 0))
|
||||
{
|
||||
@@ -277,7 +277,7 @@ public class Q604_DaimonTheWhiteEyed_Part2 extends Quest
|
||||
private boolean spawnRaid()
|
||||
{
|
||||
RaidBossInstance raid = RaidBossSpawnManager.getInstance().getBosses().get(DAIMON_THE_WHITE_EYED);
|
||||
if ((raid != null) && (raid.getRaidStatus() == StatusEnum.ALIVE))
|
||||
if ((raid != null) && (raid.getRaidStatus() == RaidBossStatus.ALIVE))
|
||||
{
|
||||
// set temporarily spawn location (to provide correct behavior of RaidBossInstance.checkAndReturnToSpawn())
|
||||
raid.getSpawn().setLoc(185900, -44000, -3160, Rnd.get(65536));
|
||||
|
||||
@@ -19,8 +19,8 @@ package quests.Q610_MagicalPowerOfWater_Part2;
|
||||
import java.util.logging.Level;
|
||||
|
||||
import org.l2jmobius.commons.util.Rnd;
|
||||
import org.l2jmobius.gameserver.enums.RaidBossStatus;
|
||||
import org.l2jmobius.gameserver.instancemanager.RaidBossSpawnManager;
|
||||
import org.l2jmobius.gameserver.instancemanager.RaidBossSpawnManager.StatusEnum;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.NpcInstance;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.RaidBossInstance;
|
||||
@@ -81,7 +81,7 @@ public class Q610_MagicalPowerOfWater_Part2 extends Quest
|
||||
if (event.equals("check"))
|
||||
{
|
||||
RaidBossInstance raid = RaidBossSpawnManager.getInstance().getBosses().get(SOUL_OF_WATER_ASHUTAR);
|
||||
if ((raid != null) && (raid.getRaidStatus() == StatusEnum.ALIVE))
|
||||
if ((raid != null) && (raid.getRaidStatus() == RaidBossStatus.ALIVE))
|
||||
{
|
||||
if ((_status >= 0) && (_status-- == 0))
|
||||
{
|
||||
@@ -257,7 +257,7 @@ public class Q610_MagicalPowerOfWater_Part2 extends Quest
|
||||
private boolean spawnRaid()
|
||||
{
|
||||
RaidBossInstance raid = RaidBossSpawnManager.getInstance().getBosses().get(SOUL_OF_WATER_ASHUTAR);
|
||||
if ((raid != null) && (raid.getRaidStatus() == StatusEnum.ALIVE))
|
||||
if ((raid != null) && (raid.getRaidStatus() == RaidBossStatus.ALIVE))
|
||||
{
|
||||
// set temporarily spawn location (to provide correct behavior of RaidBossInstance.checkAndReturnToSpawn())
|
||||
raid.getSpawn().setLoc(104771, -36993, -1149, Rnd.get(65536));
|
||||
|
||||
@@ -19,8 +19,8 @@ package quests.Q616_MagicalPowerOfFire_Part2;
|
||||
import java.util.logging.Level;
|
||||
|
||||
import org.l2jmobius.commons.util.Rnd;
|
||||
import org.l2jmobius.gameserver.enums.RaidBossStatus;
|
||||
import org.l2jmobius.gameserver.instancemanager.RaidBossSpawnManager;
|
||||
import org.l2jmobius.gameserver.instancemanager.RaidBossSpawnManager.StatusEnum;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.NpcInstance;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.RaidBossInstance;
|
||||
@@ -81,7 +81,7 @@ public class Q616_MagicalPowerOfFire_Part2 extends Quest
|
||||
if (event.equals("check"))
|
||||
{
|
||||
RaidBossInstance raid = RaidBossSpawnManager.getInstance().getBosses().get(SOUL_OF_FIRE_NASTRON);
|
||||
if ((raid != null) && (raid.getRaidStatus() == StatusEnum.ALIVE))
|
||||
if ((raid != null) && (raid.getRaidStatus() == RaidBossStatus.ALIVE))
|
||||
{
|
||||
if ((_status >= 0) && (_status-- == 0))
|
||||
{
|
||||
@@ -268,7 +268,7 @@ public class Q616_MagicalPowerOfFire_Part2 extends Quest
|
||||
private boolean spawnRaid()
|
||||
{
|
||||
RaidBossInstance raid = RaidBossSpawnManager.getInstance().getBosses().get(SOUL_OF_FIRE_NASTRON);
|
||||
if ((raid != null) && (raid.getRaidStatus() == StatusEnum.ALIVE))
|
||||
if ((raid != null) && (raid.getRaidStatus() == RaidBossStatus.ALIVE))
|
||||
{
|
||||
// set temporarily spawn location (to provide correct behavior of RaidBossInstance.checkAndReturnToSpawn())
|
||||
raid.getSpawn().setLoc(142624, -82285, -6491, Rnd.get(65536));
|
||||
|
||||
@@ -19,8 +19,8 @@ package quests.Q625_TheFinestIngredients_Part2;
|
||||
import java.util.logging.Level;
|
||||
|
||||
import org.l2jmobius.commons.util.Rnd;
|
||||
import org.l2jmobius.gameserver.enums.RaidBossStatus;
|
||||
import org.l2jmobius.gameserver.instancemanager.RaidBossSpawnManager;
|
||||
import org.l2jmobius.gameserver.instancemanager.RaidBossSpawnManager.StatusEnum;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.NpcInstance;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.RaidBossInstance;
|
||||
@@ -91,7 +91,7 @@ public class Q625_TheFinestIngredients_Part2 extends Quest
|
||||
if (event.equals("check"))
|
||||
{
|
||||
RaidBossInstance raid = RaidBossSpawnManager.getInstance().getBosses().get(ICICLE_EMPEROR_BUMBALUMP);
|
||||
if ((raid != null) && (raid.getRaidStatus() == StatusEnum.ALIVE))
|
||||
if ((raid != null) && (raid.getRaidStatus() == RaidBossStatus.ALIVE))
|
||||
{
|
||||
if ((_status >= 0) && (_status-- == 0))
|
||||
{
|
||||
@@ -271,7 +271,7 @@ public class Q625_TheFinestIngredients_Part2 extends Quest
|
||||
private boolean spawnRaid()
|
||||
{
|
||||
RaidBossInstance raid = RaidBossSpawnManager.getInstance().getBosses().get(ICICLE_EMPEROR_BUMBALUMP);
|
||||
if ((raid != null) && (raid.getRaidStatus() == StatusEnum.ALIVE))
|
||||
if ((raid != null) && (raid.getRaidStatus() == RaidBossStatus.ALIVE))
|
||||
{
|
||||
// set temporarily spawn location (to provide correct behavior of RaidBossInstance.checkAndReturnToSpawn())
|
||||
raid.getSpawn().setLoc(157117, -121939, -2397, Rnd.get(65536));
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
/*
|
||||
* This file is part of the L2J Mobius project.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package org.l2jmobius.gameserver.enums;
|
||||
|
||||
/**
|
||||
* @author Mobius
|
||||
*/
|
||||
public enum RaidBossStatus
|
||||
{
|
||||
ALIVE,
|
||||
DEAD,
|
||||
UNDEFINED
|
||||
}
|
||||
@@ -25,6 +25,7 @@ import java.util.logging.Logger;
|
||||
|
||||
import org.l2jmobius.gameserver.GameTimeController;
|
||||
import org.l2jmobius.gameserver.datatables.SkillTable;
|
||||
import org.l2jmobius.gameserver.enums.RaidBossStatus;
|
||||
import org.l2jmobius.gameserver.model.Skill;
|
||||
import org.l2jmobius.gameserver.model.World;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.NpcInstance;
|
||||
@@ -227,7 +228,7 @@ public class DayNightSpawnManager
|
||||
continue;
|
||||
}
|
||||
|
||||
if ((boss != null) && (boss.getNpcId() == 25328) && boss.getRaidStatus().equals(RaidBossSpawnManager.StatusEnum.ALIVE))
|
||||
if ((boss != null) && (boss.getNpcId() == 25328) && boss.getRaidStatus().equals(RaidBossStatus.ALIVE))
|
||||
{
|
||||
handleHellmans(boss, mode);
|
||||
}
|
||||
|
||||
@@ -34,6 +34,7 @@ import org.l2jmobius.commons.util.Rnd;
|
||||
import org.l2jmobius.gameserver.datatables.GmListTable;
|
||||
import org.l2jmobius.gameserver.datatables.sql.NpcTable;
|
||||
import org.l2jmobius.gameserver.datatables.sql.SpawnTable;
|
||||
import org.l2jmobius.gameserver.enums.RaidBossStatus;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.RaidBossInstance;
|
||||
import org.l2jmobius.gameserver.model.entity.Announcements;
|
||||
import org.l2jmobius.gameserver.model.spawn.Spawn;
|
||||
@@ -54,13 +55,6 @@ public class RaidBossSpawnManager
|
||||
protected static final Map<Integer, StatsSet> _storedInfo = new ConcurrentHashMap<>();
|
||||
protected static final Map<Integer, ScheduledFuture<?>> _schedules = new ConcurrentHashMap<>();
|
||||
|
||||
public enum StatusEnum
|
||||
{
|
||||
ALIVE,
|
||||
DEAD,
|
||||
UNDEFINED
|
||||
}
|
||||
|
||||
/**
|
||||
* Instantiates a new raid boss spawn manager.
|
||||
*/
|
||||
@@ -147,7 +141,7 @@ public class RaidBossSpawnManager
|
||||
|
||||
if (raidboss != null)
|
||||
{
|
||||
raidboss.setRaidStatus(StatusEnum.ALIVE);
|
||||
raidboss.setRaidStatus(RaidBossStatus.ALIVE);
|
||||
|
||||
final StatsSet info = new StatsSet();
|
||||
info.set("currentHP", raidboss.getCurrentHp());
|
||||
@@ -189,7 +183,7 @@ public class RaidBossSpawnManager
|
||||
|
||||
if (isBossDead)
|
||||
{
|
||||
boss.setRaidStatus(StatusEnum.DEAD);
|
||||
boss.setRaidStatus(RaidBossStatus.DEAD);
|
||||
|
||||
final int RespawnMinDelay = boss.getSpawn().getRespawnMinDelay();
|
||||
final int RespawnMaxDelay = boss.getSpawn().getRespawnMaxDelay();
|
||||
@@ -213,7 +207,7 @@ public class RaidBossSpawnManager
|
||||
}
|
||||
else
|
||||
{
|
||||
boss.setRaidStatus(StatusEnum.ALIVE);
|
||||
boss.setRaidStatus(RaidBossStatus.ALIVE);
|
||||
|
||||
info.set("currentHP", boss.getCurrentHp());
|
||||
info.set("currentMP", boss.getCurrentMp());
|
||||
@@ -257,7 +251,7 @@ public class RaidBossSpawnManager
|
||||
|
||||
raidboss.setCurrentHp(currentHP);
|
||||
raidboss.setCurrentMp(currentMP);
|
||||
raidboss.setRaidStatus(StatusEnum.ALIVE);
|
||||
raidboss.setRaidStatus(RaidBossStatus.ALIVE);
|
||||
|
||||
_bosses.put(bossId, raidboss);
|
||||
|
||||
@@ -379,7 +373,7 @@ public class RaidBossSpawnManager
|
||||
continue;
|
||||
}
|
||||
|
||||
if (boss.getRaidStatus().equals(StatusEnum.ALIVE))
|
||||
if (boss.getRaidStatus().equals(RaidBossStatus.ALIVE))
|
||||
{
|
||||
updateStatus(boss, false);
|
||||
}
|
||||
@@ -468,7 +462,7 @@ public class RaidBossSpawnManager
|
||||
* @param bossId the boss id
|
||||
* @return the raid boss status id
|
||||
*/
|
||||
public StatusEnum getRaidBossStatusId(int bossId)
|
||||
public RaidBossStatus getRaidBossStatusId(int bossId)
|
||||
{
|
||||
if (_bosses.containsKey(bossId))
|
||||
{
|
||||
@@ -476,11 +470,11 @@ public class RaidBossSpawnManager
|
||||
}
|
||||
else if (_schedules.containsKey(bossId))
|
||||
{
|
||||
return StatusEnum.DEAD;
|
||||
return RaidBossStatus.DEAD;
|
||||
}
|
||||
else
|
||||
{
|
||||
return StatusEnum.UNDEFINED;
|
||||
return RaidBossStatus.UNDEFINED;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -511,7 +505,7 @@ public class RaidBossSpawnManager
|
||||
info.set("currentMP", raidboss.getCurrentMp());
|
||||
info.set("respawnTime", 0);
|
||||
|
||||
raidboss.setRaidStatus(StatusEnum.ALIVE);
|
||||
raidboss.setRaidStatus(RaidBossStatus.ALIVE);
|
||||
|
||||
_storedInfo.put(raidboss.getNpcId(), info);
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@ package org.l2jmobius.gameserver.model.actor.instance;
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.concurrent.ThreadPool;
|
||||
import org.l2jmobius.commons.util.Rnd;
|
||||
import org.l2jmobius.gameserver.enums.RaidBossStatus;
|
||||
import org.l2jmobius.gameserver.instancemanager.RaidBossPointsManager;
|
||||
import org.l2jmobius.gameserver.instancemanager.RaidBossSpawnManager;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
@@ -34,7 +35,7 @@ import org.l2jmobius.gameserver.templates.creatures.NpcTemplate;
|
||||
*/
|
||||
public class RaidBossInstance extends MonsterInstance
|
||||
{
|
||||
private RaidBossSpawnManager.StatusEnum _raidStatus;
|
||||
private RaidBossStatus _raidStatus;
|
||||
|
||||
/**
|
||||
* Constructor of RaidBossInstance (use Creature and NpcInstance constructor).<BR>
|
||||
@@ -135,7 +136,7 @@ public class RaidBossInstance extends MonsterInstance
|
||||
* Sets the raid status.
|
||||
* @param status the new raid status
|
||||
*/
|
||||
public void setRaidStatus(RaidBossSpawnManager.StatusEnum status)
|
||||
public void setRaidStatus(RaidBossStatus status)
|
||||
{
|
||||
_raidStatus = status;
|
||||
}
|
||||
@@ -144,7 +145,7 @@ public class RaidBossInstance extends MonsterInstance
|
||||
* Gets the raid status.
|
||||
* @return the raid status
|
||||
*/
|
||||
public RaidBossSpawnManager.StatusEnum getRaidStatus()
|
||||
public RaidBossStatus getRaidStatus()
|
||||
{
|
||||
return _raidStatus;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user