Skip to content
Snippets Groups Projects
Commit b4a36d65 authored by Zoey76's avatar Zoey76
Browse files

BETA: Minor typo fix and code formatting for [8468].

parent 5290aa6f
No related branches found
No related tags found
No related merge requests found
...@@ -34,10 +34,13 @@ public class SkillList implements IBypassHandler ...@@ -34,10 +34,13 @@ public class SkillList implements IBypassHandler
"SkillList" "SkillList"
}; };
@Override
public boolean useBypass(String command, L2PcInstance activeChar, L2Character target) public boolean useBypass(String command, L2PcInstance activeChar, L2Character target)
{ {
if (!(target instanceof L2NpcInstance)) if (!(target instanceof L2NpcInstance))
{
return false; return false;
}
if (Config.ALT_GAME_SKILL_LEARN) if (Config.ALT_GAME_SKILL_LEARN)
{ {
...@@ -46,7 +49,7 @@ public class SkillList implements IBypassHandler ...@@ -46,7 +49,7 @@ public class SkillList implements IBypassHandler
String id = command.substring(9).trim(); String id = command.substring(9).trim();
if (id.length() != 0) if (id.length() != 0)
{ {
L2NpcInstance.showSkillList(activeChar, (L2Npc)target, ClassId.values()[Integer.parseInt(id)]); L2NpcInstance.showSkillList(activeChar, (L2Npc) target, ClassId.values()[Integer.parseInt(id)]);
} }
else else
{ {
...@@ -67,15 +70,11 @@ public class SkillList implements IBypassHandler ...@@ -67,15 +70,11 @@ public class SkillList implements IBypassHandler
if (!own_class) if (!own_class)
{ {
String charType = activeChar.getClassId().isMage() ? "fighter" : "mage"; String charType = activeChar.getClassId().isMage() ? "fighter" : "mage";
text += 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>";
"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>";
} }
// make a list of classes // make a list of classes
if (classesToTeach.isEmpty()) if (!classesToTeach.isEmpty())
{ {
int count = 0; int count = 0;
ClassId classCheck = activeChar.getClassId(); ClassId classCheck = activeChar.getClassId();
...@@ -85,12 +84,16 @@ public class SkillList implements IBypassHandler ...@@ -85,12 +84,16 @@ public class SkillList implements IBypassHandler
for (ClassId cid : classesToTeach) for (ClassId cid : classesToTeach)
{ {
if (cid.level() > classCheck.level()) if (cid.level() > classCheck.level())
{
continue; continue;
}
if (SkillTreesData.getInstance().getAvailableSkills(activeChar, cid, false, false).isEmpty()) if (SkillTreesData.getInstance().getAvailableSkills(activeChar, cid, false, false).isEmpty())
{
continue; continue;
}
text += "<a action=\"bypass -h npc_%objectId%_SkillList "+cid.getId()+"\">Learn "+cid+"'s class Skills</a><br>\n"; text += "<a action=\"bypass -h npc_%objectId%_SkillList " + cid.getId() + "\">Learn " + cid + "'s class Skills</a><br>\n";
count++; count++;
} }
classCheck = classCheck.getParent(); classCheck = classCheck.getParent();
...@@ -103,9 +106,9 @@ public class SkillList implements IBypassHandler ...@@ -103,9 +106,9 @@ public class SkillList implements IBypassHandler
} }
text += "</body></html>"; text += "</body></html>";
NpcHtmlMessage html = new NpcHtmlMessage(((L2Npc)target).getObjectId()); NpcHtmlMessage html = new NpcHtmlMessage(((L2Npc) target).getObjectId());
html.setHtml(text); html.setHtml(text);
html.replace("%objectId%", String.valueOf(((L2Npc)target).getObjectId())); html.replace("%objectId%", String.valueOf(((L2Npc) target).getObjectId()));
activeChar.sendPacket(html); activeChar.sendPacket(html);
activeChar.sendPacket(ActionFailed.STATIC_PACKET); activeChar.sendPacket(ActionFailed.STATIC_PACKET);
...@@ -123,8 +126,9 @@ public class SkillList implements IBypassHandler ...@@ -123,8 +126,9 @@ public class SkillList implements IBypassHandler
return true; return true;
} }
@Override
public String[] getBypassList() public String[] getBypassList()
{ {
return COMMANDS; return COMMANDS;
} }
} }
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment