Replaced equals() on enum constants.

This commit is contained in:
MobiusDev 2018-09-09 18:41:22 +00:00
parent 31dadef4b8
commit dce4f54d60
143 changed files with 252 additions and 248 deletions

View File

@ -53,7 +53,7 @@ public final class AvantGarde extends AbstractNpcAI
@Override @Override
public String onAcquireSkill(L2Npc npc, L2PcInstance player, Skill skill, AcquireSkillType type) public String onAcquireSkill(L2Npc npc, L2PcInstance player, Skill skill, AcquireSkillType type)
{ {
if (type.equals(AcquireSkillType.TRANSFORM)) if (type == AcquireSkillType.TRANSFORM)
{ {
showTransformSkillList(player); showTransformSkillList(player);
} }

View File

@ -75,7 +75,7 @@ public final class OrcBarracks extends AbstractNpcAI
@Override @Override
public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon) public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon)
{ {
if (killer.getRace().equals(Race.ERTHEIA) && (SPAWN_RATE > getRandom(100))) if (killer.getRace() == Race.ERTHEIA && (SPAWN_RATE > getRandom(100)))
{ {
final int npcId = (killer.isMageClass()) ? CHERTUBA_ILLUSION : CHERTUBA_MIRAGE; final int npcId = (killer.isMageClass()) ? CHERTUBA_ILLUSION : CHERTUBA_MIRAGE;
showOnScreenMsg(killer, NpcStringId.A_POWERFUL_MONSTER_HAS_COME_TO_FACE_YOU, ExShowScreenMessage.TOP_CENTER, 5000); showOnScreenMsg(killer, NpcStringId.A_POWERFUL_MONSTER_HAS_COME_TO_FACE_YOU, ExShowScreenMessage.TOP_CENTER, 5000);

View File

@ -206,7 +206,7 @@ public final class AwakeningMaster extends AbstractNpcAI
@Override @Override
public String onFirstTalk(L2Npc npc, L2PcInstance player) public String onFirstTalk(L2Npc npc, L2PcInstance player)
{ {
if (player.getRace().equals(Race.ERTHEIA)) if (player.getRace() == Race.ERTHEIA)
{ {
// Ertheia dual class quest // Ertheia dual class quest
final QuestState qs = player.getQuestState(Q10472_WindsOfFateEncroachingShadows.class.getSimpleName()); final QuestState qs = player.getQuestState(Q10472_WindsOfFateEncroachingShadows.class.getSimpleName());

View File

@ -98,11 +98,11 @@ public final class Hardin extends AbstractNpcAI
} }
if (Config.HARDIN_RETAIL_LIMITATIONS) if (Config.HARDIN_RETAIL_LIMITATIONS)
{ {
if (c.equals(ClassId.TYRR_MAESTRO) && (player.getRace() != Race.DWARF)) if (c == ClassId.TYRR_MAESTRO && (player.getRace() != Race.DWARF))
{ {
continue; continue;
} }
if (c.equals(ClassId.ISS_DOMINATOR) && (player.getRace() != Race.ORC)) if (c == ClassId.ISS_DOMINATOR && (player.getRace() != Race.ORC))
{ {
continue; continue;
} }
@ -171,7 +171,7 @@ public final class Hardin extends AbstractNpcAI
private String getHtmlMessage(L2PcInstance player) private String getHtmlMessage(L2PcInstance player)
{ {
if (player.getRace().equals(Race.ERTHEIA)) if (player.getRace() == Race.ERTHEIA)
{ {
final QuestState qs = player.getQuestState(Q10472_WindsOfFateEncroachingShadows.class.getSimpleName()); final QuestState qs = player.getQuestState(Q10472_WindsOfFateEncroachingShadows.class.getSimpleName());
if ((qs != null) && (qs.getCond() >= 7) && (qs.getCond() <= 17)) if ((qs != null) && (qs.getCond() >= 7) && (qs.getCond() <= 17))

View File

@ -88,7 +88,7 @@ public final class Trandon extends AbstractNpcAI
} }
case "33490-12.html": case "33490-12.html":
{ {
if (player.getRace().equals(Race.ERTHEIA) || hasAllSubCertifications(player)) if (player.getRace() == Race.ERTHEIA || hasAllSubCertifications(player))
{ {
htmltext = "33490-15.html"; htmltext = "33490-15.html";
} }
@ -134,7 +134,7 @@ public final class Trandon extends AbstractNpcAI
} }
case "giveSubCertify": case "giveSubCertify":
{ {
if ((substrings.length < 2) || !player.isSubClassActive() || player.getRace().equals(Race.ERTHEIA)) if ((substrings.length < 2) || !player.isSubClassActive() || player.getRace() == Race.ERTHEIA)
{ {
return null; return null;
} }
@ -161,7 +161,7 @@ public final class Trandon extends AbstractNpcAI
} }
case "learnSubSkill": case "learnSubSkill":
{ {
if (player.getRace().equals(Race.ERTHEIA)) if (player.getRace() == Race.ERTHEIA)
{ {
htmltext = "33490-15.html"; htmltext = "33490-15.html";
} }
@ -178,7 +178,8 @@ public final class Trandon extends AbstractNpcAI
} }
case "deleteSubSkill": case "deleteSubSkill":
{ {
if (player.getRace().equals(Race.ERTHEIA)) // TODO: Unknown html
if (player.getRace() == Race.ERTHEIA)
{ {
htmltext = "33490-15.html"; htmltext = "33490-15.html";
} }

View File

@ -46,7 +46,7 @@ public final class WindVortex extends AbstractNpcAI
if (npc.isScriptValue(0) && !npc.isDead()) if (npc.isScriptValue(0) && !npc.isDead())
{ {
npc.setScriptValue(1); npc.setScriptValue(1);
if (attacker.getRace().equals(Race.ERTHEIA)) if (attacker.getRace() == Race.ERTHEIA)
{ {
final int npcId = (attacker.isMageClass()) ? IMMENSE_WINDIMA : GIANT_WINDIMA; final int npcId = (attacker.isMageClass()) ? IMMENSE_WINDIMA : GIANT_WINDIMA;
showOnScreenMsg(attacker, NpcStringId.A_POWERFUL_MONSTER_HAS_COME_TO_FACE_YOU, ExShowScreenMessage.TOP_CENTER, 5000); showOnScreenMsg(attacker, NpcStringId.A_POWERFUL_MONSTER_HAS_COME_TO_FACE_YOU, ExShowScreenMessage.TOP_CENTER, 5000);

View File

@ -384,7 +384,7 @@ public class AdminEditChar implements IAdminCommandHandler
} }
// Sex checks. // Sex checks.
if (player.getRace().equals(Race.KAMAEL)) if (player.getRace() == Race.KAMAEL)
{ {
switch (classidval) switch (classidval)
{ {
@ -418,7 +418,7 @@ public class AdminEditChar implements IAdminCommandHandler
} }
} }
} }
if (player.getRace().equals(Race.ERTHEIA)) if (player.getRace() == Race.ERTHEIA)
{ {
player.getAppearance().setSex(true); player.getAppearance().setSex(true);
} }

View File

@ -46,7 +46,7 @@ public final class ModifyVital extends AbstractEffect
public ModifyVital(StatsSet params) public ModifyVital(StatsSet params)
{ {
_type = params.getEnum("type", ModifyType.class); _type = params.getEnum("type", ModifyType.class);
if (!_type.equals(ModifyType.SET)) if (_type != ModifyType.SET)
{ {
_hp = params.getInt("hp", 0); _hp = params.getInt("hp", 0);
_mp = params.getInt("mp", 0); _mp = params.getInt("mp", 0);

View File

@ -181,7 +181,7 @@ public abstract class AbstractInstance extends AbstractNpcAI
template.applyConditionEffects(enterGroup); template.applyConditionEffects(enterGroup);
// Set re-enter for instances with re-enter on start // Set re-enter for instances with re-enter on start
if (instance.getReenterType().equals(InstanceReenterType.ON_ENTER)) if (instance.getReenterType() == InstanceReenterType.ON_ENTER)
{ {
instance.setReenterTime(); instance.setReenterTime();
} }

View File

@ -530,7 +530,7 @@ public final class Q10751_WindsOfFateEncounters extends Quest
final int oldLevel = event.getOldLevel(); final int oldLevel = event.getOldLevel();
final int newLevel = event.getNewLevel(); final int newLevel = event.getNewLevel();
if ((st == null) && (player.getRace().equals(Race.ERTHEIA)) && (oldLevel < newLevel) && (newLevel >= MIN_LEVEL) && (player.isInCategory(CategoryType.FIRST_CLASS_GROUP))) if ((st == null) && (player.getRace() == Race.ERTHEIA) && (oldLevel < newLevel) && (newLevel >= MIN_LEVEL) && (player.isInCategory(CategoryType.FIRST_CLASS_GROUP)))
{ {
showOnScreenMsg(player, NpcStringId.QUEEN_NAVARI_HAS_SENT_A_LETTER_NCLICK_THE_QUESTION_MARK_ICON_TO_READ, ExShowScreenMessage.TOP_CENTER, 10000); showOnScreenMsg(player, NpcStringId.QUEEN_NAVARI_HAS_SENT_A_LETTER_NCLICK_THE_QUESTION_MARK_ICON_TO_READ, ExShowScreenMessage.TOP_CENTER, 10000);
player.sendPacket(new TutorialShowQuestionMark(getId())); player.sendPacket(new TutorialShowQuestionMark(getId()));
@ -549,7 +549,7 @@ public final class Q10751_WindsOfFateEncounters extends Quest
final L2PcInstance player = event.getActiveChar(); final L2PcInstance player = event.getActiveChar();
final QuestState st = getQuestState(player, false); final QuestState st = getQuestState(player, false);
if ((st == null) && player.getRace().equals(Race.ERTHEIA) && (player.getLevel() >= MIN_LEVEL) && (player.isInCategory(CategoryType.FIRST_CLASS_GROUP))) if ((st == null) && player.getRace() == Race.ERTHEIA && (player.getLevel() >= MIN_LEVEL) && (player.isInCategory(CategoryType.FIRST_CLASS_GROUP)))
{ {
showOnScreenMsg(player, NpcStringId.QUEEN_NAVARI_HAS_SENT_A_LETTER_NCLICK_THE_QUESTION_MARK_ICON_TO_READ, ExShowScreenMessage.TOP_CENTER, 10000); showOnScreenMsg(player, NpcStringId.QUEEN_NAVARI_HAS_SENT_A_LETTER_NCLICK_THE_QUESTION_MARK_ICON_TO_READ, ExShowScreenMessage.TOP_CENTER, 10000);
player.sendPacket(new TutorialShowQuestionMark(getId())); player.sendPacket(new TutorialShowQuestionMark(getId()));

View File

@ -548,7 +548,7 @@ public final class Q10752_WindsOfFateAPromise extends Quest
final int oldLevel = event.getOldLevel(); final int oldLevel = event.getOldLevel();
final int newLevel = event.getNewLevel(); final int newLevel = event.getNewLevel();
if ((qs == null) && (player.getRace().equals(Race.ERTHEIA)) && (oldLevel < newLevel) && (newLevel >= MIN_LEVEL) && (player.isInCategory(CategoryType.THIRD_CLASS_GROUP))) if ((qs == null) && (player.getRace() == Race.ERTHEIA) && (oldLevel < newLevel) && (newLevel >= MIN_LEVEL) && (player.isInCategory(CategoryType.THIRD_CLASS_GROUP)))
{ {
if (player.isMageClass()) if (player.isMageClass())
{ {
@ -574,7 +574,7 @@ public final class Q10752_WindsOfFateAPromise extends Quest
final L2PcInstance player = event.getActiveChar(); final L2PcInstance player = event.getActiveChar();
final QuestState qs = getQuestState(player, false); final QuestState qs = getQuestState(player, false);
if ((qs == null) && player.getRace().equals(Race.ERTHEIA) && (player.getLevel() >= MIN_LEVEL) && (player.isInCategory(CategoryType.THIRD_CLASS_GROUP))) if ((qs == null) && player.getRace() == Race.ERTHEIA && (player.getLevel() >= MIN_LEVEL) && (player.isInCategory(CategoryType.THIRD_CLASS_GROUP)))
{ {
if (player.isMageClass()) if (player.isMageClass())
{ {

View File

@ -809,7 +809,7 @@ public final class Q10753_WindsOfFateChoices extends Quest
final int oldLevel = event.getOldLevel(); final int oldLevel = event.getOldLevel();
final int newLevel = event.getNewLevel(); final int newLevel = event.getNewLevel();
if ((qs == null) && (player.getRace().equals(Race.ERTHEIA)) && (oldLevel < newLevel) && (newLevel >= MIN_LEVEL) && (player.isInCategory(CategoryType.FOURTH_CLASS_GROUP))) if ((qs == null) && (player.getRace() == Race.ERTHEIA) && (oldLevel < newLevel) && (newLevel >= MIN_LEVEL) && (player.isInCategory(CategoryType.FOURTH_CLASS_GROUP)))
{ {
if (player.isMageClass()) if (player.isMageClass())
{ {
@ -836,7 +836,7 @@ public final class Q10753_WindsOfFateChoices extends Quest
final L2PcInstance player = event.getActiveChar(); final L2PcInstance player = event.getActiveChar();
final QuestState qs = getQuestState(player, false); final QuestState qs = getQuestState(player, false);
if ((qs == null) && player.getRace().equals(Race.ERTHEIA) && (player.getLevel() >= MIN_LEVEL) && (player.isInCategory(CategoryType.FOURTH_CLASS_GROUP))) if ((qs == null) && player.getRace() == Race.ERTHEIA && (player.getLevel() >= MIN_LEVEL) && (player.isInCategory(CategoryType.FOURTH_CLASS_GROUP)))
{ {
if (player.isMageClass()) if (player.isMageClass())
{ {

View File

@ -718,17 +718,17 @@ public final class CastleManorManager implements IGameXmlReader, IStorable
public final boolean isUnderMaintenance() public final boolean isUnderMaintenance()
{ {
return _mode.equals(ManorMode.MAINTENANCE); return _mode == ManorMode.MAINTENANCE;
} }
public final boolean isManorApproved() public final boolean isManorApproved()
{ {
return _mode.equals(ManorMode.APPROVED); return _mode == ManorMode.APPROVED;
} }
public final boolean isModifiablePeriod() public final boolean isModifiablePeriod()
{ {
return _mode.equals(ManorMode.MODIFIABLE); return _mode == ManorMode.MODIFIABLE;
} }
public final String getCurrentModeName() public final String getCurrentModeName()

View File

@ -417,7 +417,7 @@ public class DBSpawnManager
continue; continue;
} }
if (npc.getDBStatus().equals(DBStatusType.ALIVE)) if (npc.getDBStatus() == DBStatusType.ALIVE)
{ {
updateStatus(npc, false); updateStatus(npc, false);
} }

View File

@ -1149,7 +1149,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
private Attack generateAttackTargetData(L2Character target, L2Weapon weapon, WeaponType weaponType) private Attack generateAttackTargetData(L2Character target, L2Weapon weapon, WeaponType weaponType)
{ {
final boolean isDual = WeaponType.DUAL.equals(weaponType) || WeaponType.DUALBLUNT.equals(weaponType) || WeaponType.DUALDAGGER.equals(weaponType) || WeaponType.DUALFIST.equals(weaponType); final boolean isDual = WeaponType.DUAL == weaponType || WeaponType.DUALBLUNT == weaponType || WeaponType.DUALDAGGER == weaponType || WeaponType.DUALFIST == weaponType;
final Attack attack = new Attack(this, target); final Attack attack = new Attack(this, target);
boolean shotConsumed = false; boolean shotConsumed = false;

View File

@ -240,7 +240,7 @@ public class L2Npc extends L2Character
*/ */
public boolean hasRandomAnimation() public boolean hasRandomAnimation()
{ {
return ((Config.MAX_NPC_ANIMATION > 0) && _isRandomAnimationEnabled && !getAiType().equals(AIType.CORPSE)); return ((Config.MAX_NPC_ANIMATION > 0) && _isRandomAnimationEnabled && getAiType() != AIType.CORPSE);
} }
/** /**
@ -1337,7 +1337,7 @@ public class L2Npc extends L2Character
@Override @Override
public boolean isMovementDisabled() public boolean isMovementDisabled()
{ {
return super.isMovementDisabled() || !getTemplate().canMove() || getAiType().equals(AIType.CORPSE); return super.isMovementDisabled() || !getTemplate().canMove() || getAiType() == AIType.CORPSE;
} }
public AIType getAiType() public AIType getAiType()

View File

@ -878,7 +878,7 @@ public final class Instance implements IIdentifiable, INamable
public void finishInstance(int delay) public void finishInstance(int delay)
{ {
// Set re-enter for players // Set re-enter for players
if (_template.getReenterType().equals(InstanceReenterType.ON_FINISH)) if (_template.getReenterType() == InstanceReenterType.ON_FINISH)
{ {
setReenterTime(); setReenterTime();
} }
@ -941,7 +941,7 @@ public final class Instance implements IIdentifiable, INamable
addPlayer(player); addPlayer(player);
// Set origin return location if enabled // Set origin return location if enabled
if (_template.getExitLocationType().equals(InstanceTeleportType.ORIGIN)) if (_template.getExitLocationType() == InstanceTeleportType.ORIGIN)
{ {
player.getVariables().set("INSTANCE_ORIGIN", player.getX() + ";" + player.getY() + ";" + player.getZ()); player.getVariables().set("INSTANCE_ORIGIN", player.getX() + ";" + player.getY() + ";" + player.getZ());
} }

View File

@ -498,7 +498,7 @@ public class InstanceTemplate extends ListenersContainer implements IIdentifiabl
} }
// Now remove buffs by type // Now remove buffs by type
if (_removeBuffType.equals(InstanceRemoveBuffType.ALL)) if (_removeBuffType == InstanceRemoveBuffType.ALL)
{ {
for (L2Playable playable : affected) for (L2Playable playable : affected)
{ {
@ -635,7 +635,7 @@ public class InstanceTemplate extends ListenersContainer implements IIdentifiabl
// player < party < command channel // player < party < command channel
for (GroupType t : GroupType.values()) for (GroupType t : GroupType.values())
{ {
if (!t.equals(playerGroup) && groupMaskContains(t)) if (t != playerGroup && groupMaskContains(t))
{ {
return t; return t;
} }
@ -663,11 +663,11 @@ public class InstanceTemplate extends ListenersContainer implements IIdentifiabl
// Check if player has group in which he can enter // Check if player has group in which he can enter
AbstractPlayerGroup pGroup = null; AbstractPlayerGroup pGroup = null;
if (type.equals(GroupType.PARTY)) if (type == GroupType.PARTY)
{ {
pGroup = player.getParty(); pGroup = player.getParty();
} }
else if (type.equals(GroupType.COMMAND_CHANNEL)) else if (type == GroupType.COMMAND_CHANNEL)
{ {
pGroup = player.getCommandChannel(); pGroup = player.getCommandChannel();
} }

View File

@ -70,7 +70,7 @@ public interface ILocational
*/ */
default boolean isInFrontOf(ILocational target) default boolean isInFrontOf(ILocational target)
{ {
return Position.FRONT.equals(Position.getPosition(this, target)); return Position.FRONT == Position.getPosition(this, target);
} }
/** /**
@ -79,7 +79,7 @@ public interface ILocational
*/ */
default boolean isOnSideOf(ILocational target) default boolean isOnSideOf(ILocational target)
{ {
return Position.SIDE.equals(Position.getPosition(this, target)); return Position.SIDE == Position.getPosition(this, target);
} }
/** /**
@ -88,6 +88,6 @@ public interface ILocational
*/ */
default boolean isBehind(ILocational target) default boolean isBehind(ILocational target)
{ {
return Position.BACK.equals(Position.getPosition(this, target)); return Position.BACK == Position.getPosition(this, target);
} }
} }

View File

@ -237,7 +237,7 @@ public class PunishmentTask implements Runnable
} }
} }
if (_type.equals(PunishmentType.CHAT_BAN) && _affect.equals(PunishmentAffect.CHARACTER)) if (_type == PunishmentType.CHAT_BAN && _affect == PunishmentAffect.CHARACTER)
{ {
final L2PcInstance player = L2World.getInstance().getPlayer(Integer.valueOf(_key)); final L2PcInstance player = L2World.getInstance().getPlayer(Integer.valueOf(_key));
if (player != null) if (player != null)

View File

@ -455,6 +455,6 @@ public final class BuffInfo
public boolean isAbnormalType(AbnormalType type) public boolean isAbnormalType(AbnormalType type)
{ {
return _skill.getAbnormalType().equals(type); return _skill.getAbnormalType() == type;
} }
} }

View File

@ -118,7 +118,7 @@ public interface IStatsFunction
(bodypart == L2Item.SLOT_HAIRALL)) (bodypart == L2Item.SLOT_HAIRALL))
{ {
// TODO: Item after enchant shows pDef, but scroll says mDef increase. // TODO: Item after enchant shows pDef, but scroll says mDef increase.
if (!stat.equals(Stats.PHYSICAL_DEFENCE) && !stat.equals(Stats.MAGICAL_DEFENCE)) if (stat != Stats.PHYSICAL_DEFENCE && stat != Stats.MAGICAL_DEFENCE)
{ {
continue; continue;
} }

View File

@ -75,7 +75,7 @@ public final class TeleportHolder
*/ */
public boolean isNoblesse() public boolean isNoblesse()
{ {
return _type.equals(TeleportType.NOBLES_ADENA) || _type.equals(TeleportType.NOBLES_TOKEN); return _type == TeleportType.NOBLES_ADENA || _type == TeleportType.NOBLES_TOKEN;
} }
/** /**

View File

@ -53,7 +53,7 @@ public final class AvantGarde extends AbstractNpcAI
@Override @Override
public String onAcquireSkill(L2Npc npc, L2PcInstance player, Skill skill, AcquireSkillType type) public String onAcquireSkill(L2Npc npc, L2PcInstance player, Skill skill, AcquireSkillType type)
{ {
if (type.equals(AcquireSkillType.TRANSFORM)) if (type == AcquireSkillType.TRANSFORM)
{ {
showTransformSkillList(player); showTransformSkillList(player);
} }

View File

@ -75,7 +75,7 @@ public final class OrcBarracks extends AbstractNpcAI
@Override @Override
public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon) public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon)
{ {
if (killer.getRace().equals(Race.ERTHEIA) && (SPAWN_RATE > getRandom(100))) if (killer.getRace() == Race.ERTHEIA && (SPAWN_RATE > getRandom(100)))
{ {
final int npcId = (killer.isMageClass()) ? CHERTUBA_ILLUSION : CHERTUBA_MIRAGE; final int npcId = (killer.isMageClass()) ? CHERTUBA_ILLUSION : CHERTUBA_MIRAGE;
showOnScreenMsg(killer, NpcStringId.A_POWERFUL_MONSTER_HAS_COME_TO_FACE_YOU, ExShowScreenMessage.TOP_CENTER, 5000); showOnScreenMsg(killer, NpcStringId.A_POWERFUL_MONSTER_HAS_COME_TO_FACE_YOU, ExShowScreenMessage.TOP_CENTER, 5000);

View File

@ -206,7 +206,7 @@ public final class AwakeningMaster extends AbstractNpcAI
@Override @Override
public String onFirstTalk(L2Npc npc, L2PcInstance player) public String onFirstTalk(L2Npc npc, L2PcInstance player)
{ {
if (player.getRace().equals(Race.ERTHEIA)) if (player.getRace() == Race.ERTHEIA)
{ {
// Ertheia dual class quest // Ertheia dual class quest
final QuestState qs = player.getQuestState(Q10472_WindsOfFateEncroachingShadows.class.getSimpleName()); final QuestState qs = player.getQuestState(Q10472_WindsOfFateEncroachingShadows.class.getSimpleName());

View File

@ -98,11 +98,11 @@ public final class Hardin extends AbstractNpcAI
} }
if (Config.HARDIN_RETAIL_LIMITATIONS) if (Config.HARDIN_RETAIL_LIMITATIONS)
{ {
if (c.equals(ClassId.TYRR_MAESTRO) && (player.getRace() != Race.DWARF)) if (c == ClassId.TYRR_MAESTRO && (player.getRace() != Race.DWARF))
{ {
continue; continue;
} }
if (c.equals(ClassId.ISS_DOMINATOR) && (player.getRace() != Race.ORC)) if (c == ClassId.ISS_DOMINATOR && (player.getRace() != Race.ORC))
{ {
continue; continue;
} }
@ -171,7 +171,7 @@ public final class Hardin extends AbstractNpcAI
private String getHtmlMessage(L2PcInstance player) private String getHtmlMessage(L2PcInstance player)
{ {
if (player.getRace().equals(Race.ERTHEIA)) if (player.getRace() == Race.ERTHEIA)
{ {
final QuestState qs = player.getQuestState(Q10472_WindsOfFateEncroachingShadows.class.getSimpleName()); final QuestState qs = player.getQuestState(Q10472_WindsOfFateEncroachingShadows.class.getSimpleName());
if ((qs != null) && (qs.getCond() >= 7) && (qs.getCond() <= 17)) if ((qs != null) && (qs.getCond() >= 7) && (qs.getCond() <= 17))

View File

@ -88,7 +88,7 @@ public final class Trandon extends AbstractNpcAI
} }
case "33490-12.html": case "33490-12.html":
{ {
if (player.getRace().equals(Race.ERTHEIA) || hasAllSubCertifications(player)) if (player.getRace() == Race.ERTHEIA || hasAllSubCertifications(player))
{ {
htmltext = "33490-15.html"; htmltext = "33490-15.html";
} }
@ -134,7 +134,7 @@ public final class Trandon extends AbstractNpcAI
} }
case "giveSubCertify": case "giveSubCertify":
{ {
if ((substrings.length < 2) || !player.isSubClassActive() || player.getRace().equals(Race.ERTHEIA)) if ((substrings.length < 2) || !player.isSubClassActive() || player.getRace() == Race.ERTHEIA)
{ {
return null; return null;
} }
@ -161,7 +161,7 @@ public final class Trandon extends AbstractNpcAI
} }
case "learnSubSkill": case "learnSubSkill":
{ {
if (player.getRace().equals(Race.ERTHEIA)) if (player.getRace() == Race.ERTHEIA)
{ {
htmltext = "33490-15.html"; htmltext = "33490-15.html";
} }
@ -178,7 +178,8 @@ public final class Trandon extends AbstractNpcAI
} }
case "deleteSubSkill": case "deleteSubSkill":
{ {
if (player.getRace().equals(Race.ERTHEIA)) // TODO: Unknown html
if (player.getRace() == Race.ERTHEIA)
{ {
htmltext = "33490-15.html"; htmltext = "33490-15.html";
} }

View File

@ -46,7 +46,7 @@ public final class WindVortex extends AbstractNpcAI
if (npc.isScriptValue(0) && !npc.isDead()) if (npc.isScriptValue(0) && !npc.isDead())
{ {
npc.setScriptValue(1); npc.setScriptValue(1);
if (attacker.getRace().equals(Race.ERTHEIA)) if (attacker.getRace() == Race.ERTHEIA)
{ {
final int npcId = (attacker.isMageClass()) ? IMMENSE_WINDIMA : GIANT_WINDIMA; final int npcId = (attacker.isMageClass()) ? IMMENSE_WINDIMA : GIANT_WINDIMA;
showOnScreenMsg(attacker, NpcStringId.A_POWERFUL_MONSTER_HAS_COME_TO_FACE_YOU, ExShowScreenMessage.TOP_CENTER, 5000); showOnScreenMsg(attacker, NpcStringId.A_POWERFUL_MONSTER_HAS_COME_TO_FACE_YOU, ExShowScreenMessage.TOP_CENTER, 5000);

View File

@ -384,7 +384,7 @@ public class AdminEditChar implements IAdminCommandHandler
} }
// Sex checks. // Sex checks.
if (player.getRace().equals(Race.KAMAEL)) if (player.getRace() == Race.KAMAEL)
{ {
switch (classidval) switch (classidval)
{ {
@ -418,7 +418,7 @@ public class AdminEditChar implements IAdminCommandHandler
} }
} }
} }
if (player.getRace().equals(Race.ERTHEIA)) if (player.getRace() == Race.ERTHEIA)
{ {
player.getAppearance().setSex(true); player.getAppearance().setSex(true);
} }

View File

@ -46,7 +46,7 @@ public final class ModifyVital extends AbstractEffect
public ModifyVital(StatsSet params) public ModifyVital(StatsSet params)
{ {
_type = params.getEnum("type", ModifyType.class); _type = params.getEnum("type", ModifyType.class);
if (!_type.equals(ModifyType.SET)) if (_type != ModifyType.SET)
{ {
_hp = params.getInt("hp", 0); _hp = params.getInt("hp", 0);
_mp = params.getInt("mp", 0); _mp = params.getInt("mp", 0);

View File

@ -181,7 +181,7 @@ public abstract class AbstractInstance extends AbstractNpcAI
template.applyConditionEffects(enterGroup); template.applyConditionEffects(enterGroup);
// Set re-enter for instances with re-enter on start // Set re-enter for instances with re-enter on start
if (instance.getReenterType().equals(InstanceReenterType.ON_ENTER)) if (instance.getReenterType() == InstanceReenterType.ON_ENTER)
{ {
instance.setReenterTime(); instance.setReenterTime();
} }

View File

@ -530,7 +530,7 @@ public final class Q10751_WindsOfFateEncounters extends Quest
final int oldLevel = event.getOldLevel(); final int oldLevel = event.getOldLevel();
final int newLevel = event.getNewLevel(); final int newLevel = event.getNewLevel();
if ((st == null) && (player.getRace().equals(Race.ERTHEIA)) && (oldLevel < newLevel) && (newLevel >= MIN_LEVEL) && (player.isInCategory(CategoryType.FIRST_CLASS_GROUP))) if ((st == null) && (player.getRace() == Race.ERTHEIA) && (oldLevel < newLevel) && (newLevel >= MIN_LEVEL) && (player.isInCategory(CategoryType.FIRST_CLASS_GROUP)))
{ {
showOnScreenMsg(player, NpcStringId.QUEEN_NAVARI_HAS_SENT_A_LETTER_NCLICK_THE_QUESTION_MARK_ICON_TO_READ, ExShowScreenMessage.TOP_CENTER, 10000); showOnScreenMsg(player, NpcStringId.QUEEN_NAVARI_HAS_SENT_A_LETTER_NCLICK_THE_QUESTION_MARK_ICON_TO_READ, ExShowScreenMessage.TOP_CENTER, 10000);
player.sendPacket(new TutorialShowQuestionMark(getId())); player.sendPacket(new TutorialShowQuestionMark(getId()));
@ -549,7 +549,7 @@ public final class Q10751_WindsOfFateEncounters extends Quest
final L2PcInstance player = event.getActiveChar(); final L2PcInstance player = event.getActiveChar();
final QuestState st = getQuestState(player, false); final QuestState st = getQuestState(player, false);
if ((st == null) && player.getRace().equals(Race.ERTHEIA) && (player.getLevel() >= MIN_LEVEL) && (player.isInCategory(CategoryType.FIRST_CLASS_GROUP))) if ((st == null) && player.getRace() == Race.ERTHEIA && (player.getLevel() >= MIN_LEVEL) && (player.isInCategory(CategoryType.FIRST_CLASS_GROUP)))
{ {
showOnScreenMsg(player, NpcStringId.QUEEN_NAVARI_HAS_SENT_A_LETTER_NCLICK_THE_QUESTION_MARK_ICON_TO_READ, ExShowScreenMessage.TOP_CENTER, 10000); showOnScreenMsg(player, NpcStringId.QUEEN_NAVARI_HAS_SENT_A_LETTER_NCLICK_THE_QUESTION_MARK_ICON_TO_READ, ExShowScreenMessage.TOP_CENTER, 10000);
player.sendPacket(new TutorialShowQuestionMark(getId())); player.sendPacket(new TutorialShowQuestionMark(getId()));

View File

@ -548,7 +548,7 @@ public final class Q10752_WindsOfFateAPromise extends Quest
final int oldLevel = event.getOldLevel(); final int oldLevel = event.getOldLevel();
final int newLevel = event.getNewLevel(); final int newLevel = event.getNewLevel();
if ((qs == null) && (player.getRace().equals(Race.ERTHEIA)) && (oldLevel < newLevel) && (newLevel >= MIN_LEVEL) && (player.isInCategory(CategoryType.THIRD_CLASS_GROUP))) if ((qs == null) && (player.getRace() == Race.ERTHEIA) && (oldLevel < newLevel) && (newLevel >= MIN_LEVEL) && (player.isInCategory(CategoryType.THIRD_CLASS_GROUP)))
{ {
if (player.isMageClass()) if (player.isMageClass())
{ {
@ -574,7 +574,7 @@ public final class Q10752_WindsOfFateAPromise extends Quest
final L2PcInstance player = event.getActiveChar(); final L2PcInstance player = event.getActiveChar();
final QuestState qs = getQuestState(player, false); final QuestState qs = getQuestState(player, false);
if ((qs == null) && player.getRace().equals(Race.ERTHEIA) && (player.getLevel() >= MIN_LEVEL) && (player.isInCategory(CategoryType.THIRD_CLASS_GROUP))) if ((qs == null) && player.getRace() == Race.ERTHEIA && (player.getLevel() >= MIN_LEVEL) && (player.isInCategory(CategoryType.THIRD_CLASS_GROUP)))
{ {
if (player.isMageClass()) if (player.isMageClass())
{ {

View File

@ -809,7 +809,7 @@ public final class Q10753_WindsOfFateChoices extends Quest
final int oldLevel = event.getOldLevel(); final int oldLevel = event.getOldLevel();
final int newLevel = event.getNewLevel(); final int newLevel = event.getNewLevel();
if ((qs == null) && (player.getRace().equals(Race.ERTHEIA)) && (oldLevel < newLevel) && (newLevel >= MIN_LEVEL) && (player.isInCategory(CategoryType.FOURTH_CLASS_GROUP))) if ((qs == null) && (player.getRace() == Race.ERTHEIA) && (oldLevel < newLevel) && (newLevel >= MIN_LEVEL) && (player.isInCategory(CategoryType.FOURTH_CLASS_GROUP)))
{ {
if (player.isMageClass()) if (player.isMageClass())
{ {
@ -836,7 +836,7 @@ public final class Q10753_WindsOfFateChoices extends Quest
final L2PcInstance player = event.getActiveChar(); final L2PcInstance player = event.getActiveChar();
final QuestState qs = getQuestState(player, false); final QuestState qs = getQuestState(player, false);
if ((qs == null) && player.getRace().equals(Race.ERTHEIA) && (player.getLevel() >= MIN_LEVEL) && (player.isInCategory(CategoryType.FOURTH_CLASS_GROUP))) if ((qs == null) && player.getRace() == Race.ERTHEIA && (player.getLevel() >= MIN_LEVEL) && (player.isInCategory(CategoryType.FOURTH_CLASS_GROUP)))
{ {
if (player.isMageClass()) if (player.isMageClass())
{ {

View File

@ -718,17 +718,17 @@ public final class CastleManorManager implements IGameXmlReader, IStorable
public final boolean isUnderMaintenance() public final boolean isUnderMaintenance()
{ {
return _mode.equals(ManorMode.MAINTENANCE); return _mode == ManorMode.MAINTENANCE;
} }
public final boolean isManorApproved() public final boolean isManorApproved()
{ {
return _mode.equals(ManorMode.APPROVED); return _mode == ManorMode.APPROVED;
} }
public final boolean isModifiablePeriod() public final boolean isModifiablePeriod()
{ {
return _mode.equals(ManorMode.MODIFIABLE); return _mode == ManorMode.MODIFIABLE;
} }
public final String getCurrentModeName() public final String getCurrentModeName()

View File

@ -417,7 +417,7 @@ public class DBSpawnManager
continue; continue;
} }
if (npc.getDBStatus().equals(DBStatusType.ALIVE)) if (npc.getDBStatus() == DBStatusType.ALIVE)
{ {
updateStatus(npc, false); updateStatus(npc, false);
} }

View File

@ -1149,7 +1149,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
private Attack generateAttackTargetData(L2Character target, L2Weapon weapon, WeaponType weaponType) private Attack generateAttackTargetData(L2Character target, L2Weapon weapon, WeaponType weaponType)
{ {
final boolean isDual = WeaponType.DUAL.equals(weaponType) || WeaponType.DUALBLUNT.equals(weaponType) || WeaponType.DUALDAGGER.equals(weaponType) || WeaponType.DUALFIST.equals(weaponType); final boolean isDual = WeaponType.DUAL == weaponType || WeaponType.DUALBLUNT == weaponType || WeaponType.DUALDAGGER == weaponType || WeaponType.DUALFIST == weaponType;
final Attack attack = new Attack(this, target); final Attack attack = new Attack(this, target);
boolean shotConsumed = false; boolean shotConsumed = false;

View File

@ -240,7 +240,7 @@ public class L2Npc extends L2Character
*/ */
public boolean hasRandomAnimation() public boolean hasRandomAnimation()
{ {
return ((Config.MAX_NPC_ANIMATION > 0) && _isRandomAnimationEnabled && !getAiType().equals(AIType.CORPSE)); return ((Config.MAX_NPC_ANIMATION > 0) && _isRandomAnimationEnabled && getAiType() != AIType.CORPSE);
} }
/** /**
@ -1337,7 +1337,7 @@ public class L2Npc extends L2Character
@Override @Override
public boolean isMovementDisabled() public boolean isMovementDisabled()
{ {
return super.isMovementDisabled() || !getTemplate().canMove() || getAiType().equals(AIType.CORPSE); return super.isMovementDisabled() || !getTemplate().canMove() || getAiType() == AIType.CORPSE;
} }
public AIType getAiType() public AIType getAiType()

View File

@ -878,7 +878,7 @@ public final class Instance implements IIdentifiable, INamable
public void finishInstance(int delay) public void finishInstance(int delay)
{ {
// Set re-enter for players // Set re-enter for players
if (_template.getReenterType().equals(InstanceReenterType.ON_FINISH)) if (_template.getReenterType() == InstanceReenterType.ON_FINISH)
{ {
setReenterTime(); setReenterTime();
} }
@ -941,7 +941,7 @@ public final class Instance implements IIdentifiable, INamable
addPlayer(player); addPlayer(player);
// Set origin return location if enabled // Set origin return location if enabled
if (_template.getExitLocationType().equals(InstanceTeleportType.ORIGIN)) if (_template.getExitLocationType() == InstanceTeleportType.ORIGIN)
{ {
player.getVariables().set("INSTANCE_ORIGIN", player.getX() + ";" + player.getY() + ";" + player.getZ()); player.getVariables().set("INSTANCE_ORIGIN", player.getX() + ";" + player.getY() + ";" + player.getZ());
} }

View File

@ -498,7 +498,7 @@ public class InstanceTemplate extends ListenersContainer implements IIdentifiabl
} }
// Now remove buffs by type // Now remove buffs by type
if (_removeBuffType.equals(InstanceRemoveBuffType.ALL)) if (_removeBuffType == InstanceRemoveBuffType.ALL)
{ {
for (L2Playable playable : affected) for (L2Playable playable : affected)
{ {
@ -635,7 +635,7 @@ public class InstanceTemplate extends ListenersContainer implements IIdentifiabl
// player < party < command channel // player < party < command channel
for (GroupType t : GroupType.values()) for (GroupType t : GroupType.values())
{ {
if (!t.equals(playerGroup) && groupMaskContains(t)) if (t != playerGroup && groupMaskContains(t))
{ {
return t; return t;
} }
@ -663,11 +663,11 @@ public class InstanceTemplate extends ListenersContainer implements IIdentifiabl
// Check if player has group in which he can enter // Check if player has group in which he can enter
AbstractPlayerGroup pGroup = null; AbstractPlayerGroup pGroup = null;
if (type.equals(GroupType.PARTY)) if (type == GroupType.PARTY)
{ {
pGroup = player.getParty(); pGroup = player.getParty();
} }
else if (type.equals(GroupType.COMMAND_CHANNEL)) else if (type == GroupType.COMMAND_CHANNEL)
{ {
pGroup = player.getCommandChannel(); pGroup = player.getCommandChannel();
} }

View File

@ -70,7 +70,7 @@ public interface ILocational
*/ */
default boolean isInFrontOf(ILocational target) default boolean isInFrontOf(ILocational target)
{ {
return Position.FRONT.equals(Position.getPosition(this, target)); return Position.FRONT == Position.getPosition(this, target);
} }
/** /**
@ -79,7 +79,7 @@ public interface ILocational
*/ */
default boolean isOnSideOf(ILocational target) default boolean isOnSideOf(ILocational target)
{ {
return Position.SIDE.equals(Position.getPosition(this, target)); return Position.SIDE == Position.getPosition(this, target);
} }
/** /**
@ -88,6 +88,6 @@ public interface ILocational
*/ */
default boolean isBehind(ILocational target) default boolean isBehind(ILocational target)
{ {
return Position.BACK.equals(Position.getPosition(this, target)); return Position.BACK == Position.getPosition(this, target);
} }
} }

View File

@ -237,7 +237,7 @@ public class PunishmentTask implements Runnable
} }
} }
if (_type.equals(PunishmentType.CHAT_BAN) && _affect.equals(PunishmentAffect.CHARACTER)) if (_type == PunishmentType.CHAT_BAN && _affect == PunishmentAffect.CHARACTER)
{ {
final L2PcInstance player = L2World.getInstance().getPlayer(Integer.valueOf(_key)); final L2PcInstance player = L2World.getInstance().getPlayer(Integer.valueOf(_key));
if (player != null) if (player != null)

View File

@ -455,6 +455,6 @@ public final class BuffInfo
public boolean isAbnormalType(AbnormalType type) public boolean isAbnormalType(AbnormalType type)
{ {
return _skill.getAbnormalType().equals(type); return _skill.getAbnormalType() == type;
} }
} }

View File

@ -118,7 +118,7 @@ public interface IStatsFunction
(bodypart == L2Item.SLOT_HAIRALL)) (bodypart == L2Item.SLOT_HAIRALL))
{ {
// TODO: Item after enchant shows pDef, but scroll says mDef increase. // TODO: Item after enchant shows pDef, but scroll says mDef increase.
if (!stat.equals(Stats.PHYSICAL_DEFENCE) && !stat.equals(Stats.MAGICAL_DEFENCE)) if (stat != Stats.PHYSICAL_DEFENCE && stat != Stats.MAGICAL_DEFENCE)
{ {
continue; continue;
} }

View File

@ -75,7 +75,7 @@ public final class TeleportHolder
*/ */
public boolean isNoblesse() public boolean isNoblesse()
{ {
return _type.equals(TeleportType.NOBLES_ADENA) || _type.equals(TeleportType.NOBLES_TOKEN); return _type == TeleportType.NOBLES_ADENA || _type == TeleportType.NOBLES_TOKEN;
} }
/** /**

View File

@ -53,7 +53,7 @@ public final class AvantGarde extends AbstractNpcAI
@Override @Override
public String onAcquireSkill(L2Npc npc, L2PcInstance player, Skill skill, AcquireSkillType type) public String onAcquireSkill(L2Npc npc, L2PcInstance player, Skill skill, AcquireSkillType type)
{ {
if (type.equals(AcquireSkillType.TRANSFORM)) if (type == AcquireSkillType.TRANSFORM)
{ {
showTransformSkillList(player); showTransformSkillList(player);
} }

View File

@ -75,7 +75,7 @@ public final class OrcBarracks extends AbstractNpcAI
@Override @Override
public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon) public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon)
{ {
if (killer.getRace().equals(Race.ERTHEIA) && (SPAWN_RATE > getRandom(100))) if (killer.getRace() == Race.ERTHEIA && (SPAWN_RATE > getRandom(100)))
{ {
final int npcId = (killer.isMageClass()) ? CHERTUBA_ILLUSION : CHERTUBA_MIRAGE; final int npcId = (killer.isMageClass()) ? CHERTUBA_ILLUSION : CHERTUBA_MIRAGE;
showOnScreenMsg(killer, NpcStringId.A_POWERFUL_MONSTER_HAS_COME_TO_FACE_YOU, ExShowScreenMessage.TOP_CENTER, 5000); showOnScreenMsg(killer, NpcStringId.A_POWERFUL_MONSTER_HAS_COME_TO_FACE_YOU, ExShowScreenMessage.TOP_CENTER, 5000);

View File

@ -206,7 +206,7 @@ public final class AwakeningMaster extends AbstractNpcAI
@Override @Override
public String onFirstTalk(L2Npc npc, L2PcInstance player) public String onFirstTalk(L2Npc npc, L2PcInstance player)
{ {
if (player.getRace().equals(Race.ERTHEIA)) if (player.getRace() == Race.ERTHEIA)
{ {
// Ertheia dual class quest // Ertheia dual class quest
final QuestState qs = player.getQuestState(Q10472_WindsOfFateEncroachingShadows.class.getSimpleName()); final QuestState qs = player.getQuestState(Q10472_WindsOfFateEncroachingShadows.class.getSimpleName());

View File

@ -98,11 +98,11 @@ public final class Hardin extends AbstractNpcAI
} }
if (Config.HARDIN_RETAIL_LIMITATIONS) if (Config.HARDIN_RETAIL_LIMITATIONS)
{ {
if (c.equals(ClassId.TYRR_MAESTRO) && (player.getRace() != Race.DWARF)) if (c == ClassId.TYRR_MAESTRO && (player.getRace() != Race.DWARF))
{ {
continue; continue;
} }
if (c.equals(ClassId.ISS_DOMINATOR) && (player.getRace() != Race.ORC)) if (c == ClassId.ISS_DOMINATOR && (player.getRace() != Race.ORC))
{ {
continue; continue;
} }
@ -171,7 +171,7 @@ public final class Hardin extends AbstractNpcAI
private String getHtmlMessage(L2PcInstance player) private String getHtmlMessage(L2PcInstance player)
{ {
if (player.getRace().equals(Race.ERTHEIA)) if (player.getRace() == Race.ERTHEIA)
{ {
final QuestState qs = player.getQuestState(Q10472_WindsOfFateEncroachingShadows.class.getSimpleName()); final QuestState qs = player.getQuestState(Q10472_WindsOfFateEncroachingShadows.class.getSimpleName());
if ((qs != null) && (qs.getCond() >= 7) && (qs.getCond() <= 17)) if ((qs != null) && (qs.getCond() >= 7) && (qs.getCond() <= 17))

View File

@ -88,7 +88,7 @@ public final class Trandon extends AbstractNpcAI
} }
case "33490-12.html": case "33490-12.html":
{ {
if (player.getRace().equals(Race.ERTHEIA) || hasAllSubCertifications(player)) if (player.getRace() == Race.ERTHEIA || hasAllSubCertifications(player))
{ {
htmltext = "33490-15.html"; htmltext = "33490-15.html";
} }
@ -134,7 +134,7 @@ public final class Trandon extends AbstractNpcAI
} }
case "giveSubCertify": case "giveSubCertify":
{ {
if ((substrings.length < 2) || !player.isSubClassActive() || player.getRace().equals(Race.ERTHEIA)) if ((substrings.length < 2) || !player.isSubClassActive() || player.getRace() == Race.ERTHEIA)
{ {
return null; return null;
} }
@ -161,7 +161,7 @@ public final class Trandon extends AbstractNpcAI
} }
case "learnSubSkill": case "learnSubSkill":
{ {
if (player.getRace().equals(Race.ERTHEIA)) if (player.getRace() == Race.ERTHEIA)
{ {
htmltext = "33490-15.html"; htmltext = "33490-15.html";
} }
@ -178,7 +178,8 @@ public final class Trandon extends AbstractNpcAI
} }
case "deleteSubSkill": case "deleteSubSkill":
{ {
if (player.getRace().equals(Race.ERTHEIA)) // TODO: Unknown html
if (player.getRace() == Race.ERTHEIA)
{ {
htmltext = "33490-15.html"; htmltext = "33490-15.html";
} }

View File

@ -46,7 +46,7 @@ public final class WindVortex extends AbstractNpcAI
if (npc.isScriptValue(0) && !npc.isDead()) if (npc.isScriptValue(0) && !npc.isDead())
{ {
npc.setScriptValue(1); npc.setScriptValue(1);
if (attacker.getRace().equals(Race.ERTHEIA)) if (attacker.getRace() == Race.ERTHEIA)
{ {
final int npcId = (attacker.isMageClass()) ? IMMENSE_WINDIMA : GIANT_WINDIMA; final int npcId = (attacker.isMageClass()) ? IMMENSE_WINDIMA : GIANT_WINDIMA;
showOnScreenMsg(attacker, NpcStringId.A_POWERFUL_MONSTER_HAS_COME_TO_FACE_YOU, ExShowScreenMessage.TOP_CENTER, 5000); showOnScreenMsg(attacker, NpcStringId.A_POWERFUL_MONSTER_HAS_COME_TO_FACE_YOU, ExShowScreenMessage.TOP_CENTER, 5000);

View File

@ -384,7 +384,7 @@ public class AdminEditChar implements IAdminCommandHandler
} }
// Sex checks. // Sex checks.
if (player.getRace().equals(Race.KAMAEL)) if (player.getRace() == Race.KAMAEL)
{ {
switch (classidval) switch (classidval)
{ {
@ -418,7 +418,7 @@ public class AdminEditChar implements IAdminCommandHandler
} }
} }
} }
if (player.getRace().equals(Race.ERTHEIA)) if (player.getRace() == Race.ERTHEIA)
{ {
player.getAppearance().setSex(true); player.getAppearance().setSex(true);
} }

View File

@ -46,7 +46,7 @@ public final class ModifyVital extends AbstractEffect
public ModifyVital(StatsSet params) public ModifyVital(StatsSet params)
{ {
_type = params.getEnum("type", ModifyType.class); _type = params.getEnum("type", ModifyType.class);
if (!_type.equals(ModifyType.SET)) if (_type != ModifyType.SET)
{ {
_hp = params.getInt("hp", 0); _hp = params.getInt("hp", 0);
_mp = params.getInt("mp", 0); _mp = params.getInt("mp", 0);

View File

@ -181,7 +181,7 @@ public abstract class AbstractInstance extends AbstractNpcAI
template.applyConditionEffects(enterGroup); template.applyConditionEffects(enterGroup);
// Set re-enter for instances with re-enter on start // Set re-enter for instances with re-enter on start
if (instance.getReenterType().equals(InstanceReenterType.ON_ENTER)) if (instance.getReenterType() == InstanceReenterType.ON_ENTER)
{ {
instance.setReenterTime(); instance.setReenterTime();
} }

View File

@ -546,7 +546,7 @@ public final class Q10751_WindsOfFateEncounters extends Quest
final int oldLevel = event.getOldLevel(); final int oldLevel = event.getOldLevel();
final int newLevel = event.getNewLevel(); final int newLevel = event.getNewLevel();
if ((st == null) && (player.getRace().equals(Race.ERTHEIA)) && (oldLevel < newLevel) && (newLevel >= MIN_LEVEL) && (player.isInCategory(CategoryType.FIRST_CLASS_GROUP))) if ((st == null) && (player.getRace() == Race.ERTHEIA) && (oldLevel < newLevel) && (newLevel >= MIN_LEVEL) && (player.isInCategory(CategoryType.FIRST_CLASS_GROUP)))
{ {
showOnScreenMsg(player, NpcStringId.QUEEN_NAVARI_HAS_SENT_A_LETTER_NCLICK_THE_QUESTION_MARK_ICON_TO_READ, ExShowScreenMessage.TOP_CENTER, 10000); showOnScreenMsg(player, NpcStringId.QUEEN_NAVARI_HAS_SENT_A_LETTER_NCLICK_THE_QUESTION_MARK_ICON_TO_READ, ExShowScreenMessage.TOP_CENTER, 10000);
player.sendPacket(new TutorialShowQuestionMark(getId(), 1)); player.sendPacket(new TutorialShowQuestionMark(getId(), 1));
@ -565,7 +565,7 @@ public final class Q10751_WindsOfFateEncounters extends Quest
final L2PcInstance player = event.getActiveChar(); final L2PcInstance player = event.getActiveChar();
final QuestState st = getQuestState(player, false); final QuestState st = getQuestState(player, false);
if ((st == null) && player.getRace().equals(Race.ERTHEIA) && (player.getLevel() >= MIN_LEVEL) && (player.isInCategory(CategoryType.FIRST_CLASS_GROUP))) if ((st == null) && player.getRace() == Race.ERTHEIA && (player.getLevel() >= MIN_LEVEL) && (player.isInCategory(CategoryType.FIRST_CLASS_GROUP)))
{ {
showOnScreenMsg(player, NpcStringId.QUEEN_NAVARI_HAS_SENT_A_LETTER_NCLICK_THE_QUESTION_MARK_ICON_TO_READ, ExShowScreenMessage.TOP_CENTER, 10000); showOnScreenMsg(player, NpcStringId.QUEEN_NAVARI_HAS_SENT_A_LETTER_NCLICK_THE_QUESTION_MARK_ICON_TO_READ, ExShowScreenMessage.TOP_CENTER, 10000);
player.sendPacket(new TutorialShowQuestionMark(getId(), 1)); player.sendPacket(new TutorialShowQuestionMark(getId(), 1));

View File

@ -548,7 +548,7 @@ public final class Q10752_WindsOfFateAPromise extends Quest
final int oldLevel = event.getOldLevel(); final int oldLevel = event.getOldLevel();
final int newLevel = event.getNewLevel(); final int newLevel = event.getNewLevel();
if ((qs == null) && (player.getRace().equals(Race.ERTHEIA)) && (oldLevel < newLevel) && (newLevel >= MIN_LEVEL) && (player.isInCategory(CategoryType.THIRD_CLASS_GROUP))) if ((qs == null) && (player.getRace() == Race.ERTHEIA) && (oldLevel < newLevel) && (newLevel >= MIN_LEVEL) && (player.isInCategory(CategoryType.THIRD_CLASS_GROUP)))
{ {
if (player.isMageClass()) if (player.isMageClass())
{ {
@ -574,7 +574,7 @@ public final class Q10752_WindsOfFateAPromise extends Quest
final L2PcInstance player = event.getActiveChar(); final L2PcInstance player = event.getActiveChar();
final QuestState qs = getQuestState(player, false); final QuestState qs = getQuestState(player, false);
if ((qs == null) && player.getRace().equals(Race.ERTHEIA) && (player.getLevel() >= MIN_LEVEL) && (player.isInCategory(CategoryType.THIRD_CLASS_GROUP))) if ((qs == null) && player.getRace() == Race.ERTHEIA && (player.getLevel() >= MIN_LEVEL) && (player.isInCategory(CategoryType.THIRD_CLASS_GROUP)))
{ {
if (player.isMageClass()) if (player.isMageClass())
{ {

View File

@ -809,7 +809,7 @@ public final class Q10753_WindsOfFateChoices extends Quest
final int oldLevel = event.getOldLevel(); final int oldLevel = event.getOldLevel();
final int newLevel = event.getNewLevel(); final int newLevel = event.getNewLevel();
if ((qs == null) && (player.getRace().equals(Race.ERTHEIA)) && (oldLevel < newLevel) && (newLevel >= MIN_LEVEL) && (player.isInCategory(CategoryType.FOURTH_CLASS_GROUP))) if ((qs == null) && (player.getRace() == Race.ERTHEIA) && (oldLevel < newLevel) && (newLevel >= MIN_LEVEL) && (player.isInCategory(CategoryType.FOURTH_CLASS_GROUP)))
{ {
if (player.isMageClass()) if (player.isMageClass())
{ {
@ -836,7 +836,7 @@ public final class Q10753_WindsOfFateChoices extends Quest
final L2PcInstance player = event.getActiveChar(); final L2PcInstance player = event.getActiveChar();
final QuestState qs = getQuestState(player, false); final QuestState qs = getQuestState(player, false);
if ((qs == null) && player.getRace().equals(Race.ERTHEIA) && (player.getLevel() >= MIN_LEVEL) && (player.isInCategory(CategoryType.FOURTH_CLASS_GROUP))) if ((qs == null) && player.getRace() == Race.ERTHEIA && (player.getLevel() >= MIN_LEVEL) && (player.isInCategory(CategoryType.FOURTH_CLASS_GROUP)))
{ {
if (player.isMageClass()) if (player.isMageClass())
{ {

View File

@ -718,17 +718,17 @@ public final class CastleManorManager implements IGameXmlReader, IStorable
public final boolean isUnderMaintenance() public final boolean isUnderMaintenance()
{ {
return _mode.equals(ManorMode.MAINTENANCE); return _mode == ManorMode.MAINTENANCE;
} }
public final boolean isManorApproved() public final boolean isManorApproved()
{ {
return _mode.equals(ManorMode.APPROVED); return _mode == ManorMode.APPROVED;
} }
public final boolean isModifiablePeriod() public final boolean isModifiablePeriod()
{ {
return _mode.equals(ManorMode.MODIFIABLE); return _mode == ManorMode.MODIFIABLE;
} }
public final String getCurrentModeName() public final String getCurrentModeName()

View File

@ -417,7 +417,7 @@ public class DBSpawnManager
continue; continue;
} }
if (npc.getDBStatus().equals(DBStatusType.ALIVE)) if (npc.getDBStatus() == DBStatusType.ALIVE)
{ {
updateStatus(npc, false); updateStatus(npc, false);
} }

View File

@ -1149,7 +1149,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
private Attack generateAttackTargetData(L2Character target, L2Weapon weapon, WeaponType weaponType) private Attack generateAttackTargetData(L2Character target, L2Weapon weapon, WeaponType weaponType)
{ {
final boolean isDual = WeaponType.DUAL.equals(weaponType) || WeaponType.DUALBLUNT.equals(weaponType) || WeaponType.DUALDAGGER.equals(weaponType) || WeaponType.DUALFIST.equals(weaponType); final boolean isDual = WeaponType.DUAL == weaponType || WeaponType.DUALBLUNT == weaponType || WeaponType.DUALDAGGER == weaponType || WeaponType.DUALFIST == weaponType;
final Attack attack = new Attack(this, target); final Attack attack = new Attack(this, target);
boolean shotConsumed = false; boolean shotConsumed = false;

View File

@ -240,7 +240,7 @@ public class L2Npc extends L2Character
*/ */
public boolean hasRandomAnimation() public boolean hasRandomAnimation()
{ {
return ((Config.MAX_NPC_ANIMATION > 0) && _isRandomAnimationEnabled && !getAiType().equals(AIType.CORPSE)); return ((Config.MAX_NPC_ANIMATION > 0) && _isRandomAnimationEnabled && getAiType() != AIType.CORPSE);
} }
/** /**
@ -1337,7 +1337,7 @@ public class L2Npc extends L2Character
@Override @Override
public boolean isMovementDisabled() public boolean isMovementDisabled()
{ {
return super.isMovementDisabled() || !getTemplate().canMove() || getAiType().equals(AIType.CORPSE); return super.isMovementDisabled() || !getTemplate().canMove() || getAiType() == AIType.CORPSE;
} }
public AIType getAiType() public AIType getAiType()

View File

@ -878,7 +878,7 @@ public final class Instance implements IIdentifiable, INamable
public void finishInstance(int delay) public void finishInstance(int delay)
{ {
// Set re-enter for players // Set re-enter for players
if (_template.getReenterType().equals(InstanceReenterType.ON_FINISH)) if (_template.getReenterType() == InstanceReenterType.ON_FINISH)
{ {
setReenterTime(); setReenterTime();
} }
@ -941,7 +941,7 @@ public final class Instance implements IIdentifiable, INamable
addPlayer(player); addPlayer(player);
// Set origin return location if enabled // Set origin return location if enabled
if (_template.getExitLocationType().equals(InstanceTeleportType.ORIGIN)) if (_template.getExitLocationType() == InstanceTeleportType.ORIGIN)
{ {
player.getVariables().set("INSTANCE_ORIGIN", player.getX() + ";" + player.getY() + ";" + player.getZ()); player.getVariables().set("INSTANCE_ORIGIN", player.getX() + ";" + player.getY() + ";" + player.getZ());
} }

View File

@ -498,7 +498,7 @@ public class InstanceTemplate extends ListenersContainer implements IIdentifiabl
} }
// Now remove buffs by type // Now remove buffs by type
if (_removeBuffType.equals(InstanceRemoveBuffType.ALL)) if (_removeBuffType == InstanceRemoveBuffType.ALL)
{ {
for (L2Playable playable : affected) for (L2Playable playable : affected)
{ {
@ -635,7 +635,7 @@ public class InstanceTemplate extends ListenersContainer implements IIdentifiabl
// player < party < command channel // player < party < command channel
for (GroupType t : GroupType.values()) for (GroupType t : GroupType.values())
{ {
if (!t.equals(playerGroup) && groupMaskContains(t)) if (t != playerGroup && groupMaskContains(t))
{ {
return t; return t;
} }
@ -663,11 +663,11 @@ public class InstanceTemplate extends ListenersContainer implements IIdentifiabl
// Check if player has group in which he can enter // Check if player has group in which he can enter
AbstractPlayerGroup pGroup = null; AbstractPlayerGroup pGroup = null;
if (type.equals(GroupType.PARTY)) if (type == GroupType.PARTY)
{ {
pGroup = player.getParty(); pGroup = player.getParty();
} }
else if (type.equals(GroupType.COMMAND_CHANNEL)) else if (type == GroupType.COMMAND_CHANNEL)
{ {
pGroup = player.getCommandChannel(); pGroup = player.getCommandChannel();
} }

View File

@ -70,7 +70,7 @@ public interface ILocational
*/ */
default boolean isInFrontOf(ILocational target) default boolean isInFrontOf(ILocational target)
{ {
return Position.FRONT.equals(Position.getPosition(this, target)); return Position.FRONT == Position.getPosition(this, target);
} }
/** /**
@ -79,7 +79,7 @@ public interface ILocational
*/ */
default boolean isOnSideOf(ILocational target) default boolean isOnSideOf(ILocational target)
{ {
return Position.SIDE.equals(Position.getPosition(this, target)); return Position.SIDE == Position.getPosition(this, target);
} }
/** /**
@ -88,6 +88,6 @@ public interface ILocational
*/ */
default boolean isBehind(ILocational target) default boolean isBehind(ILocational target)
{ {
return Position.BACK.equals(Position.getPosition(this, target)); return Position.BACK == Position.getPosition(this, target);
} }
} }

View File

@ -237,7 +237,7 @@ public class PunishmentTask implements Runnable
} }
} }
if (_type.equals(PunishmentType.CHAT_BAN) && _affect.equals(PunishmentAffect.CHARACTER)) if (_type == PunishmentType.CHAT_BAN && _affect == PunishmentAffect.CHARACTER)
{ {
final L2PcInstance player = L2World.getInstance().getPlayer(Integer.valueOf(_key)); final L2PcInstance player = L2World.getInstance().getPlayer(Integer.valueOf(_key));
if (player != null) if (player != null)

View File

@ -455,6 +455,6 @@ public final class BuffInfo
public boolean isAbnormalType(AbnormalType type) public boolean isAbnormalType(AbnormalType type)
{ {
return _skill.getAbnormalType().equals(type); return _skill.getAbnormalType() == type;
} }
} }

View File

@ -118,7 +118,7 @@ public interface IStatsFunction
(bodypart == L2Item.SLOT_HAIRALL)) (bodypart == L2Item.SLOT_HAIRALL))
{ {
// TODO: Item after enchant shows pDef, but scroll says mDef increase. // TODO: Item after enchant shows pDef, but scroll says mDef increase.
if (!stat.equals(Stats.PHYSICAL_DEFENCE) && !stat.equals(Stats.MAGICAL_DEFENCE)) if (stat != Stats.PHYSICAL_DEFENCE && stat != Stats.MAGICAL_DEFENCE)
{ {
continue; continue;
} }

View File

@ -75,7 +75,7 @@ public final class TeleportHolder
*/ */
public boolean isNoblesse() public boolean isNoblesse()
{ {
return _type.equals(TeleportType.NOBLES_ADENA) || _type.equals(TeleportType.NOBLES_TOKEN); return _type == TeleportType.NOBLES_ADENA || _type == TeleportType.NOBLES_TOKEN;
} }
/** /**

View File

@ -53,7 +53,7 @@ public final class AvantGarde extends AbstractNpcAI
@Override @Override
public String onAcquireSkill(L2Npc npc, L2PcInstance player, Skill skill, AcquireSkillType type) public String onAcquireSkill(L2Npc npc, L2PcInstance player, Skill skill, AcquireSkillType type)
{ {
if (type.equals(AcquireSkillType.TRANSFORM)) if (type == AcquireSkillType.TRANSFORM)
{ {
showTransformSkillList(player); showTransformSkillList(player);
} }

View File

@ -75,7 +75,7 @@ public final class OrcBarracks extends AbstractNpcAI
@Override @Override
public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon) public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon)
{ {
if (killer.getRace().equals(Race.ERTHEIA) && (SPAWN_RATE > getRandom(100))) if (killer.getRace() == Race.ERTHEIA && (SPAWN_RATE > getRandom(100)))
{ {
final int npcId = (killer.isMageClass()) ? CHERTUBA_ILLUSION : CHERTUBA_MIRAGE; final int npcId = (killer.isMageClass()) ? CHERTUBA_ILLUSION : CHERTUBA_MIRAGE;
showOnScreenMsg(killer, NpcStringId.A_POWERFUL_MONSTER_HAS_COME_TO_FACE_YOU, ExShowScreenMessage.TOP_CENTER, 5000); showOnScreenMsg(killer, NpcStringId.A_POWERFUL_MONSTER_HAS_COME_TO_FACE_YOU, ExShowScreenMessage.TOP_CENTER, 5000);

View File

@ -206,7 +206,7 @@ public final class AwakeningMaster extends AbstractNpcAI
@Override @Override
public String onFirstTalk(L2Npc npc, L2PcInstance player) public String onFirstTalk(L2Npc npc, L2PcInstance player)
{ {
if (player.getRace().equals(Race.ERTHEIA)) if (player.getRace() == Race.ERTHEIA)
{ {
// Ertheia dual class quest // Ertheia dual class quest
final QuestState qs = player.getQuestState(Q10472_WindsOfFateEncroachingShadows.class.getSimpleName()); final QuestState qs = player.getQuestState(Q10472_WindsOfFateEncroachingShadows.class.getSimpleName());

View File

@ -98,11 +98,11 @@ public final class Hardin extends AbstractNpcAI
} }
if (Config.HARDIN_RETAIL_LIMITATIONS) if (Config.HARDIN_RETAIL_LIMITATIONS)
{ {
if (c.equals(ClassId.TYRR_MAESTRO) && (player.getRace() != Race.DWARF)) if (c == ClassId.TYRR_MAESTRO && (player.getRace() != Race.DWARF))
{ {
continue; continue;
} }
if (c.equals(ClassId.ISS_DOMINATOR) && (player.getRace() != Race.ORC)) if (c == ClassId.ISS_DOMINATOR && (player.getRace() != Race.ORC))
{ {
continue; continue;
} }
@ -171,7 +171,7 @@ public final class Hardin extends AbstractNpcAI
private String getHtmlMessage(L2PcInstance player) private String getHtmlMessage(L2PcInstance player)
{ {
if (player.getRace().equals(Race.ERTHEIA)) if (player.getRace() == Race.ERTHEIA)
{ {
final QuestState qs = player.getQuestState(Q10472_WindsOfFateEncroachingShadows.class.getSimpleName()); final QuestState qs = player.getQuestState(Q10472_WindsOfFateEncroachingShadows.class.getSimpleName());
if ((qs != null) && (qs.getCond() >= 7) && (qs.getCond() <= 17)) if ((qs != null) && (qs.getCond() >= 7) && (qs.getCond() <= 17))

View File

@ -88,7 +88,7 @@ public final class Trandon extends AbstractNpcAI
} }
case "33490-12.html": case "33490-12.html":
{ {
if (player.getRace().equals(Race.ERTHEIA) || hasAllSubCertifications(player)) if (player.getRace() == Race.ERTHEIA || hasAllSubCertifications(player))
{ {
htmltext = "33490-15.html"; htmltext = "33490-15.html";
} }
@ -134,7 +134,7 @@ public final class Trandon extends AbstractNpcAI
} }
case "giveSubCertify": case "giveSubCertify":
{ {
if ((substrings.length < 2) || !player.isSubClassActive() || player.getRace().equals(Race.ERTHEIA)) if ((substrings.length < 2) || !player.isSubClassActive() || player.getRace() == Race.ERTHEIA)
{ {
return null; return null;
} }
@ -161,7 +161,7 @@ public final class Trandon extends AbstractNpcAI
} }
case "learnSubSkill": case "learnSubSkill":
{ {
if (player.getRace().equals(Race.ERTHEIA)) if (player.getRace() == Race.ERTHEIA)
{ {
htmltext = "33490-15.html"; htmltext = "33490-15.html";
} }
@ -178,7 +178,8 @@ public final class Trandon extends AbstractNpcAI
} }
case "deleteSubSkill": case "deleteSubSkill":
{ {
if (player.getRace().equals(Race.ERTHEIA)) // TODO: Unknown html
if (player.getRace() == Race.ERTHEIA)
{ {
htmltext = "33490-15.html"; htmltext = "33490-15.html";
} }

View File

@ -46,7 +46,7 @@ public final class WindVortex extends AbstractNpcAI
if (npc.isScriptValue(0) && !npc.isDead()) if (npc.isScriptValue(0) && !npc.isDead())
{ {
npc.setScriptValue(1); npc.setScriptValue(1);
if (attacker.getRace().equals(Race.ERTHEIA)) if (attacker.getRace() == Race.ERTHEIA)
{ {
final int npcId = (attacker.isMageClass()) ? IMMENSE_WINDIMA : GIANT_WINDIMA; final int npcId = (attacker.isMageClass()) ? IMMENSE_WINDIMA : GIANT_WINDIMA;
showOnScreenMsg(attacker, NpcStringId.A_POWERFUL_MONSTER_HAS_COME_TO_FACE_YOU, ExShowScreenMessage.TOP_CENTER, 5000); showOnScreenMsg(attacker, NpcStringId.A_POWERFUL_MONSTER_HAS_COME_TO_FACE_YOU, ExShowScreenMessage.TOP_CENTER, 5000);

View File

@ -384,7 +384,7 @@ public class AdminEditChar implements IAdminCommandHandler
} }
// Sex checks. // Sex checks.
if (player.getRace().equals(Race.KAMAEL)) if (player.getRace() == Race.KAMAEL)
{ {
switch (classidval) switch (classidval)
{ {
@ -418,7 +418,7 @@ public class AdminEditChar implements IAdminCommandHandler
} }
} }
} }
if (player.getRace().equals(Race.ERTHEIA)) if (player.getRace() == Race.ERTHEIA)
{ {
player.getAppearance().setSex(true); player.getAppearance().setSex(true);
} }

View File

@ -46,7 +46,7 @@ public final class ModifyVital extends AbstractEffect
public ModifyVital(StatsSet params) public ModifyVital(StatsSet params)
{ {
_type = params.getEnum("type", ModifyType.class); _type = params.getEnum("type", ModifyType.class);
if (!_type.equals(ModifyType.SET)) if (_type != ModifyType.SET)
{ {
_hp = params.getInt("hp", 0); _hp = params.getInt("hp", 0);
_mp = params.getInt("mp", 0); _mp = params.getInt("mp", 0);

View File

@ -181,7 +181,7 @@ public abstract class AbstractInstance extends AbstractNpcAI
template.applyConditionEffects(enterGroup); template.applyConditionEffects(enterGroup);
// Set re-enter for instances with re-enter on start // Set re-enter for instances with re-enter on start
if (instance.getReenterType().equals(InstanceReenterType.ON_ENTER)) if (instance.getReenterType() == InstanceReenterType.ON_ENTER)
{ {
instance.setReenterTime(); instance.setReenterTime();
} }

View File

@ -546,7 +546,7 @@ public final class Q10751_WindsOfFateEncounters extends Quest
final int oldLevel = event.getOldLevel(); final int oldLevel = event.getOldLevel();
final int newLevel = event.getNewLevel(); final int newLevel = event.getNewLevel();
if ((st == null) && (player.getRace().equals(Race.ERTHEIA)) && (oldLevel < newLevel) && (newLevel >= MIN_LEVEL) && (player.isInCategory(CategoryType.FIRST_CLASS_GROUP))) if ((st == null) && (player.getRace() == Race.ERTHEIA) && (oldLevel < newLevel) && (newLevel >= MIN_LEVEL) && (player.isInCategory(CategoryType.FIRST_CLASS_GROUP)))
{ {
showOnScreenMsg(player, NpcStringId.QUEEN_NAVARI_HAS_SENT_A_LETTER_NCLICK_THE_QUESTION_MARK_ICON_TO_READ, ExShowScreenMessage.TOP_CENTER, 10000); showOnScreenMsg(player, NpcStringId.QUEEN_NAVARI_HAS_SENT_A_LETTER_NCLICK_THE_QUESTION_MARK_ICON_TO_READ, ExShowScreenMessage.TOP_CENTER, 10000);
player.sendPacket(new TutorialShowQuestionMark(getId(), 1)); player.sendPacket(new TutorialShowQuestionMark(getId(), 1));
@ -565,7 +565,7 @@ public final class Q10751_WindsOfFateEncounters extends Quest
final L2PcInstance player = event.getActiveChar(); final L2PcInstance player = event.getActiveChar();
final QuestState st = getQuestState(player, false); final QuestState st = getQuestState(player, false);
if ((st == null) && player.getRace().equals(Race.ERTHEIA) && (player.getLevel() >= MIN_LEVEL) && (player.isInCategory(CategoryType.FIRST_CLASS_GROUP))) if ((st == null) && player.getRace() == Race.ERTHEIA && (player.getLevel() >= MIN_LEVEL) && (player.isInCategory(CategoryType.FIRST_CLASS_GROUP)))
{ {
showOnScreenMsg(player, NpcStringId.QUEEN_NAVARI_HAS_SENT_A_LETTER_NCLICK_THE_QUESTION_MARK_ICON_TO_READ, ExShowScreenMessage.TOP_CENTER, 10000); showOnScreenMsg(player, NpcStringId.QUEEN_NAVARI_HAS_SENT_A_LETTER_NCLICK_THE_QUESTION_MARK_ICON_TO_READ, ExShowScreenMessage.TOP_CENTER, 10000);
player.sendPacket(new TutorialShowQuestionMark(getId(), 1)); player.sendPacket(new TutorialShowQuestionMark(getId(), 1));

View File

@ -548,7 +548,7 @@ public final class Q10752_WindsOfFateAPromise extends Quest
final int oldLevel = event.getOldLevel(); final int oldLevel = event.getOldLevel();
final int newLevel = event.getNewLevel(); final int newLevel = event.getNewLevel();
if ((qs == null) && (player.getRace().equals(Race.ERTHEIA)) && (oldLevel < newLevel) && (newLevel >= MIN_LEVEL) && (player.isInCategory(CategoryType.THIRD_CLASS_GROUP))) if ((qs == null) && (player.getRace() == Race.ERTHEIA) && (oldLevel < newLevel) && (newLevel >= MIN_LEVEL) && (player.isInCategory(CategoryType.THIRD_CLASS_GROUP)))
{ {
if (player.isMageClass()) if (player.isMageClass())
{ {
@ -574,7 +574,7 @@ public final class Q10752_WindsOfFateAPromise extends Quest
final L2PcInstance player = event.getActiveChar(); final L2PcInstance player = event.getActiveChar();
final QuestState qs = getQuestState(player, false); final QuestState qs = getQuestState(player, false);
if ((qs == null) && player.getRace().equals(Race.ERTHEIA) && (player.getLevel() >= MIN_LEVEL) && (player.isInCategory(CategoryType.THIRD_CLASS_GROUP))) if ((qs == null) && player.getRace() == Race.ERTHEIA && (player.getLevel() >= MIN_LEVEL) && (player.isInCategory(CategoryType.THIRD_CLASS_GROUP)))
{ {
if (player.isMageClass()) if (player.isMageClass())
{ {

View File

@ -809,7 +809,7 @@ public final class Q10753_WindsOfFateChoices extends Quest
final int oldLevel = event.getOldLevel(); final int oldLevel = event.getOldLevel();
final int newLevel = event.getNewLevel(); final int newLevel = event.getNewLevel();
if ((qs == null) && (player.getRace().equals(Race.ERTHEIA)) && (oldLevel < newLevel) && (newLevel >= MIN_LEVEL) && (player.isInCategory(CategoryType.FOURTH_CLASS_GROUP))) if ((qs == null) && (player.getRace() == Race.ERTHEIA) && (oldLevel < newLevel) && (newLevel >= MIN_LEVEL) && (player.isInCategory(CategoryType.FOURTH_CLASS_GROUP)))
{ {
if (player.isMageClass()) if (player.isMageClass())
{ {
@ -836,7 +836,7 @@ public final class Q10753_WindsOfFateChoices extends Quest
final L2PcInstance player = event.getActiveChar(); final L2PcInstance player = event.getActiveChar();
final QuestState qs = getQuestState(player, false); final QuestState qs = getQuestState(player, false);
if ((qs == null) && player.getRace().equals(Race.ERTHEIA) && (player.getLevel() >= MIN_LEVEL) && (player.isInCategory(CategoryType.FOURTH_CLASS_GROUP))) if ((qs == null) && player.getRace() == Race.ERTHEIA && (player.getLevel() >= MIN_LEVEL) && (player.isInCategory(CategoryType.FOURTH_CLASS_GROUP)))
{ {
if (player.isMageClass()) if (player.isMageClass())
{ {

View File

@ -718,17 +718,17 @@ public final class CastleManorManager implements IGameXmlReader, IStorable
public final boolean isUnderMaintenance() public final boolean isUnderMaintenance()
{ {
return _mode.equals(ManorMode.MAINTENANCE); return _mode == ManorMode.MAINTENANCE;
} }
public final boolean isManorApproved() public final boolean isManorApproved()
{ {
return _mode.equals(ManorMode.APPROVED); return _mode == ManorMode.APPROVED;
} }
public final boolean isModifiablePeriod() public final boolean isModifiablePeriod()
{ {
return _mode.equals(ManorMode.MODIFIABLE); return _mode == ManorMode.MODIFIABLE;
} }
public final String getCurrentModeName() public final String getCurrentModeName()

View File

@ -417,7 +417,7 @@ public class DBSpawnManager
continue; continue;
} }
if (npc.getDBStatus().equals(DBStatusType.ALIVE)) if (npc.getDBStatus() == DBStatusType.ALIVE)
{ {
updateStatus(npc, false); updateStatus(npc, false);
} }

View File

@ -1149,7 +1149,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
private Attack generateAttackTargetData(L2Character target, L2Weapon weapon, WeaponType weaponType) private Attack generateAttackTargetData(L2Character target, L2Weapon weapon, WeaponType weaponType)
{ {
final boolean isDual = WeaponType.DUAL.equals(weaponType) || WeaponType.DUALBLUNT.equals(weaponType) || WeaponType.DUALDAGGER.equals(weaponType) || WeaponType.DUALFIST.equals(weaponType); final boolean isDual = WeaponType.DUAL == weaponType || WeaponType.DUALBLUNT == weaponType || WeaponType.DUALDAGGER == weaponType || WeaponType.DUALFIST == weaponType;
final Attack attack = new Attack(this, target); final Attack attack = new Attack(this, target);
boolean shotConsumed = false; boolean shotConsumed = false;

View File

@ -240,7 +240,7 @@ public class L2Npc extends L2Character
*/ */
public boolean hasRandomAnimation() public boolean hasRandomAnimation()
{ {
return ((Config.MAX_NPC_ANIMATION > 0) && _isRandomAnimationEnabled && !getAiType().equals(AIType.CORPSE)); return ((Config.MAX_NPC_ANIMATION > 0) && _isRandomAnimationEnabled && getAiType() != AIType.CORPSE);
} }
/** /**
@ -1337,7 +1337,7 @@ public class L2Npc extends L2Character
@Override @Override
public boolean isMovementDisabled() public boolean isMovementDisabled()
{ {
return super.isMovementDisabled() || !getTemplate().canMove() || getAiType().equals(AIType.CORPSE); return super.isMovementDisabled() || !getTemplate().canMove() || getAiType() == AIType.CORPSE;
} }
public AIType getAiType() public AIType getAiType()

View File

@ -878,7 +878,7 @@ public final class Instance implements IIdentifiable, INamable
public void finishInstance(int delay) public void finishInstance(int delay)
{ {
// Set re-enter for players // Set re-enter for players
if (_template.getReenterType().equals(InstanceReenterType.ON_FINISH)) if (_template.getReenterType() == InstanceReenterType.ON_FINISH)
{ {
setReenterTime(); setReenterTime();
} }
@ -941,7 +941,7 @@ public final class Instance implements IIdentifiable, INamable
addPlayer(player); addPlayer(player);
// Set origin return location if enabled // Set origin return location if enabled
if (_template.getExitLocationType().equals(InstanceTeleportType.ORIGIN)) if (_template.getExitLocationType() == InstanceTeleportType.ORIGIN)
{ {
player.getVariables().set("INSTANCE_ORIGIN", player.getX() + ";" + player.getY() + ";" + player.getZ()); player.getVariables().set("INSTANCE_ORIGIN", player.getX() + ";" + player.getY() + ";" + player.getZ());
} }

View File

@ -498,7 +498,7 @@ public class InstanceTemplate extends ListenersContainer implements IIdentifiabl
} }
// Now remove buffs by type // Now remove buffs by type
if (_removeBuffType.equals(InstanceRemoveBuffType.ALL)) if (_removeBuffType == InstanceRemoveBuffType.ALL)
{ {
for (L2Playable playable : affected) for (L2Playable playable : affected)
{ {
@ -635,7 +635,7 @@ public class InstanceTemplate extends ListenersContainer implements IIdentifiabl
// player < party < command channel // player < party < command channel
for (GroupType t : GroupType.values()) for (GroupType t : GroupType.values())
{ {
if (!t.equals(playerGroup) && groupMaskContains(t)) if (t != playerGroup && groupMaskContains(t))
{ {
return t; return t;
} }
@ -663,11 +663,11 @@ public class InstanceTemplate extends ListenersContainer implements IIdentifiabl
// Check if player has group in which he can enter // Check if player has group in which he can enter
AbstractPlayerGroup pGroup = null; AbstractPlayerGroup pGroup = null;
if (type.equals(GroupType.PARTY)) if (type == GroupType.PARTY)
{ {
pGroup = player.getParty(); pGroup = player.getParty();
} }
else if (type.equals(GroupType.COMMAND_CHANNEL)) else if (type == GroupType.COMMAND_CHANNEL)
{ {
pGroup = player.getCommandChannel(); pGroup = player.getCommandChannel();
} }

View File

@ -70,7 +70,7 @@ public interface ILocational
*/ */
default boolean isInFrontOf(ILocational target) default boolean isInFrontOf(ILocational target)
{ {
return Position.FRONT.equals(Position.getPosition(this, target)); return Position.FRONT == Position.getPosition(this, target);
} }
/** /**
@ -79,7 +79,7 @@ public interface ILocational
*/ */
default boolean isOnSideOf(ILocational target) default boolean isOnSideOf(ILocational target)
{ {
return Position.SIDE.equals(Position.getPosition(this, target)); return Position.SIDE == Position.getPosition(this, target);
} }
/** /**
@ -88,6 +88,6 @@ public interface ILocational
*/ */
default boolean isBehind(ILocational target) default boolean isBehind(ILocational target)
{ {
return Position.BACK.equals(Position.getPosition(this, target)); return Position.BACK == Position.getPosition(this, target);
} }
} }

View File

@ -237,7 +237,7 @@ public class PunishmentTask implements Runnable
} }
} }
if (_type.equals(PunishmentType.CHAT_BAN) && _affect.equals(PunishmentAffect.CHARACTER)) if (_type == PunishmentType.CHAT_BAN && _affect == PunishmentAffect.CHARACTER)
{ {
final L2PcInstance player = L2World.getInstance().getPlayer(Integer.valueOf(_key)); final L2PcInstance player = L2World.getInstance().getPlayer(Integer.valueOf(_key));
if (player != null) if (player != null)

View File

@ -455,6 +455,6 @@ public final class BuffInfo
public boolean isAbnormalType(AbnormalType type) public boolean isAbnormalType(AbnormalType type)
{ {
return _skill.getAbnormalType().equals(type); return _skill.getAbnormalType() == type;
} }
} }

View File

@ -118,7 +118,7 @@ public interface IStatsFunction
(bodypart == L2Item.SLOT_HAIRALL)) (bodypart == L2Item.SLOT_HAIRALL))
{ {
// TODO: Item after enchant shows pDef, but scroll says mDef increase. // TODO: Item after enchant shows pDef, but scroll says mDef increase.
if (!stat.equals(Stats.PHYSICAL_DEFENCE) && !stat.equals(Stats.MAGICAL_DEFENCE)) if (stat != Stats.PHYSICAL_DEFENCE && stat != Stats.MAGICAL_DEFENCE)
{ {
continue; continue;
} }

View File

@ -75,7 +75,7 @@ public final class TeleportHolder
*/ */
public boolean isNoblesse() public boolean isNoblesse()
{ {
return _type.equals(TeleportType.NOBLES_ADENA) || _type.equals(TeleportType.NOBLES_TOKEN); return _type == TeleportType.NOBLES_ADENA || _type == TeleportType.NOBLES_TOKEN;
} }
/** /**

View File

@ -41,7 +41,7 @@ public class RequestRaidBossSpawnInfo implements IClientIncomingPacket
for (int i = 0; i < count; i++) for (int i = 0; i < count; i++)
{ {
final int bossId = packet.readD(); final int bossId = packet.readD();
if (DBSpawnManager.getInstance().getNpcStatusId(bossId).equals(DBStatusType.ALIVE)) if (DBSpawnManager.getInstance().getNpcStatusId(bossId) == DBStatusType.ALIVE)
{ {
_bossIds.add(bossId); _bossIds.add(bossId);
} }

View File

@ -384,7 +384,7 @@ public class AdminEditChar implements IAdminCommandHandler
// Sex checks. // Sex checks.
boolean sexChange = false; boolean sexChange = false;
if (player.getRace().equals(Race.KAMAEL)) if (player.getRace() == Race.KAMAEL)
{ {
switch (classidval) switch (classidval)
{ {

View File

@ -714,17 +714,17 @@ public final class CastleManorManager implements IGameXmlReader, IStorable
public final boolean isUnderMaintenance() public final boolean isUnderMaintenance()
{ {
return _mode.equals(ManorMode.MAINTENANCE); return _mode == ManorMode.MAINTENANCE;
} }
public final boolean isManorApproved() public final boolean isManorApproved()
{ {
return _mode.equals(ManorMode.APPROVED); return _mode == ManorMode.APPROVED;
} }
public final boolean isModifiablePeriod() public final boolean isModifiablePeriod()
{ {
return _mode.equals(ManorMode.MODIFIABLE); return _mode == ManorMode.MODIFIABLE;
} }
public final String getCurrentModeName() public final String getCurrentModeName()

View File

@ -205,7 +205,7 @@ public final class DayNightSpawnManager
continue; continue;
} }
if ((boss != null) && (boss.getId() == 25328) && boss.getRaidStatus().equals(RaidBossSpawnManager.StatusEnum.ALIVE)) if ((boss != null) && (boss.getId() == 25328) && boss.getRaidStatus() == RaidBossSpawnManager.StatusEnum.ALIVE)
{ {
handleHellmans(boss, mode); handleHellmans(boss, mode);
} }

View File

@ -343,7 +343,7 @@ public class RaidBossSpawnManager
continue; continue;
} }
if (boss.getRaidStatus().equals(StatusEnum.ALIVE)) if (boss.getRaidStatus() == StatusEnum.ALIVE)
{ {
updateStatus(boss, false); updateStatus(boss, false);
} }

View File

@ -293,7 +293,7 @@ public class L2Npc extends L2Character
*/ */
public boolean hasRandomAnimation() public boolean hasRandomAnimation()
{ {
return ((Config.MAX_NPC_ANIMATION > 0) && isRandomAnimationEnabled() && !getAiType().equals(AIType.CORPSE)); return ((Config.MAX_NPC_ANIMATION > 0) && isRandomAnimationEnabled() && getAiType() != AIType.CORPSE);
} }
/** /**
@ -1579,7 +1579,7 @@ public class L2Npc extends L2Character
@Override @Override
public boolean isMovementDisabled() public boolean isMovementDisabled()
{ {
return super.isMovementDisabled() || !canMove() || getAiType().equals(AIType.CORPSE); return super.isMovementDisabled() || !canMove() || getAiType() == AIType.CORPSE;
} }
public AIType getAiType() public AIType getAiType()

View File

@ -464,7 +464,7 @@ public final class L2ClassMasterInstance extends L2MerchantInstance
return false; return false;
} }
if (oldCID.equals(newCID.getParent())) if (oldCID == newCID.getParent())
{ {
return true; return true;
} }

View File

@ -380,7 +380,7 @@ public class AdminEditChar implements IAdminCommandHandler
} }
// Sex checks. // Sex checks.
if (player.getRace().equals(Race.KAMAEL)) if (player.getRace() == Race.KAMAEL)
{ {
switch (classidval) switch (classidval)
{ {
@ -414,7 +414,7 @@ public class AdminEditChar implements IAdminCommandHandler
} }
} }
} }
if (player.getRace().equals(Race.ERTHEIA)) if (player.getRace() == Race.ERTHEIA)
{ {
player.getAppearance().setSex(true); player.getAppearance().setSex(true);
} }

Some files were not shown because too many files have changed in this diff Show More