if you are selling something, you have to have both updated, right? people see forum first, not website.
if you are selling something, you have to have both updated, right? people see forum first, not website.
⏳ L2Elixir Open Beta goes live in less than 4 hours!
This Saturday, November 15th at 21:00 (UTC +2), the gates open for our biggest testing phase!
🔥 Don’t miss the first 30 minutes — exclusive rewards await!
A special NPC, “The Judge”, will appear in Giran, offering unique bonuses to early participants:
🏅 Open Beta Rewards:
- The first 2 players who talk to The Judge → Premium Account for Launch
- Another 2 random players who interact → Premium Account
- Everyone who speaks to the NPC within the first 30 minutes → Legendary Starter Pack for all characters on launch day (Nov 28th, 2025)
📌 The NPC will spawn exactly at 21:00 (UTC+2).
⏱️ Follow the countdown on our website — the hype is real!
Create your account & download the Updater to be ready!
🔗 https://l2elixir.org/connect/
💬 Discord: https://discord.gg/5ydPHvhbxs
Question
iAlreadyExist
hello guys im trying to install one remote class master on acis and i had one problem maybe u guys can help me
http://prnt.sc/bnij8r
all the code
### Eclipse Workspace Patch 1.0 #P L2jFanatic Index: dist/data/html/classmaster/tutorialtemplate.htm =================================================================== --- dist/data/html/classmaster/tutorialtemplate.htm (revision 0) +++ dist/data/html/classmaster/tutorialtemplate.htm (working copy) @@ -0,0 +1,13 @@ +<html> + <body> + <center>%name% Class Master:</center><br> + %menu% + <br><br> + Item(s) required for class change: + <table width=270> + %req_items% + </table> + <br><br> + <a action="link COXX">Ask me next time.</a> + </body> +</html> Index: java/net/sf/l2j/gameserver/model/actor/instance/L2ClassMasterInstance.java =================================================================== --- java/net/sf/l2j/gameserver/model/actor/instance/L2ClassMasterInstance.java (revision 5) +++ java/net/sf/l2j/gameserver/model/actor/instance/L2ClassMasterInstance.java (working copy) @@ -17,6 +17,7 @@ import java.util.List; import net.sf.l2j.Config; +import net.sf.l2j.gameserver.cache.HtmCache; import net.sf.l2j.gameserver.datatables.CharTemplateTable; import net.sf.l2j.gameserver.datatables.ItemTable; import net.sf.l2j.gameserver.model.actor.template.NpcTemplate; @@ -25,6 +26,9 @@ import net.sf.l2j.gameserver.network.SystemMessageId; import net.sf.l2j.gameserver.network.serverpackets.ActionFailed; import net.sf.l2j.gameserver.network.serverpackets.NpcHtmlMessage; +import net.sf.l2j.gameserver.network.serverpackets.TutorialCloseHtml; +import net.sf.l2j.gameserver.network.serverpackets.TutorialShowHtml; +import net.sf.l2j.gameserver.network.serverpackets.TutorialShowQuestionMark; import net.sf.l2j.gameserver.network.serverpackets.UserInfo; import net.sf.l2j.util.StringUtil; @@ -114,6 +118,53 @@ super.onBypassFeedback(player, command); } + public static final void onTutorialLink(L2PcInstance player, String request) + { + if (!Config.ALTERNATE_CLASS_MASTER || request == null || !request.startsWith("CO")) + return; + + if (!player.getFloodProtectors().getServerBypass().tryPerformAction("changeclass")) + return; + + try + { + int val = Integer.parseInt(request.substring(2)); + checkAndChangeClass(player, val); + } + catch (NumberFormatException e) + { + } + player.sendPacket(TutorialCloseHtml.STATIC_PACKET); + } + + public static final void onTutorialQuestionMark(L2PcInstance player, int number) + { + if (!Config.ALTERNATE_CLASS_MASTER || number != 1001) + return; + + showTutorialHtml(player); + } + + public static final void showQuestionMark(L2PcInstance player) + { + if (!Config.ALLOW_CLASS_MASTERS) + return; + + if (!Config.ALTERNATE_CLASS_MASTER) + return; + + final ClassId classId = player.getClassId(); + if (getMinLevel(classId.level()) > player.getLevel()) + return; + + if (!Config.CLASS_MASTER_SETTINGS.isAllowed(classId.level() + 1)) + { + return; + } + + player.sendPacket(new TutorialShowQuestionMark(1001)); + } + private static final void showHtmlMenu(L2PcInstance player, int objectId, int level) { NpcHtmlMessage html = new NpcHtmlMessage(objectId); @@ -203,6 +254,29 @@ player.sendPacket(html); } + private static final void showTutorialHtml(L2PcInstance player) + { + final ClassId currentClassId = player.getClassId(); + if (getMinLevel(currentClassId.level()) > player.getLevel() && !Config.ALLOW_ENTIRE_TREE) + return; + + String msg = HtmCache.getInstance().getHtm("data/html/classmaster/tutorialtemplate.htm"); + msg = msg.replaceAll("%name%", CharTemplateTable.getInstance().getClassNameById(currentClassId.getId())); + + final StringBuilder menu = new StringBuilder(100); + for (ClassId cid : ClassId.values()) + { + if (validateClassId(currentClassId, cid)) + { + StringUtil.append(menu, "<a action=\"link CO", String.valueOf(cid.getId()), "\">", CharTemplateTable.getInstance().getClassNameById(cid.getId()), "</a><br>"); + } + } + + msg = msg.replaceAll("%menu%", menu.toString()); + msg = msg.replace("%req_items%", getRequiredItems(currentClassId.level() + 1)); + player.sendPacket(new TutorialShowHtml(msg)); + } + private static final boolean checkAndChangeClass(L2PcInstance player, int val) { final ClassId currentClassId = player.getClassId(); @@ -255,6 +329,11 @@ player.setBaseClass(player.getActiveClass()); player.broadcastUserInfo(); + + if (Config.CLASS_MASTER_SETTINGS.isAllowed(player.getClassId().level() + 1) && Config.ALTERNATE_CLASS_MASTER && (((player.getClassId().level() == 1) && (player.getLevel() >= 40)) || ((player.getClassId().level() == 2) && (player.getLevel() >= 76)))) + { + showQuestionMark(player); + } return true; } Index: dist/config/npcs.properties =================================================================== --- dist/config/npcs.properties (revision 5) +++ dist/config/npcs.properties (working copy) @@ -78,6 +78,13 @@ # Default = False AllowEntireTree = False +# Then character reach levels 20,40,76 he will receive tutorial page +# with list of the all possible variants, and can select and immediately +# change to the new occupation, or decide to choose later (on next login). +# Can be used with or without classic Class Masters. +# Default = False +AlternateClassMaster = False + # Allow free teleportation around the world. AltFreeTeleporting = False Index: java/net/sf/l2j/Config.java =================================================================== --- java/net/sf/l2j/Config.java (revision 6) +++ java/net/sf/l2j/Config.java (working copy) @@ -306,6 +306,7 @@ public static boolean ALLOW_CLASS_MASTERS; public static ClassMasterSettings CLASS_MASTER_SETTINGS; public static boolean ALLOW_ENTIRE_TREE; + public static boolean ALTERNATE_CLASS_MASTER; public static boolean ANNOUNCE_MAMMON_SPAWN; public static boolean ALT_MOB_AGRO_IN_PEACEZONE; public static boolean ALT_GAME_FREE_TELEPORT; @@ -931,6 +932,7 @@ ALLOW_ENTIRE_TREE = npcs.getProperty("AllowEntireTree", false); if (ALLOW_CLASS_MASTERS) CLASS_MASTER_SETTINGS = new ClassMasterSettings(npcs.getProperty("ConfigClassMaster")); + ALTERNATE_CLASS_MASTER = npcs.getProperty("AlternateClassMaster", false); ALT_GAME_FREE_TELEPORT = npcs.getProperty("AltFreeTeleporting", false); ANNOUNCE_MAMMON_SPAWN = npcs.getProperty("AnnounceMammonSpawn", true); Index: java/net/sf/l2j/gameserver/network/clientpackets/EnterWorld.java =================================================================== --- java/net/sf/l2j/gameserver/network/clientpackets/EnterWorld.java (revision 5) +++ java/net/sf/l2j/gameserver/network/clientpackets/EnterWorld.java (working copy) @@ -32,6 +32,7 @@ import net.sf.l2j.gameserver.model.L2Clan; import net.sf.l2j.gameserver.model.L2Clan.SubPledge; import net.sf.l2j.gameserver.model.L2World; +import net.sf.l2j.gameserver.model.actor.instance.L2ClassMasterInstance; import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance; import net.sf.l2j.gameserver.model.entity.ClanHall; import net.sf.l2j.gameserver.model.entity.Couple; @@ -256,6 +257,8 @@ // Attacker or spectator logging into a siege zone will be ported at town. if (!activeChar.isGM() && (!activeChar.isInSiege() || activeChar.getSiegeState() < 2) && activeChar.isInsideZone(ZoneId.SIEGE)) activeChar.teleToLocation(MapRegionTable.TeleportWhereType.Town); + + L2ClassMasterInstance.showQuestionMark(activeChar); } private static void engage(L2PcInstance cha) Index: java/net/sf/l2j/gameserver/network/clientpackets/RequestTutorialQuestionMark.java =================================================================== --- java/net/sf/l2j/gameserver/network/clientpackets/RequestTutorialQuestionMark.java (revision 5) +++ java/net/sf/l2j/gameserver/network/clientpackets/RequestTutorialQuestionMark.java (working copy) @@ -14,6 +14,7 @@ */ package net.sf.l2j.gameserver.network.clientpackets; +import net.sf.l2j.gameserver.model.actor.instance.L2ClassMasterInstance; import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance; import net.sf.l2j.gameserver.model.quest.QuestState; @@ -34,6 +35,8 @@ if (player == null) return; + L2ClassMasterInstance.onTutorialQuestionMark(player, _number); + QuestState qs = player.getQuestState("Tutorial"); if (qs != null) qs.getQuest().notifyEvent("QM" + _number + "", null, player); Index: java/net/sf/l2j/gameserver/network/clientpackets/RequestTutorialLinkHtml.java =================================================================== --- java/net/sf/l2j/gameserver/network/clientpackets/RequestTutorialLinkHtml.java (revision 5) +++ java/net/sf/l2j/gameserver/network/clientpackets/RequestTutorialLinkHtml.java (working copy) @@ -14,6 +14,7 @@ */ package net.sf.l2j.gameserver.network.clientpackets; +import net.sf.l2j.gameserver.model.actor.instance.L2ClassMasterInstance; import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance; import net.sf.l2j.gameserver.model.quest.QuestState; @@ -34,6 +35,8 @@ if (player == null) return; + L2ClassMasterInstance.onTutorialLink(player, _bypass); + QuestState qs = player.getQuestState("Tutorial"); if (qs != null) qs.getQuest().notifyEvent(_bypass, null, player); Index: java/net/sf/l2j/gameserver/model/actor/stat/PcStat.java =================================================================== --- java/net/sf/l2j/gameserver/model/actor/stat/PcStat.java (revision 5) +++ java/net/sf/l2j/gameserver/model/actor/stat/PcStat.java (working copy) @@ -18,6 +18,7 @@ import net.sf.l2j.gameserver.datatables.NpcTable; import net.sf.l2j.gameserver.datatables.PetDataTable; import net.sf.l2j.gameserver.model.actor.L2Character; +import net.sf.l2j.gameserver.model.actor.instance.L2ClassMasterInstance; import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance; import net.sf.l2j.gameserver.model.actor.instance.L2PetInstance; import net.sf.l2j.gameserver.model.base.Experience; @@ -164,6 +165,8 @@ getActiveChar().setCurrentCp(getMaxCp()); getActiveChar().broadcastPacket(new SocialAction(getActiveChar(), 15)); getActiveChar().sendPacket(SystemMessageId.YOU_INCREASED_YOUR_LEVEL); + + L2ClassMasterInstance.showQuestionMark(getActiveChar()); } getActiveChar().rewardSkills(); // Give Expertise skill of this levelEdited by haskovo15 answers to this question
Recommended Posts