Addition of RaidBossStatus enum.
This commit is contained in:
@@ -31,8 +31,8 @@ import org.l2jmobius.gameserver.ai.CtrlIntention;
|
||||
import org.l2jmobius.gameserver.data.xml.impl.DoorData;
|
||||
import org.l2jmobius.gameserver.data.xml.impl.SkillData;
|
||||
import org.l2jmobius.gameserver.enums.ChatType;
|
||||
import org.l2jmobius.gameserver.enums.RaidBossStatus;
|
||||
import org.l2jmobius.gameserver.instancemanager.RaidBossSpawnManager;
|
||||
import org.l2jmobius.gameserver.instancemanager.RaidBossSpawnManager.StatusEnum;
|
||||
import org.l2jmobius.gameserver.instancemanager.ZoneManager;
|
||||
import org.l2jmobius.gameserver.model.Location;
|
||||
import org.l2jmobius.gameserver.model.Party;
|
||||
@@ -1332,7 +1332,7 @@ public class TullyWorkshop extends AbstractNpcAI
|
||||
{
|
||||
nextServantIdx = 0;
|
||||
initDeathCounter(roomData[0]);
|
||||
if (RaidBossSpawnManager.getInstance().getRaidBossStatusId(DARION) == StatusEnum.ALIVE)
|
||||
if (RaidBossSpawnManager.getInstance().getRaidBossStatusId(DARION) == RaidBossStatus.ALIVE)
|
||||
{
|
||||
allowAgentSpawn = false;
|
||||
allowServantSpawn = false;
|
||||
@@ -1420,7 +1420,7 @@ public class TullyWorkshop extends AbstractNpcAI
|
||||
}
|
||||
else if (npc.getId() == PILLAR)
|
||||
{
|
||||
npc.setIsInvul(RaidBossSpawnManager.getInstance().getRaidBossStatusId(DARION) == StatusEnum.ALIVE);
|
||||
npc.setIsInvul(RaidBossSpawnManager.getInstance().getRaidBossStatusId(DARION) == RaidBossStatus.ALIVE);
|
||||
}
|
||||
return super.onSpawn(npc);
|
||||
}
|
||||
@@ -1541,7 +1541,7 @@ public class TullyWorkshop extends AbstractNpcAI
|
||||
private void doOnLoadSpawn()
|
||||
{
|
||||
// Ghost of Tully and Spooky Tombstone should be spawned, if Tully isn't alive
|
||||
if (RaidBossSpawnManager.getInstance().getRaidBossStatusId(TULLY) != StatusEnum.ALIVE)
|
||||
if (RaidBossSpawnManager.getInstance().getRaidBossStatusId(TULLY) != RaidBossStatus.ALIVE)
|
||||
{
|
||||
for (int i = 12; i <= 13; i++)
|
||||
{
|
||||
@@ -1558,7 +1558,7 @@ public class TullyWorkshop extends AbstractNpcAI
|
||||
pillarSpawn.startRespawn();
|
||||
|
||||
// Doors related
|
||||
if (RaidBossSpawnManager.getInstance().getRaidBossStatusId(DARION) != StatusEnum.ALIVE)
|
||||
if (RaidBossSpawnManager.getInstance().getRaidBossStatusId(DARION) != RaidBossStatus.ALIVE)
|
||||
{
|
||||
handleDoorsOnDeath();
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
@@ -24,6 +24,7 @@ import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.l2jmobius.gameserver.GameTimeController;
|
||||
import org.l2jmobius.gameserver.enums.RaidBossStatus;
|
||||
import org.l2jmobius.gameserver.model.Spawn;
|
||||
import org.l2jmobius.gameserver.model.actor.Npc;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.RaidBossInstance;
|
||||
@@ -205,7 +206,7 @@ public class DayNightSpawnManager
|
||||
continue;
|
||||
}
|
||||
|
||||
if ((boss != null) && (boss.getId() == 25328) && boss.getRaidStatus() == RaidBossSpawnManager.StatusEnum.ALIVE)
|
||||
if ((boss != null) && (boss.getId() == 25328) && (boss.getRaidStatus() == RaidBossStatus.ALIVE))
|
||||
{
|
||||
handleHellmans(boss, mode);
|
||||
}
|
||||
|
||||
@@ -33,6 +33,7 @@ import org.l2jmobius.commons.concurrent.ThreadPool;
|
||||
import org.l2jmobius.commons.database.DatabaseFactory;
|
||||
import org.l2jmobius.commons.util.Rnd;
|
||||
import org.l2jmobius.gameserver.datatables.SpawnTable;
|
||||
import org.l2jmobius.gameserver.enums.RaidBossStatus;
|
||||
import org.l2jmobius.gameserver.model.Spawn;
|
||||
import org.l2jmobius.gameserver.model.StatsSet;
|
||||
import org.l2jmobius.gameserver.model.actor.instance.RaidBossInstance;
|
||||
@@ -50,13 +51,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.
|
||||
*/
|
||||
@@ -134,7 +128,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());
|
||||
@@ -167,7 +161,7 @@ public class RaidBossSpawnManager
|
||||
|
||||
if (isBossDead)
|
||||
{
|
||||
boss.setRaidStatus(StatusEnum.DEAD);
|
||||
boss.setRaidStatus(RaidBossStatus.DEAD);
|
||||
|
||||
final int respawnMinDelay = (int) (boss.getSpawn().getRespawnMinDelay() * Config.RAID_MIN_RESPAWN_MULTIPLIER);
|
||||
final int respawnMaxDelay = (int) (boss.getSpawn().getRespawnMaxDelay() * Config.RAID_MAX_RESPAWN_MULTIPLIER);
|
||||
@@ -190,7 +184,7 @@ public class RaidBossSpawnManager
|
||||
}
|
||||
else
|
||||
{
|
||||
boss.setRaidStatus(StatusEnum.ALIVE);
|
||||
boss.setRaidStatus(RaidBossStatus.ALIVE);
|
||||
|
||||
info.set("currentHP", boss.getCurrentHp());
|
||||
info.set("currentMP", boss.getCurrentMp());
|
||||
@@ -226,7 +220,7 @@ public class RaidBossSpawnManager
|
||||
{
|
||||
raidboss.setCurrentHp(currentHP);
|
||||
raidboss.setCurrentMp(currentMP);
|
||||
raidboss.setRaidStatus(StatusEnum.ALIVE);
|
||||
raidboss.setRaidStatus(RaidBossStatus.ALIVE);
|
||||
|
||||
_bosses.put(bossId, raidboss);
|
||||
|
||||
@@ -343,7 +337,7 @@ public class RaidBossSpawnManager
|
||||
continue;
|
||||
}
|
||||
|
||||
if (boss.getRaidStatus() == StatusEnum.ALIVE)
|
||||
if (boss.getRaidStatus() == RaidBossStatus.ALIVE)
|
||||
{
|
||||
updateStatus(boss, false);
|
||||
}
|
||||
@@ -432,7 +426,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))
|
||||
{
|
||||
@@ -440,11 +434,11 @@ public class RaidBossSpawnManager
|
||||
}
|
||||
else if (_schedules.containsKey(bossId))
|
||||
{
|
||||
return StatusEnum.DEAD;
|
||||
return RaidBossStatus.DEAD;
|
||||
}
|
||||
else
|
||||
{
|
||||
return StatusEnum.UNDEFINED;
|
||||
return RaidBossStatus.UNDEFINED;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -459,7 +453,7 @@ public class RaidBossSpawnManager
|
||||
info.set("currentMP", raidboss.getCurrentMp());
|
||||
info.set("respawnTime", 0);
|
||||
|
||||
raidboss.setRaidStatus(StatusEnum.ALIVE);
|
||||
raidboss.setRaidStatus(RaidBossStatus.ALIVE);
|
||||
|
||||
_storedInfo.put(raidboss.getId(), info);
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@ package org.l2jmobius.gameserver.model.actor.instance;
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.util.Rnd;
|
||||
import org.l2jmobius.gameserver.enums.InstanceType;
|
||||
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;
|
||||
@@ -33,7 +34,7 @@ import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
|
||||
*/
|
||||
public class RaidBossInstance extends MonsterInstance
|
||||
{
|
||||
private RaidBossSpawnManager.StatusEnum _raidStatus;
|
||||
private RaidBossStatus _raidStatus;
|
||||
private boolean _useRaidCurse = true;
|
||||
|
||||
/**
|
||||
@@ -92,12 +93,12 @@ public class RaidBossInstance extends MonsterInstance
|
||||
return true;
|
||||
}
|
||||
|
||||
public void setRaidStatus(RaidBossSpawnManager.StatusEnum status)
|
||||
public void setRaidStatus(RaidBossStatus status)
|
||||
{
|
||||
_raidStatus = status;
|
||||
}
|
||||
|
||||
public RaidBossSpawnManager.StatusEnum getRaidStatus()
|
||||
public RaidBossStatus getRaidStatus()
|
||||
{
|
||||
return _raidStatus;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user