Code improvements.

This commit is contained in:
MobiusDev
2016-04-24 16:30:15 +00:00
parent 8bd51aba1c
commit 2dd14bef9b
860 changed files with 8865 additions and 17041 deletions

View File

@@ -114,8 +114,7 @@ public class NpcViewMod implements IBypassHandler
{
return false;
}
final int page = st.hasMoreElements() ? Integer.parseInt(st.nextToken()) : 0;
sendNpcDropList(activeChar, npc, dropListScope, page);
sendNpcDropList(activeChar, npc, dropListScope, (st.hasMoreElements() ? Integer.parseInt(st.nextToken()) : 0));
}
catch (NumberFormatException e)
{

View File

@@ -87,9 +87,7 @@ public class OlympiadManagerLink implements IBypassHandler
{
if (command.toLowerCase().startsWith("olympiaddesc"))
{
final int val = Integer.parseInt(command.substring(13, 14));
final String suffix = command.substring(14);
((L2OlympiadManagerInstance) target).showChatWindow(activeChar, val, suffix);
((L2OlympiadManagerInstance) target).showChatWindow(activeChar, Integer.parseInt(command.substring(13, 14)), command.substring(14));
}
else if (command.toLowerCase().startsWith("olympiadnoble"))
{

View File

@@ -53,8 +53,7 @@ public class PlayerHelp implements IBypassHandler
final NpcHtmlMessage html;
if (cmd.length > 1)
{
final int itemId = Integer.parseInt(cmd[1]);
html = new NpcHtmlMessage(0, itemId);
html = new NpcHtmlMessage(0, Integer.parseInt(cmd[1]));
}
else
{

View File

@@ -219,19 +219,12 @@ public class QuestLink implements IBypassHandler
return;
}
if (qs == null)
if ((qs == null) && (q.getId() >= 1) && (q.getId() < 20000) && (player.getAllActiveQuests().size() >= MAX_QUEST_COUNT))
{
if ((q.getId() >= 1) && (q.getId() < 20000))
{
// Too many ongoing quests.
if (player.getAllActiveQuests().size() >= MAX_QUEST_COUNT)
{
final NpcHtmlMessage html = new NpcHtmlMessage(npc.getObjectId());
html.setFile(player.getHtmlPrefix(), "html/fullquest.html");
player.sendPacket(html);
return;
}
}
final NpcHtmlMessage html = new NpcHtmlMessage(npc.getObjectId());
html.setFile(player.getHtmlPrefix(), "html/fullquest.html");
player.sendPacket(html);
return;
}
q.notifyTalk(npc, player);

View File

@@ -72,8 +72,7 @@ public class SkillList implements IBypassHandler
if (!own_class)
{
final String charType = activeChar.getClassId().isMage() ? "fighter" : "mage";
text += "Skills of your class are the easiest to learn.<br>Skills of another class of your race are a little harder.<br>Skills for classes of another race are extremely difficult.<br>But the hardest of all to learn are the " + charType + "skills!<br>";
text += "Skills of your class are the easiest to learn.<br>Skills of another class of your race are a little harder.<br>Skills for classes of another race are extremely difficult.<br>But the hardest of all to learn are the " + (activeChar.getClassId().isMage() ? "fighter" : "mage") + "skills!<br>";
}
// make a list of classes