private static void checkClassMaster(QuestState st)
{
Player player = st.getPlayer();
if (!checkCanSeeTutorial(player))
{
addToTutorialQueue(player, "OpenClassMaster");
return;
}
ClassId classId = player.getClassId();
int jobLevel = classId.getLevel();
if (Config.ALLOW_CLASS_MASTERS_LIST.isEmpty() || !Config.ALLOW_CLASS_MASTERS_LIST.contains(jobLevel))
jobLevel = 4;
if (canChangeClass(player, jobLevel))
{
StringBuilder html = new StringBuilder();
html.append("<html noscrollbar><head><title>L2Mythras Newbie Tutorial</title></head>");
html.append("<body>");
html.append("<table border=0 cellpadding=0 cellspacing=0 width=292 height=310 background=\"l2ui_ct1.Windows_DF_TooltipBG\">");
html.append("<tr><td align=center><br>");
html.append("<table width=280><tr><td align=center valign=center>");
html.append("<img src=\"L2UI.squaregray\" width=285 height=1/> ");
html.append("<font name=hs12 color=3399FF>L2Mythras</font>");
html.append("<img src=\"L2UI.squaregray\" width=285 height=1/>");
html.append("</td></tr></table>");
html.append("<br></td></tr><tr>");
html.append("<td align=center height=150>");
html.append("<table width=280><tr><td align=center><img src=\"tut.logo2\" width=240 height=64></td></tr>");
html.append("<tr><td align=center><br><font color=LEVEL name=hs12>Welcome to L2Mythras ! </font></td></tr>");
html.append("</table>");
html.append("<br1>");
html.append("<table width=280><tr><td align=center>");
html.append("<font color=00ff99>").append(player.getName()).append("</font> change your class for <font color=\"LEVEL\">").append(Util.formatAdena(Config.CLASS_MASTERS_PRICE_LIST[jobLevel])).append(" Adena</font>!<br1>");
html.append("</td></tr></table>");
html.append("<table width=280>");
for (ClassId cid : ClassId.values())
{
if (cid != ClassId.inspector && cid.childOf(classId) && cid.level() == classId.level() + 1)
{
String name = cid.name().substring(0, 1).toUpperCase() + cid.name().substring(1);
html.append("<tr><td align=center><button value=\"").append(name).append("\" action=\"bypass -h ChangeTo;").append(cid.getId()).append(';').append(Config.CLASS_MASTERS_PRICE_LIST[jobLevel]).append("\" width=200 height=32 back=\"L2UI_CT1.OlympiadWnd_DF_HeroConfirm_Down\" fore=\"L2UI_CT1.OlympiadWnd_DF_HeroConfirm\"></td></tr>");
}
}
html.append("<tr><td align=center><button value=\"Remind me later\" action=\"bypass CloseTutorial\" width=200 height=28 back=\"L2UI_CT1.OlympiadWnd_DF_Back_Down\" fore=\"L2UI_CT1.OlympiadWnd_DF_Back\"></td></tr>");
html.append("</table>");
html.append("</td></tr><tr>");
html.append("<td align=center><table width=280><tr>");
html.append("<td align=center valign=center>");
html.append("<img src=\"L2UI.squaregray\" width=285 height=1/> ");
html.append("<font name=hs12 color=3399FF>L2Mythras</font>");
html.append("<img src=\"L2UI.squaregray\" width=285 height=1/> ");
html.append("</td></tr></table><br></td></tr>");
html.append("</table></body></html>");
st.closeTutorial(); // Close the tutorial first so the other html can be shown
st.showTutorialHTML(html.toString());
}
}
/**
* Checking if player have got level >= 20, >= 40 or >= 76 and still didn't change class
* @param player to check
* @param jobLevel level of the class
* @return can change class
*/
private static boolean canChangeClass(Player player, int jobLevel)
{
int level = player.getLevel();
if (!Config.ALLOW_CLASS_MASTERS_LIST.contains(jobLevel))
return false;
if (level >= 20 && jobLevel == 1)
return true;
if (level >= 40 && jobLevel == 2)
return true;
if (level >= 76 && jobLevel == 3)
return true;
return false;
}