Proper naming for various methods and variables.
This commit is contained in:
@@ -64,7 +64,7 @@ public class Lailly extends AbstractNpcAI
|
||||
}
|
||||
case "okay":
|
||||
{
|
||||
final Instance instance = InstanceManager.getInstance().getPlayer(player, false);
|
||||
final Instance instance = InstanceManager.getInstance().getPlayerInstance(player, false);
|
||||
if ((instance != null) && (instance.getEndTime() > Chronos.currentTimeMillis()))
|
||||
{
|
||||
switch (instance.getTemplateId())
|
||||
|
@@ -58,10 +58,10 @@ public class Apprentice extends AbstractNpcAI
|
||||
final QuestState qs = player.getQuestState(Q10329_BackupSeekers.class.getSimpleName());
|
||||
if ((qs != null) && qs.isStarted())
|
||||
{
|
||||
final Quest quest_10329 = QuestManager.getInstance().getQuest(Q10329_BackupSeekers.class.getSimpleName());
|
||||
if (quest_10329 != null)
|
||||
final Quest q10329 = QuestManager.getInstance().getQuest(Q10329_BackupSeekers.class.getSimpleName());
|
||||
if (q10329 != null)
|
||||
{
|
||||
quest_10329.notifyEvent("RESPAWN_BART", null, player);
|
||||
q10329.notifyEvent("RESPAWN_BART", null, player);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -50,7 +50,7 @@ public class Toyron extends AbstractNpcAI
|
||||
@Override
|
||||
public String onAdvEvent(String event, Npc npc, Player player)
|
||||
{
|
||||
final Instance world = InstanceManager.getInstance().getPlayer(player, true);
|
||||
final Instance world = InstanceManager.getInstance().getPlayerInstance(player, true);
|
||||
if (event.equals("museum_teleport"))
|
||||
{
|
||||
if ((world != null) && (world.getTemplateId() == TEMPLATE_ID))
|
||||
|
@@ -103,10 +103,10 @@ public class YeSegiraTeleportDevice extends AbstractNpcAI
|
||||
final QuestState qs = player.getQuestState(Q10365_SeekerEscort.class.getSimpleName());
|
||||
if ((qs != null) && qs.isStarted() && qs.isCond(1))
|
||||
{
|
||||
final Quest quest_10365 = QuestManager.getInstance().getQuest(Q10365_SeekerEscort.class.getSimpleName());
|
||||
if (quest_10365 != null)
|
||||
final Quest q10365 = QuestManager.getInstance().getQuest(Q10365_SeekerEscort.class.getSimpleName());
|
||||
if (q10365 != null)
|
||||
{
|
||||
quest_10365.notifyEvent("TELEPORT_TO_NEXT_STAGE", null, player);
|
||||
q10365.notifyEvent("TELEPORT_TO_NEXT_STAGE", null, player);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -662,7 +662,7 @@ public class LastImperialTomb extends AbstractInstance
|
||||
}
|
||||
else // Teleport Cube
|
||||
{
|
||||
final Instance world = getPlayer(player);
|
||||
final Instance world = getPlayerInstance(player);
|
||||
if (world != null)
|
||||
{
|
||||
teleportPlayerOut(player, world);
|
||||
|
@@ -46,7 +46,7 @@ public class Lydia extends AbstractNpcAI
|
||||
public String onFirstTalk(Npc npc, Player player)
|
||||
{
|
||||
String htmltext = null;
|
||||
final Instance instance = InstanceManager.getInstance().getPlayer(player, false);
|
||||
final Instance instance = InstanceManager.getInstance().getPlayerInstance(player, false);
|
||||
if ((instance != null) && ((instance.getTemplateId() == OCTAVIS_TEMPLATE_ID) || (instance.getTemplateId() == OCTAVIS_EXTREME_TEMPLATE_ID)))
|
||||
{
|
||||
htmltext = "Lydia-02.html";
|
||||
|
@@ -138,7 +138,7 @@ public class OctavisWarzone extends AbstractInstance
|
||||
}
|
||||
case "reenterInstance":
|
||||
{
|
||||
final Instance activeInstance = getPlayer(player);
|
||||
final Instance activeInstance = getPlayerInstance(player);
|
||||
if (isInInstance(activeInstance))
|
||||
{
|
||||
enterInstance(player, npc, activeInstance.getTemplateId());
|
||||
|
@@ -194,9 +194,9 @@ public class TeredorWarzone extends AbstractInstance
|
||||
}
|
||||
case "checkConditions":
|
||||
{
|
||||
final Instance Player = getPlayer(player);
|
||||
final Instance instance = getPlayerInstance(player);
|
||||
final Party playerParty = player.getParty();
|
||||
if ((Player != null) && (Player.getTemplateId() == TEMPLATE_ID))
|
||||
if ((instance != null) && (instance.getTemplateId() == TEMPLATE_ID))
|
||||
{
|
||||
enterInstance(player, npc, TEMPLATE_ID);
|
||||
}
|
||||
|
@@ -1254,7 +1254,7 @@ public class AdminEditChar implements IAdminCommandHandler
|
||||
*/
|
||||
private void findCharacter(Player activeChar, String characterToFind)
|
||||
{
|
||||
int CharactersFound = 0;
|
||||
int charactersFound = 0;
|
||||
String name;
|
||||
final NpcHtmlMessage adminReply = new NpcHtmlMessage(0, 1);
|
||||
adminReply.setFile(activeChar, "data/html/admin/charfind.htm");
|
||||
@@ -1267,7 +1267,7 @@ public class AdminEditChar implements IAdminCommandHandler
|
||||
name = player.getName();
|
||||
if (name.toLowerCase().contains(characterToFind.toLowerCase()))
|
||||
{
|
||||
CharactersFound += 1;
|
||||
charactersFound += 1;
|
||||
replyMSG.append("<tr><td width=80><a action=\"bypass -h admin_character_info ");
|
||||
replyMSG.append(name);
|
||||
replyMSG.append("\">");
|
||||
@@ -1278,7 +1278,7 @@ public class AdminEditChar implements IAdminCommandHandler
|
||||
replyMSG.append(player.getLevel());
|
||||
replyMSG.append("</td></tr>");
|
||||
}
|
||||
if (CharactersFound > 20)
|
||||
if (charactersFound > 20)
|
||||
{
|
||||
break;
|
||||
}
|
||||
@@ -1286,16 +1286,16 @@ public class AdminEditChar implements IAdminCommandHandler
|
||||
adminReply.replace("%results%", replyMSG.toString());
|
||||
|
||||
final String replyMSG2;
|
||||
if (CharactersFound == 0)
|
||||
if (charactersFound == 0)
|
||||
{
|
||||
replyMSG2 = "s. Please try again.";
|
||||
}
|
||||
else if (CharactersFound > 20)
|
||||
else if (charactersFound > 20)
|
||||
{
|
||||
adminReply.replace("%number%", " more than 20");
|
||||
replyMSG2 = "s.<br>Please refine your search to see all of the results.";
|
||||
}
|
||||
else if (CharactersFound == 1)
|
||||
else if (charactersFound == 1)
|
||||
{
|
||||
replyMSG2 = ".";
|
||||
}
|
||||
@@ -1304,7 +1304,7 @@ public class AdminEditChar implements IAdminCommandHandler
|
||||
replyMSG2 = "s.";
|
||||
}
|
||||
|
||||
adminReply.replace("%number%", String.valueOf(CharactersFound));
|
||||
adminReply.replace("%number%", String.valueOf(charactersFound));
|
||||
adminReply.replace("%end%", replyMSG2);
|
||||
activeChar.sendPacket(adminReply);
|
||||
}
|
||||
|
@@ -66,9 +66,9 @@ public abstract class AbstractInstance extends AbstractNpcAI
|
||||
* @param player player who wants get instance world
|
||||
* @return instance world if found, otherwise null
|
||||
*/
|
||||
public Instance getPlayer(Player player)
|
||||
public Instance getPlayerInstance(Player player)
|
||||
{
|
||||
return InstanceManager.getInstance().getPlayer(player, false);
|
||||
return InstanceManager.getInstance().getPlayerInstance(player, false);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -107,7 +107,7 @@ public abstract class AbstractInstance extends AbstractNpcAI
|
||||
*/
|
||||
protected final void enterInstance(Player player, Npc npc, int templateId)
|
||||
{
|
||||
Instance instance = getPlayer(player);
|
||||
Instance instance = getPlayerInstance(player);
|
||||
if (instance != null) // Player has already any instance active
|
||||
{
|
||||
if (instance.getTemplateId() != templateId)
|
||||
@@ -153,7 +153,7 @@ public abstract class AbstractInstance extends AbstractNpcAI
|
||||
// Check if any player from enter group has active instance
|
||||
for (Player member : enterGroup)
|
||||
{
|
||||
if (getPlayer(member) != null)
|
||||
if (getPlayerInstance(member) != null)
|
||||
{
|
||||
enterGroup.forEach(p -> p.sendPacket(SystemMessageId.YOU_HAVE_ENTERED_ANOTHER_INSTANT_ZONE_THEREFORE_YOU_CANNOT_ENTER_CORRESPONDING_DUNGEON));
|
||||
return;
|
||||
|
@@ -74,7 +74,7 @@ public class EvasHiddenSpace extends AbstractInstance
|
||||
}
|
||||
else if (event.equals("exitInstance"))
|
||||
{
|
||||
final Instance world = getPlayer(player);
|
||||
final Instance world = getPlayerInstance(player);
|
||||
if (world != null)
|
||||
{
|
||||
teleportPlayerOut(player, world);
|
||||
|
@@ -159,11 +159,11 @@ public class KartiaHelperAdolph extends AbstractNpcAI
|
||||
if ((instance != null) && !npc.isCastingNow() && (!CommonUtil.contains(KARTIA_FRIENDS, target.getId())))
|
||||
{
|
||||
final StatSet instParams = instance.getTemplateParameters();
|
||||
final SkillHolder skill_01 = instParams.getSkillHolder("adolphHate");
|
||||
final SkillHolder skill_02 = instParams.getSkillHolder("adolphPunish");
|
||||
final SkillHolder skill_03 = instParams.getSkillHolder("adolphShield");
|
||||
final SkillHolder skill_04 = instParams.getSkillHolder("adolphAggression");
|
||||
final SkillHolder skill_05 = instParams.getSkillHolder("adolphChainHydra");
|
||||
final SkillHolder skill1 = instParams.getSkillHolder("adolphHate");
|
||||
final SkillHolder skill2 = instParams.getSkillHolder("adolphPunish");
|
||||
final SkillHolder skill3 = instParams.getSkillHolder("adolphShield");
|
||||
final SkillHolder skill4 = instParams.getSkillHolder("adolphAggression");
|
||||
final SkillHolder skill5 = instParams.getSkillHolder("adolphChainHydra");
|
||||
final SkillHolder lowHpSkill = instParams.getSkillHolder("adolphUltimate");
|
||||
final int numberOfActiveSkills = 5;
|
||||
final int randomSkill = getRandom(numberOfActiveSkills + 1);
|
||||
@@ -183,10 +183,10 @@ public class KartiaHelperAdolph extends AbstractNpcAI
|
||||
case 0:
|
||||
case 1:
|
||||
{
|
||||
if ((skill_01 != null) && SkillCaster.checkUseConditions(npc, skill_01.getSkill()))
|
||||
if ((skill1 != null) && SkillCaster.checkUseConditions(npc, skill1.getSkill()))
|
||||
{
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.I_WILL_SHOW_YOU_THE_JUSTICE_OF_ADEN);
|
||||
npc.doCast(skill_01.getSkill(), null, true, false);
|
||||
npc.doCast(skill1.getSkill(), null, true, false);
|
||||
final List<Monster> monsterList = World.getInstance().getVisibleObjectsInRange(npc, Monster.class, 300);
|
||||
if (!monsterList.isEmpty())
|
||||
{
|
||||
@@ -203,37 +203,37 @@ public class KartiaHelperAdolph extends AbstractNpcAI
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
if ((skill_02 != null) && SkillCaster.checkUseConditions(npc, skill_02.getSkill()))
|
||||
if ((skill2 != null) && SkillCaster.checkUseConditions(npc, skill2.getSkill()))
|
||||
{
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.DIE_3);
|
||||
npc.doCast(skill_02.getSkill(), null, true, false);
|
||||
npc.doCast(skill2.getSkill(), null, true, false);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 3:
|
||||
{
|
||||
if ((skill_03 != null) && SkillCaster.checkUseConditions(npc, skill_03.getSkill()))
|
||||
if ((skill3 != null) && SkillCaster.checkUseConditions(npc, skill3.getSkill()))
|
||||
{
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.FOR_THE_GODDESS);
|
||||
npc.doCast(skill_03.getSkill(), null, true, false);
|
||||
npc.doCast(skill3.getSkill(), null, true, false);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 4:
|
||||
{
|
||||
if ((skill_04 != null) && SkillCaster.checkUseConditions(npc, skill_04.getSkill()))
|
||||
if ((skill4 != null) && SkillCaster.checkUseConditions(npc, skill4.getSkill()))
|
||||
{
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.YOU_WILL_BE_DESTROYED);
|
||||
npc.doCast(skill_04.getSkill());
|
||||
npc.doCast(skill4.getSkill());
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 5:
|
||||
{
|
||||
if ((skill_05 != null) && SkillCaster.checkUseConditions(npc, skill_05.getSkill()))
|
||||
if ((skill5 != null) && SkillCaster.checkUseConditions(npc, skill5.getSkill()))
|
||||
{
|
||||
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.YOU_WILL_DIE);
|
||||
npc.doCast(skill_05.getSkill(), null, true, false);
|
||||
npc.doCast(skill5.getSkill(), null, true, false);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@@ -68,7 +68,7 @@ public class TalkingIslandPast extends AbstractInstance
|
||||
}
|
||||
else if (event.equals("exitInstance"))
|
||||
{
|
||||
final Instance world = getPlayer(player);
|
||||
final Instance world = getPlayerInstance(player);
|
||||
if (world != null)
|
||||
{
|
||||
teleportPlayerOut(player, world);
|
||||
|
@@ -233,7 +233,7 @@ public class Q00129_PailakaDevilsLegacy extends Quest
|
||||
}
|
||||
else
|
||||
{
|
||||
final Instance inst = InstanceManager.getInstance().getPlayer(player, true);
|
||||
final Instance inst = InstanceManager.getInstance().getPlayerInstance(player, true);
|
||||
if (inst != null)
|
||||
{
|
||||
inst.finishInstance();
|
||||
|
@@ -200,7 +200,7 @@ public class Q00144_PailakaInjuredDragon extends Quest
|
||||
{
|
||||
htmltext = getNoQuestLevelRewardMsg(player);
|
||||
}
|
||||
final Instance inst = InstanceManager.getInstance().getPlayer(player, true);
|
||||
final Instance inst = InstanceManager.getInstance().getPlayerInstance(player, true);
|
||||
if (inst != null)
|
||||
{
|
||||
inst.finishInstance();
|
||||
|
@@ -165,7 +165,7 @@ public class Q10284_AcquisitionOfDivineSword extends Quest
|
||||
qs.unset("ex3");
|
||||
qs.setCond(3, true);
|
||||
qs.setMemoState(2);
|
||||
final Instance world = InstanceManager.getInstance().getPlayer(player, true);
|
||||
final Instance world = InstanceManager.getInstance().getPlayerInstance(player, true);
|
||||
if (world != null)
|
||||
{
|
||||
world.finishInstance(0);
|
||||
|
@@ -103,7 +103,7 @@ public class Q10286_ReunionWithSirra extends Quest
|
||||
{
|
||||
qs.unset("ex");
|
||||
qs.setMemoState(2);
|
||||
final Instance world = InstanceManager.getInstance().getPlayer(player, true);
|
||||
final Instance world = InstanceManager.getInstance().getPlayerInstance(player, true);
|
||||
if (world != null)
|
||||
{
|
||||
world.finishInstance(0);
|
||||
|
@@ -202,7 +202,7 @@ public class Q10287_StoryOfThoseLeft extends Quest
|
||||
qs.unset("ex1");
|
||||
qs.unset("ex2");
|
||||
|
||||
final Instance world = InstanceManager.getInstance().getPlayer(player, true);
|
||||
final Instance world = InstanceManager.getInstance().getPlayerInstance(player, true);
|
||||
if (world != null)
|
||||
{
|
||||
world.finishInstance(0);
|
||||
|
Reference in New Issue
Block a user