Minor code improvements.
This commit is contained in:
@@ -42,11 +42,11 @@ public class NewbieGuide extends AbstractNpcAI
|
||||
30602,
|
||||
};
|
||||
// Items
|
||||
private final static ItemHolder SOULSHOT_REWARD = new ItemHolder(5789, 200);
|
||||
private final static ItemHolder SPIRITSHOT_REWARD = new ItemHolder(5790, 100);
|
||||
private static final ItemHolder SOULSHOT_REWARD = new ItemHolder(5789, 200);
|
||||
private static final ItemHolder SPIRITSHOT_REWARD = new ItemHolder(5790, 100);
|
||||
// Other
|
||||
private final static String TUTORIAL_QUEST = "Q00255_Tutorial";
|
||||
private final static String SUPPORT_MAGIC_STRING = "<Button ALIGN=LEFT ICON=\"NORMAL\" action=\"bypass -h Link default/SupportMagic.htm\">Receive help from beneficial magic.</Button>";
|
||||
private static final String TUTORIAL_QUEST = "Q00255_Tutorial";
|
||||
private static final String SUPPORT_MAGIC_STRING = "<Button ALIGN=LEFT ICON=\"NORMAL\" action=\"bypass -h Link default/SupportMagic.htm\">Receive help from beneficial magic.</Button>";
|
||||
|
||||
private NewbieGuide()
|
||||
{
|
||||
|
@@ -244,7 +244,7 @@ public class NpcLocationInfo extends AbstractNpcAI
|
||||
int npcId = npc.getId();
|
||||
if (NPC.contains(npcId))
|
||||
{
|
||||
htmltext = String.valueOf(npcId) + ".htm";
|
||||
htmltext = npcId + ".htm";
|
||||
}
|
||||
return htmltext;
|
||||
}
|
||||
|
@@ -60,7 +60,7 @@ public class L2NpcActionShift implements IActionShiftHandler
|
||||
html.replace("%race%", npc.getTemplate().getRace().toString());
|
||||
html.replace("%id%", String.valueOf(npc.getTemplate().getId()));
|
||||
html.replace("%lvl%", String.valueOf(npc.getTemplate().getLevel()));
|
||||
html.replace("%name%", String.valueOf(npc.getTemplate().getName()));
|
||||
html.replace("%name%", npc.getTemplate().getName());
|
||||
html.replace("%tmplid%", String.valueOf(npc.getTemplate().getId()));
|
||||
html.replace("%aggro%", String.valueOf((target instanceof L2Attackable) ? ((L2Attackable) target).getAggroRange() : 0));
|
||||
html.replace("%hp%", String.valueOf((int) npc.getCurrentHp()));
|
||||
@@ -86,7 +86,7 @@ public class L2NpcActionShift implements IActionShiftHandler
|
||||
html.replace("%int%", String.valueOf(npc.getINT()));
|
||||
html.replace("%wit%", String.valueOf(npc.getWIT()));
|
||||
html.replace("%men%", String.valueOf(npc.getMEN()));
|
||||
html.replace("%loc%", String.valueOf(target.getX() + " " + target.getY() + " " + target.getZ()));
|
||||
html.replace("%loc%", target.getX() + " " + target.getY() + " " + target.getZ());
|
||||
html.replace("%heading%", String.valueOf(npc.getHeading()));
|
||||
html.replace("%collision_radius%", String.valueOf(npc.getTemplate().getfCollisionRadius()));
|
||||
html.replace("%collision_height%", String.valueOf(npc.getTemplate().getfCollisionHeight()));
|
||||
@@ -115,8 +115,8 @@ public class L2NpcActionShift implements IActionShiftHandler
|
||||
{
|
||||
final String fileName = template.getSpawnTemplate().getFile().getAbsolutePath().substring(Config.DATAPACK_ROOT.getAbsolutePath().length() + 1).replace('\\', '/');
|
||||
html.replace("%spawnfile%", fileName);
|
||||
html.replace("%spawnname%", String.valueOf(template.getSpawnTemplate().getName()));
|
||||
html.replace("%spawngroup%", String.valueOf(template.getGroup().getName()));
|
||||
html.replace("%spawnname%", template.getSpawnTemplate().getName());
|
||||
html.replace("%spawngroup%", template.getGroup().getName());
|
||||
if (template.getSpawnTemplate().getAI() != null)
|
||||
{
|
||||
final Quest script = QuestManager.getInstance().getQuest(template.getSpawnTemplate().getAI());
|
||||
@@ -137,11 +137,11 @@ public class L2NpcActionShift implements IActionShiftHandler
|
||||
}
|
||||
else if (npc.getSpawn().hasRespawnRandom())
|
||||
{
|
||||
html.replace("%resp%", String.valueOf(npc.getSpawn().getRespawnMinDelay() / 1000) + "-" + String.valueOf((npc.getSpawn().getRespawnMaxDelay() / 1000) + " sec"));
|
||||
html.replace("%resp%", npc.getSpawn().getRespawnMinDelay() / 1000 + "-" + (npc.getSpawn().getRespawnMaxDelay() / 1000) + " sec");
|
||||
}
|
||||
else
|
||||
{
|
||||
html.replace("%resp%", String.valueOf(npc.getSpawn().getRespawnMinDelay() / 1000) + " sec");
|
||||
html.replace("%resp%", npc.getSpawn().getRespawnMinDelay() / 1000 + " sec");
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -164,11 +164,11 @@ public class L2NpcActionShift implements IActionShiftHandler
|
||||
final String clansString = !clans.isEmpty() ? CommonUtil.implode(clans, ", ") : "";
|
||||
final String ignoreClanNpcIdsString = ignoreClanNpcIds != null ? CommonUtil.implode(ignoreClanNpcIds, ", ") : "";
|
||||
|
||||
html.replace("%ai_intention%", "<tr><td><table width=270 border=0 bgcolor=131210><tr><td width=100><font color=FFAA00>Intention:</font></td><td align=right width=170>" + String.valueOf(npc.getAI().getIntention().name()) + "</td></tr></table></td></tr>");
|
||||
html.replace("%ai_intention%", "<tr><td><table width=270 border=0 bgcolor=131210><tr><td width=100><font color=FFAA00>Intention:</font></td><td align=right width=170>" + npc.getAI().getIntention().name() + "</td></tr></table></td></tr>");
|
||||
html.replace("%ai%", "<tr><td><table width=270 border=0><tr><td width=100><font color=FFAA00>AI</font></td><td align=right width=170>" + npc.getAI().getClass().getSimpleName() + "</td></tr></table></td></tr>");
|
||||
html.replace("%ai_type%", "<tr><td><table width=270 border=0 bgcolor=131210><tr><td width=100><font color=FFAA00>AIType</font></td><td align=right width=170>" + String.valueOf(npc.getAiType()) + "</td></tr></table></td></tr>");
|
||||
html.replace("%ai_clan%", "<tr><td><table width=270 border=0><tr><td width=100><font color=FFAA00>Clan & Range:</font></td><td align=right width=170>" + clansString + " " + String.valueOf(npc.getTemplate().getClanHelpRange()) + "</td></tr></table></td></tr>");
|
||||
html.replace("%ai_enemy_clan%", "<tr><td><table width=270 border=0 bgcolor=131210><tr><td width=100><font color=FFAA00>Ignore & Range:</font></td><td align=right width=170>" + ignoreClanNpcIdsString + " " + String.valueOf(npc.getTemplate().getAggroRange()) + "</td></tr></table></td></tr>");
|
||||
html.replace("%ai_type%", "<tr><td><table width=270 border=0 bgcolor=131210><tr><td width=100><font color=FFAA00>AIType</font></td><td align=right width=170>" + npc.getAiType() + "</td></tr></table></td></tr>");
|
||||
html.replace("%ai_clan%", "<tr><td><table width=270 border=0><tr><td width=100><font color=FFAA00>Clan & Range:</font></td><td align=right width=170>" + clansString + " " + npc.getTemplate().getClanHelpRange() + "</td></tr></table></td></tr>");
|
||||
html.replace("%ai_enemy_clan%", "<tr><td><table width=270 border=0 bgcolor=131210><tr><td width=100><font color=FFAA00>Ignore & Range:</font></td><td align=right width=170>" + ignoreClanNpcIdsString + " " + npc.getTemplate().getAggroRange() + "</td></tr></table></td></tr>");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@@ -109,7 +109,7 @@ public class AdminShutdown implements IAdminCommandHandler
|
||||
adminReply.setFile(activeChar.getHtmlPrefix(), "data/html/admin/shutdown.htm");
|
||||
adminReply.replace("%count%", String.valueOf(L2World.getInstance().getPlayers().size()));
|
||||
adminReply.replace("%used%", String.valueOf(Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory()));
|
||||
adminReply.replace("%time%", String.valueOf(format.format(cal.getTime())));
|
||||
adminReply.replace("%time%", format.format(cal.getTime()));
|
||||
activeChar.sendPacket(adminReply);
|
||||
}
|
||||
|
||||
|
@@ -73,8 +73,8 @@ public class Premium implements IVoicedCommandHandler
|
||||
html.append("<tr><td>Drop Amount: <font color=\"LEVEL\">x" + (Config.RATE_DEATH_DROP_AMOUNT_MULTIPLIER * Config.PREMIUM_RATE_DROP_AMOUNT) + " <br1></font></td></tr>");
|
||||
html.append("<tr><td>Spoil Chance: <font color=\"LEVEL\">x" + (Config.RATE_CORPSE_DROP_CHANCE_MULTIPLIER * Config.PREMIUM_RATE_SPOIL_CHANCE) + " <br1></font></td></tr>");
|
||||
html.append("<tr><td>Spoil Amount: <font color=\"LEVEL\">x" + (Config.RATE_CORPSE_DROP_AMOUNT_MULTIPLIER * Config.PREMIUM_RATE_SPOIL_AMOUNT) + " <br1></font></td></tr>");
|
||||
html.append("<tr><td>Expires: <font color=\"00A5FF\">" + String.valueOf(format.format(endDate)) + "</font></td></tr>");
|
||||
html.append("<tr><td>Current Date: <font color=\"70FFCA\">" + String.valueOf(format.format(System.currentTimeMillis())) + "<br><br></font></td></tr>");
|
||||
html.append("<tr><td>Expires: <font color=\"00A5FF\">" + format.format(endDate) + "</font></td></tr>");
|
||||
html.append("<tr><td>Current Date: <font color=\"70FFCA\">" + format.format(System.currentTimeMillis()) + "<br><br></font></td></tr>");
|
||||
html.append("<tr><td><center>Premium Info & Rules<br></center></td></tr>");
|
||||
html.append("<tr><td><font color=\"70FFCA\">1. Premium accounts CAN NOT BE TRANSFERED.<br1></font></td></tr>");
|
||||
html.append("<tr><td><font color=\"70FFCA\">2. Premium does not effect party members.<br1></font></td></tr>");
|
||||
|
@@ -55,7 +55,7 @@ import com.l2jmobius.gameserver.network.serverpackets.TutorialShowQuestionMark;
|
||||
public class Q00255_Tutorial extends Quest
|
||||
{
|
||||
// NPCs
|
||||
private final static List<Integer> NEWBIE_HELPERS = new ArrayList<>();
|
||||
private static final List<Integer> NEWBIE_HELPERS = new ArrayList<>();
|
||||
{
|
||||
NEWBIE_HELPERS.add(30009); // human fighter
|
||||
NEWBIE_HELPERS.add(30019); // human mystic
|
||||
@@ -64,7 +64,7 @@ public class Q00255_Tutorial extends Quest
|
||||
NEWBIE_HELPERS.add(30575); // orc
|
||||
NEWBIE_HELPERS.add(30530); // dwarf
|
||||
}
|
||||
private final static List<Integer> SUPERVISORS = new ArrayList<>();
|
||||
private static final List<Integer> SUPERVISORS = new ArrayList<>();
|
||||
{
|
||||
SUPERVISORS.add(30008); // human fighter
|
||||
SUPERVISORS.add(30017); // human mystic
|
||||
@@ -74,15 +74,15 @@ public class Q00255_Tutorial extends Quest
|
||||
SUPERVISORS.add(30528); // dwarf
|
||||
}
|
||||
// Monsters
|
||||
private final static int[] GREMLINS =
|
||||
private static final int[] GREMLINS =
|
||||
{
|
||||
18342, // this is used for now
|
||||
20001
|
||||
};
|
||||
// Items
|
||||
private final static int BLUE_GEM = 6353;
|
||||
private final static ItemHolder SOULSHOT_REWARD = new ItemHolder(5789, 200);
|
||||
private final static ItemHolder SPIRITSHOT_REWARD = new ItemHolder(5790, 100);
|
||||
private static final int BLUE_GEM = 6353;
|
||||
private static final ItemHolder SOULSHOT_REWARD = new ItemHolder(5789, 200);
|
||||
private static final ItemHolder SPIRITSHOT_REWARD = new ItemHolder(5790, 100);
|
||||
// Others
|
||||
private static final Map<Integer, QuestSoundHtmlHolder> STARTING_VOICE_HTML = new HashMap<>();
|
||||
{
|
||||
|
@@ -35,7 +35,7 @@ import com.l2jmobius.gameserver.model.quest.State;
|
||||
*/
|
||||
public final class Q00257_TheGuardIsBusy extends Quest
|
||||
{
|
||||
public final static class MobDrop extends ItemHolder
|
||||
public static final class MobDrop extends ItemHolder
|
||||
{
|
||||
private final int _chance;
|
||||
private final int _random;
|
||||
|
@@ -157,7 +157,7 @@ public final class Q00306_CrystalOfFireAndIce extends Quest
|
||||
return htmltext;
|
||||
}
|
||||
|
||||
private static final void giveKillReward(L2PcInstance player, L2Npc npc)
|
||||
private static void giveKillReward(L2PcInstance player, L2Npc npc)
|
||||
{
|
||||
if (Util.checkIfInRange(1500, npc, player, false))
|
||||
{
|
||||
|
@@ -387,7 +387,7 @@ public class L2VillageMasterInstance extends L2NpcInstance
|
||||
final StringBuilder content1 = new StringBuilder(200);
|
||||
for (PlayerClass subClass : subsAvailable)
|
||||
{
|
||||
content1.append("<a action=\"bypass -h npc_%objectId%_Subclass 4 " + String.valueOf(subClass.ordinal()) + "\" msg=\"1268;" + ClassListData.getInstance().getClass(subClass.ordinal()).getClassName() + "\">" + ClassListData.getInstance().getClass(subClass.ordinal()).getClientCode() + "</a><br>");
|
||||
content1.append("<a action=\"bypass -h npc_%objectId%_Subclass 4 " + subClass.ordinal() + "\" msg=\"1268;" + ClassListData.getInstance().getClass(subClass.ordinal()).getClassName() + "\">" + ClassListData.getInstance().getClass(subClass.ordinal()).getClientCode() + "</a><br>");
|
||||
}
|
||||
html.replace("%list%", content1.toString());
|
||||
}
|
||||
@@ -429,7 +429,7 @@ public class L2VillageMasterInstance extends L2NpcInstance
|
||||
final SubClass subClass = subList.next();
|
||||
if (checkVillageMaster(subClass.getClassDefinition()))
|
||||
{
|
||||
content2.append("<a action=\"bypass -h npc_%objectId%_Subclass 5 " + String.valueOf(subClass.getClassIndex()) + "\">" + ClassListData.getInstance().getClass(subClass.getClassId()).getClientCode() + "</a><br>");
|
||||
content2.append("<a action=\"bypass -h npc_%objectId%_Subclass 5 " + subClass.getClassIndex() + "\">" + ClassListData.getInstance().getClass(subClass.getClassId()).getClientCode() + "</a><br>");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -462,7 +462,7 @@ public class L2VillageMasterInstance extends L2NpcInstance
|
||||
{
|
||||
final SubClass subClass = subList.next();
|
||||
|
||||
content3.append("Sub-class " + String.valueOf(classIndex++) + "<br><a action=\"bypass -h npc_%objectId%_Subclass 6 " + String.valueOf(subClass.getClassIndex()) + "\">" + ClassListData.getInstance().getClass(subClass.getClassId()).getClientCode() + "</a><br>");
|
||||
content3.append("Sub-class " + classIndex++ + "<br><a action=\"bypass -h npc_%objectId%_Subclass 6 " + subClass.getClassIndex() + "\">" + ClassListData.getInstance().getClass(subClass.getClassId()).getClientCode() + "</a><br>");
|
||||
}
|
||||
html.replace("%list%", content3.toString());
|
||||
}
|
||||
@@ -625,7 +625,7 @@ public class L2VillageMasterInstance extends L2NpcInstance
|
||||
final StringBuilder content6 = new StringBuilder(200);
|
||||
for (PlayerClass subClass : subsAvailable)
|
||||
{
|
||||
content6.append("<a action=\"bypass -h npc_%objectId%_Subclass 7 " + String.valueOf(paramOne) + " " + String.valueOf(subClass.ordinal()) + "\" msg=\"1445;\">" + ClassListData.getInstance().getClass(subClass.ordinal()).getClientCode() + "</a><br>");
|
||||
content6.append("<a action=\"bypass -h npc_%objectId%_Subclass 7 " + paramOne + " " + subClass.ordinal() + "\" msg=\"1445;\">" + ClassListData.getInstance().getClass(subClass.ordinal()).getClientCode() + "</a><br>");
|
||||
}
|
||||
|
||||
switch (paramOne)
|
||||
@@ -891,7 +891,7 @@ public class L2VillageMasterInstance extends L2NpcInstance
|
||||
return checkVillageMasterRace(pclass) && checkVillageMasterTeachType(pclass);
|
||||
}
|
||||
|
||||
private static final Iterator<SubClass> iterSubClasses(L2PcInstance player)
|
||||
private static Iterator<SubClass> iterSubClasses(L2PcInstance player)
|
||||
{
|
||||
return player.getSubClasses().values().iterator();
|
||||
}
|
||||
|
Reference in New Issue
Block a user