+ "_Subclass 5 0\">" + CharTemplateTable.getClassNameById(baseClassId)
+ "</a> " + "<font color=\"LEVEL\">(Base Class)</font><br><br>");
for (Iterator<SubClass> subList = iterSubClasses(player); subList.hasNext();)
{
SubClass subClass = subList.next();
int subClassId = subClass.getClassId();
if (subClassId == player.getActiveClass()) content.append(CharTemplateTable.getClassNameById(subClassId)
+ "<br>");
else content.append("<a action=\"bypass -h npc_" + getObjectId()
+ "_Subclass 5 " + subClass.getClassIndex() + "\">"
+ CharTemplateTable.getClassNameById(subClassId) + "</a><br>");
}
}
break;
case 3: // Change/Cancel Subclass - Initial
content.append("Change Subclass:<br>Which of the following sub classes would you like to change?<br>");
int classIndex = 1;
for (Iterator<SubClass> subList = iterSubClasses(player); subList.hasNext();)
{
SubClass subClass = subList.next();
content.append("Sub-class " + classIndex + "<br1>");
content.append("<a action=\"bypass -h npc_" + getObjectId() + "_Subclass 6 "
+ subClass.getClassIndex() + "\">"
+ CharTemplateTable.getClassNameById(subClass.getClassId()) + "</a><br>");
classIndex++;
}
content.append("<br>If you change a sub class, you'll start at level 40 after the 2nd class transfer.");
break;
case 4: // Add Subclass - Action (Subclass 4 x[x])
boolean allowAddition = true;
/*
* If the character is less than level 75 on any of their previously chosen
* classes then disallow them to change to their most recently added sub-class choice.
*/
if (player.getLevel() < 75)
{
player.sendMessage("You may not add a new sub class before you are level 75 on your previous class.");
allowAddition = false;
}
if (Olympiad.getInstance().isRegisteredInComp(player)
|| player.getOlympiadGameId() > 0)
{
player.sendPacket(new SystemMessage(
SystemMessageId.YOU_HAVE_ALREADY_BEEN_REGISTERED_IN_A_WAITING_LIST_OF_AN_EVENT));
return;
}
if (allowAddition)
{
if (!player.getSubClasses().isEmpty())
{
for (Iterator<SubClass> subList = iterSubClasses(player); subList.hasNext();)
{
SubClass subClass = subList.next();
if (subClass.getLevel() < 75)
{
player.sendMessage("You may not add a new sub class before you are level 75 on your previous sub class.");
allowAddition = false;
break;
}
}
}
}
/*
* If quest checking is enabled, verify if the character has completed the Mimir's Elixir (Path to Subclass)
* and Fate's Whisper (A Grade Weapon) quests by checking for instances of their unique reward items.
*
* If they both exist, remove both unique items and continue with adding the sub-class.
*/
if (!Config.ALT_GAME_SUBCLASS_WITHOUT_QUESTS)
{
QuestState qs = player.getQuestState("235_MimirsElixir");
if(qs == null || !qs.isCompleted())
{
player.sendMessage("You must have completed the Mimir's Elixir quest to continue adding your sub class.");
return;
}
qs = player.getQuestState("234_FatesWhisper");
if(qs == null || !qs.isCompleted())
{
player.sendMessage("You must have completed the Fate's Whisper quest to continue adding your sub class.");
return;
}
}
////////////////// \\\\\\\\\\\\\\\\\\
if (allowAddition)
{
String className = CharTemplateTable.getClassNameById(paramOne);
if (!player.addSubClass(paramOne, player.getTotalSubClasses() + 1))
{
player.sendMessage("The sub class could not be added.");
return;
}
player.setActiveClass(player.getTotalSubClasses());
content.append("Add Subclass:<br>The sub class of <font color=\"LEVEL\">"
+ className + "</font> has been added.");
player.sendPacket(new SystemMessage(SystemMessageId.CLASS_TRANSFER)); // Transfer to new class.
}
else
{
html.setFile("data/html/villagemaster/SubClass_Fail.htm");
}
break;
case 5: // Change Class - Action
/*
* If the character is less than level 75 on any of their previously chosen
* classes then disallow them to change to their most recently added sub-class choice.
*
* Note: paramOne = classIndex
*/
if (Olympiad.getInstance().isRegisteredInComp(player)
|| player.getOlympiadGameId() > 0)
{
player.sendPacket(new SystemMessage(
SystemMessageId.YOU_HAVE_ALREADY_BEEN_REGISTERED_IN_A_WAITING_LIST_OF_AN_EVENT));
return;
}
player.setActiveClass(paramOne);
content.append("Change Subclass:<br>Your active sub class is now a <font color=\"LEVEL\">"
+ CharTemplateTable.getClassNameById(player.getActiveClass()) + "</font>.");
player.sendPacket(new SystemMessage(SystemMessageId.SUBCLASS_TRANSFER_COMPLETED)); // Transfer completed.
break;
case 6: // Change/Cancel Subclass - Choice
content.append("Please choose a sub class to change to. If the one you are looking for is not here, "
+ "please seek out the appropriate master for that class.<br>"
+ "<font color=\"LEVEL\">Warning!</font> All classes and skills for this class will be removed.<br><br>");
subsAvailable = getAvailableSubClasses(player);
if (subsAvailable != null && !subsAvailable.isEmpty())
{
for (PlayerClass subClass : subsAvailable)
content.append("<a action=\"bypass -h npc_" + getObjectId() + "_Subclass 7 "
+ paramOne + " " + subClass.ordinal() + "\">"
+ formatClassForDisplay(subClass) + "</a><br>");
}
else
{
player.sendMessage("There are no sub classes available at this time.");