Addition of RaidBossStatus enum.

This commit is contained in:
MobiusDevelopment
2019-08-22 20:00:36 +00:00
parent b38ad9dbe6
commit 2407662a93
61 changed files with 667 additions and 348 deletions

View File

@ -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
}

View File

@ -35,6 +35,7 @@ import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.xml.impl.NpcData;
import org.l2jmobius.gameserver.data.xml.impl.SpawnsData;
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.Npc;
@ -55,13 +56,6 @@ public class DBSpawnManager
protected final Map<Integer, StatsSet> _storedInfo = new ConcurrentHashMap<>();
protected final Map<Integer, ScheduledFuture<?>> _schedules = new ConcurrentHashMap<>();
public enum DBStatusType
{
ALIVE,
DEAD,
UNDEFINED
}
/**
* Instantiates a new raid npc spawn manager.
*/
@ -164,7 +158,7 @@ public class DBSpawnManager
final Npc npc = _spawns.get(npcId).doSpawn();
if (npc != null)
{
npc.setDBStatus(DBStatusType.ALIVE);
npc.setDBStatus(RaidBossStatus.ALIVE);
final StatsSet info = new StatsSet();
info.set("currentHP", npc.getCurrentHp());
@ -194,7 +188,7 @@ public class DBSpawnManager
if (isNpcDead)
{
npc.setDBStatus(DBStatusType.DEAD);
npc.setDBStatus(RaidBossStatus.DEAD);
final int respawnMinDelay = (int) (npc.getSpawn().getRespawnMinDelay() * Config.RAID_MIN_RESPAWN_MULTIPLIER);
final int respawnMaxDelay = (int) (npc.getSpawn().getRespawnMaxDelay() * Config.RAID_MAX_RESPAWN_MULTIPLIER);
@ -215,7 +209,7 @@ public class DBSpawnManager
}
else
{
npc.setDBStatus(DBStatusType.ALIVE);
npc.setDBStatus(RaidBossStatus.ALIVE);
info.set("currentHP", npc.getCurrentHp());
info.set("currentMP", npc.getCurrentMp());
@ -255,7 +249,7 @@ public class DBSpawnManager
{
npc.setCurrentHp(currentHP);
npc.setCurrentMp(currentMP);
npc.setDBStatus(DBStatusType.ALIVE);
npc.setDBStatus(RaidBossStatus.ALIVE);
_npcs.put(npcId, npc);
@ -319,7 +313,7 @@ public class DBSpawnManager
{
throw new NullPointerException();
}
npc.setDBStatus(DBStatusType.ALIVE);
npc.setDBStatus(RaidBossStatus.ALIVE);
final StatsSet info = new StatsSet();
info.set("currentHP", npc.getMaxHp());
@ -419,7 +413,7 @@ public class DBSpawnManager
continue;
}
if (npc.getDBStatus() == DBStatusType.ALIVE)
if (npc.getDBStatus() == RaidBossStatus.ALIVE)
{
updateStatus(npc, false);
}
@ -506,7 +500,7 @@ public class DBSpawnManager
* @param npcId the npc id
* @return the raid npc status id
*/
public DBStatusType getNpcStatusId(int npcId)
public RaidBossStatus getNpcStatusId(int npcId)
{
if (_npcs.containsKey(npcId))
{
@ -514,11 +508,11 @@ public class DBSpawnManager
}
else if (_schedules.containsKey(npcId))
{
return DBStatusType.DEAD;
return RaidBossStatus.DEAD;
}
else
{
return DBStatusType.UNDEFINED;
return RaidBossStatus.UNDEFINED;
}
}
@ -543,7 +537,7 @@ public class DBSpawnManager
info.set("currentMP", npc.getCurrentMp());
info.set("respawnTime", 0);
npc.setDBStatus(DBStatusType.ALIVE);
npc.setDBStatus(RaidBossStatus.ALIVE);
_storedInfo.put(npc.getId(), info);
_npcs.put(npc.getId(), npc);

View File

@ -29,6 +29,7 @@ import org.l2jmobius.gameserver.datatables.ItemTable;
import org.l2jmobius.gameserver.enums.AISkillScope;
import org.l2jmobius.gameserver.enums.AIType;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.enums.RaidBossStatus;
import org.l2jmobius.gameserver.enums.InstanceType;
import org.l2jmobius.gameserver.enums.MpRewardAffectType;
import org.l2jmobius.gameserver.enums.PrivateStoreType;
@ -41,7 +42,6 @@ import org.l2jmobius.gameserver.handler.BypassHandler;
import org.l2jmobius.gameserver.handler.IBypassHandler;
import org.l2jmobius.gameserver.instancemanager.CastleManager;
import org.l2jmobius.gameserver.instancemanager.DBSpawnManager;
import org.l2jmobius.gameserver.instancemanager.DBSpawnManager.DBStatusType;
import org.l2jmobius.gameserver.instancemanager.FortManager;
import org.l2jmobius.gameserver.instancemanager.WalkingManager;
import org.l2jmobius.gameserver.instancemanager.ZoneManager;
@ -150,7 +150,7 @@ public class Npc extends Creature
private NpcStringId _nameString;
private StatsSet _params;
private DBStatusType _raidStatus;
private RaidBossStatus _raidStatus;
/** Contains information about local tax payments. */
private TaxZone _taxZone = null;
@ -1851,12 +1851,12 @@ public class Npc extends Creature
broadcastPacket(new ExShowChannelingEffect(this, target, state));
}
public void setDBStatus(DBStatusType status)
public void setDBStatus(RaidBossStatus status)
{
_raidStatus = status;
}
public DBStatusType getDBStatus()
public RaidBossStatus getDBStatus()
{
return _raidStatus;
}