More readable ZoneId enums.

This commit is contained in:
MobiusDevelopment
2019-08-20 10:53:58 +00:00
parent 7be20ca5c0
commit 3023239ba8
22 changed files with 42 additions and 51 deletions

View File

@@ -485,7 +485,7 @@ public class MapRegionTable
final PlayerInstance player = (PlayerInstance) creature;
// If in Monster Derby Track
if (player.isInsideZone(ZoneId.MONSTERTRACK))
if (player.isInsideZone(ZoneId.MONSTER_TRACK))
{
return new Location(12661, 181687, -3560);
}

View File

@@ -54,7 +54,7 @@ public class AdminZone implements IAdminCommandHandler
BuilderUtil.sendSysMessage(activeChar, "This is NOT a PvP zone.");
}
if (activeChar.isInsideZone(ZoneId.NOLANDING))
if (activeChar.isInsideZone(ZoneId.NO_LANDING))
{
BuilderUtil.sendSysMessage(activeChar, "This is a no landing zone.");
}
@@ -63,7 +63,7 @@ public class AdminZone implements IAdminCommandHandler
BuilderUtil.sendSysMessage(activeChar, "This is NOT a no landing zone.");
}
if (activeChar.isInsideZone(ZoneId.NOSTORE))
if (activeChar.isInsideZone(ZoneId.NO_STORE))
{
BuilderUtil.sendSysMessage(activeChar, "This is a no-store zone.");
}

View File

@@ -52,7 +52,7 @@ public class ClanGate implements ISkillHandler
return;
}
if (player.isInFunEvent() || player.isInsideZone(ZoneId.NOLANDING) || player.isInOlympiadMode() || player.isInsideZone(ZoneId.PVP) || (GrandBossManager.getInstance().getZone(player) != null))
if (player.isInFunEvent() || player.isInsideZone(ZoneId.NO_LANDING) || player.isInOlympiadMode() || player.isInsideZone(ZoneId.PVP) || (GrandBossManager.getInstance().getZone(player) != null))
{
player.sendMessage("Cannot open the portal here.");
return;

View File

@@ -168,7 +168,7 @@ public class SiegeFlag implements ISkillHandler
{
sm.addString("You have already placed the maximum number of flags possible");
}
else if (player.isInsideZone(ZoneId.NOHQ))
else if (player.isInsideZone(ZoneId.NO_HQ))
{
sm.addString("You cannot place flag here.");
}
@@ -214,7 +214,7 @@ public class SiegeFlag implements ISkillHandler
{
sm.addString("You have already placed the maximum number of flags possible");
}
else if (player.isInsideZone(ZoneId.NOHQ))
else if (player.isInsideZone(ZoneId.NO_HQ))
{
sm.addString("You cannot place flag here.");
}

View File

@@ -373,7 +373,7 @@ public class Wedding implements IVoicedCommandHandler
activeChar.sendMessage("You have a cursed weapon, you can't go to your partner.");
return false;
}
else if (activeChar.isInsideZone(ZoneId.NOSUMMONFRIEND))
else if (activeChar.isInsideZone(ZoneId.NO_SUMMON_FRIEND))
{
activeChar.sendMessage("You are in area which blocks summoning.");
return false;

View File

@@ -154,7 +154,7 @@ public class CastleMagicianInstance extends NpcInstance
*/
private static final boolean validateGateCondition(PlayerInstance clanLeader, PlayerInstance player)
{
if (clanLeader.isAlikeDead() || clanLeader.isInStoreMode() || clanLeader.isRooted() || clanLeader.isInCombat() || clanLeader.isInOlympiadMode() || clanLeader.isFestivalParticipant() || clanLeader.inObserverMode() || clanLeader.isInsideZone(ZoneId.NOSUMMONFRIEND))
if (clanLeader.isAlikeDead() || clanLeader.isInStoreMode() || clanLeader.isRooted() || clanLeader.isInCombat() || clanLeader.isInOlympiadMode() || clanLeader.isFestivalParticipant() || clanLeader.inObserverMode() || clanLeader.isInsideZone(ZoneId.NO_SUMMON_FRIEND))
{
player.sendMessage("Couldn't teleport to clan leader. The requirements was not meet.");
return false;

View File

@@ -11767,7 +11767,7 @@ public class PlayerInstance extends Playable
public boolean checkLandingState()
{
// Check if char is in a no landing zone
if (isInsideZone(ZoneId.NOLANDING))
if (isInsideZone(ZoneId.NO_LANDING))
{
return true;
}
@@ -14636,7 +14636,7 @@ public class PlayerInstance extends Playable
return false;
}
if (summonerChar.isInsideZone(ZoneId.NOSUMMONFRIEND) || summonerChar.isFlying() || summonerChar.isMounted())
if (summonerChar.isInsideZone(ZoneId.NO_SUMMON_FRIEND) || summonerChar.isFlying() || summonerChar.isMounted())
{
summonerChar.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.YOUR_TARGET_IS_IN_AN_AREA_WHICH_BLOCKS_SUMMONING));
return false;
@@ -14697,7 +14697,7 @@ public class PlayerInstance extends Playable
return false;
}
if (targetChar.isInsideZone(ZoneId.NOSUMMONFRIEND))
if (targetChar.isInsideZone(ZoneId.NO_SUMMON_FRIEND))
{
return false;
}

View File

@@ -26,18 +26,18 @@ public enum ZoneId
PEACE,
SIEGE,
MOTHERTREE,
CLANHALL,
CLAN_HALL,
UNUSED,
NOLANDING,
NO_LANDING,
WATER,
JAIL,
MONSTERTRACK,
MONSTER_TRACK,
SWAMP,
NOSUMMONFRIEND,
OLY,
NOHQ,
DANGERAREA,
NOSTORE;
NO_SUMMON_FRIEND,
OLYMPIAD,
NO_HQ,
DANGER_AREA,
NO_STORE;
public static int getZoneCount()
{

View File

@@ -89,13 +89,13 @@ public class CastleTeleportZone extends ZoneType
@Override
protected void onEnter(Creature creature)
{
creature.setInsideZone(ZoneId.OLY, true);
creature.setInsideZone(ZoneId.OLYMPIAD, true);
}
@Override
protected void onExit(Creature creature)
{
creature.setInsideZone(ZoneId.OLY, false);
creature.setInsideZone(ZoneId.OLYMPIAD, false);
}
@Override

View File

@@ -85,7 +85,7 @@ public class ClanHallZone extends ZoneType
if (creature instanceof PlayerInstance)
{
// Set as in clan hall
creature.setInsideZone(ZoneId.CLANHALL, true);
creature.setInsideZone(ZoneId.CLAN_HALL, true);
ClanHall clanHall = ClanHallManager.getInstance().getClanHallById(_clanHallId);
@@ -112,7 +112,7 @@ public class ClanHallZone extends ZoneType
if (creature instanceof PlayerInstance)
{
// Unset clanhall zone
creature.setInsideZone(ZoneId.CLANHALL, false);
creature.setInsideZone(ZoneId.CLAN_HALL, false);
// Send a message
if ((((PlayerInstance) creature).getClanId() != 0) && (ClanHallManager.getInstance().getClanHallById(_clanHallId).getOwnerId() == ((PlayerInstance) creature).getClanId()))

View File

@@ -36,7 +36,7 @@ public class DerbyTrackZone extends PeaceZone
{
if (creature instanceof PlayerInstance)
{
creature.setInsideZone(ZoneId.MONSTERTRACK, true);
creature.setInsideZone(ZoneId.MONSTER_TRACK, true);
}
super.onEnter(creature);
}
@@ -46,7 +46,7 @@ public class DerbyTrackZone extends PeaceZone
{
if (creature instanceof PlayerInstance)
{
creature.setInsideZone(ZoneId.MONSTERTRACK, false);
creature.setInsideZone(ZoneId.MONSTER_TRACK, false);
}
super.onExit(creature);
}

View File

@@ -146,7 +146,7 @@ public class EffectZone extends ZoneType
if ((creature instanceof PlayerInstance) && _isShowDangerIcon)
{
creature.setInsideZone(ZoneId.DANGERAREA, true);
creature.setInsideZone(ZoneId.DANGER_AREA, true);
creature.sendPacket(new EtcStatusUpdate((PlayerInstance) creature));
}
}
@@ -156,8 +156,8 @@ public class EffectZone extends ZoneType
{
if ((creature instanceof PlayerInstance) && _isShowDangerIcon)
{
creature.setInsideZone(ZoneId.DANGERAREA, false);
if (!creature.isInsideZone(ZoneId.DANGERAREA))
creature.setInsideZone(ZoneId.DANGER_AREA, false);
if (!creature.isInsideZone(ZoneId.DANGER_AREA))
{
creature.sendPacket(new EtcStatusUpdate((PlayerInstance) creature));
}

View File

@@ -41,7 +41,7 @@ public class JailZone extends ZoneType
if (creature instanceof PlayerInstance)
{
creature.setInsideZone(ZoneId.JAIL, true);
creature.setInsideZone(ZoneId.NOSUMMONFRIEND, true);
creature.setInsideZone(ZoneId.NO_SUMMON_FRIEND, true);
if (Config.JAIL_IS_PVP)
{
creature.setInsideZone(ZoneId.PVP, true);
@@ -60,7 +60,7 @@ public class JailZone extends ZoneType
if (creature instanceof PlayerInstance)
{
creature.setInsideZone(ZoneId.JAIL, false);
creature.setInsideZone(ZoneId.NOSUMMONFRIEND, false);
creature.setInsideZone(ZoneId.NO_SUMMON_FRIEND, false);
if (Config.JAIL_IS_PVP)
{
creature.setInsideZone(ZoneId.PVP, false);

View File

@@ -37,7 +37,7 @@ public class NoHqZone extends ZoneType
{
if (creature instanceof PlayerInstance)
{
creature.setInsideZone(ZoneId.NOHQ, true);
creature.setInsideZone(ZoneId.NO_HQ, true);
}
}
@@ -46,7 +46,7 @@ public class NoHqZone extends ZoneType
{
if (creature instanceof PlayerInstance)
{
creature.setInsideZone(ZoneId.NOHQ, false);
creature.setInsideZone(ZoneId.NO_HQ, false);
}
}

View File

@@ -37,7 +37,7 @@ public class NoLandingZone extends ZoneType
{
if (creature instanceof PlayerInstance)
{
creature.setInsideZone(ZoneId.NOLANDING, true);
creature.setInsideZone(ZoneId.NO_LANDING, true);
}
}
@@ -46,7 +46,7 @@ public class NoLandingZone extends ZoneType
{
if (creature instanceof PlayerInstance)
{
creature.setInsideZone(ZoneId.NOLANDING, false);
creature.setInsideZone(ZoneId.NO_LANDING, false);
}
}

View File

@@ -37,7 +37,7 @@ public class NoStoreZone extends ZoneType
{
if (creature instanceof PlayerInstance)
{
creature.setInsideZone(ZoneId.NOSTORE, true);
creature.setInsideZone(ZoneId.NO_STORE, true);
}
}
@@ -46,7 +46,7 @@ public class NoStoreZone extends ZoneType
{
if (creature instanceof PlayerInstance)
{
creature.setInsideZone(ZoneId.NOSTORE, false);
creature.setInsideZone(ZoneId.NO_STORE, false);
}
}

View File

@@ -74,7 +74,7 @@ public class RequestRecipeShopListSet extends GameClientPacket
return;
}
if (player.isInsideZone(ZoneId.NOSTORE))
if (player.isInsideZone(ZoneId.NO_STORE))
{
// player.sendPacket(new RecipeShopManageList(player, player.isDwarven()));
player.sendMessage("Private manufacture are disable here. Try in another place.");

View File

@@ -96,7 +96,7 @@ public class SetPrivateStoreListBuy extends GameClientPacket
return;
}
if (player.isInsideZone(ZoneId.NOSTORE))
if (player.isInsideZone(ZoneId.NO_STORE))
{
player.sendPacket(new PrivateStoreManageListBuy(player));
player.sendMessage("Trade are disable here. Try in another place.");

View File

@@ -96,7 +96,7 @@ public class SetPrivateStoreListSell extends GameClientPacket
return;
}
if (player.isInsideZone(ZoneId.NOSTORE))
if (player.isInsideZone(ZoneId.NO_STORE))
{
player.sendPacket(new PrivateStoreManageListSell(player));
player.sendMessage("Trade are disable here. Try in another place.");

View File

@@ -55,7 +55,7 @@ public class EtcStatusUpdate extends GameServerPacket
writeD(_player.getWeightPenalty()); // 1-4 weight penalty, lvl (1=50%, 2=66.6%, 3=80%, 4=100%)
writeD(_player.isInRefusalMode() || _player.isChatBanned() ? 1 : 0); // 1 = block all chat
// writeD(0x00); // 1 = danger area
writeD(_player.isInsideZone(ZoneId.DANGERAREA)/* || _player.isInDangerArea() */ ? 1 : 0); // 1 = danger area
writeD(_player.isInsideZone(ZoneId.DANGER_AREA)/* || _player.isInDangerArea() */ ? 1 : 0); // 1 = danger area
writeD(Math.min(_player.getExpertisePenalty() + _player.getMasteryPenalty() + _player.getMasteryWeapPenalty(), 1)); // 1 = grade penalty
writeD(_player.getCharmOfCourage() ? 1 : 0); // 1 = charm of courage (no xp loss in siege..)
writeD(_player.getDeathPenaltyBuffLevel()); // 1-15 death penalty, lvl (combat ability decreased due to death)

View File

@@ -1029,7 +1029,7 @@ public class Formulas
}
}
if (player.isInsideZone(ZoneId.CLANHALL) && (player.getClan() != null))
if (player.isInsideZone(ZoneId.CLAN_HALL) && (player.getClan() != null))
{
final int clanHallIndex = player.getClan().getHasHideout();
if (clanHallIndex > 0)
@@ -1108,7 +1108,7 @@ public class Formulas
mpRegenBonus += 1;
}
if (player.isInsideZone(ZoneId.CLANHALL) && (player.getClan() != null))
if (player.isInsideZone(ZoneId.CLAN_HALL) && (player.getClan() != null))
{
final int clanHallIndex = player.getClan().getHasHideout();
if (clanHallIndex > 0)