Hello I wanted to create custom npc which has also ability to enchant skills. I copied function from L2NpcInstance:
public static void showEnchantSkillList(L2PcInstance player, L2Npc npc, ClassId classId)
{
if (((L2NpcInstance) npc).getClassesToTeach() == null)
{
NpcHtmlMessage html = new NpcHtmlMessage(npc.getObjectId());
final String sb = StringUtil.concat("<html><body>I cannot teach you.
My class list is empty.<br>Ask admin to fix it. Need add my npcid and classes to skill_learn.sql.<br>NpcId:",
String.valueOf(npc.getTemplate().getNpcId()), ", Your classId:", String.valueOf(player.getClassId().getId()), "<br></body></html>");
html.setHtml(sb);
player.sendPacket(html);
return;
}
if (!npc.getTemplate().canTeach(classId))
{
NpcHtmlMessage html = new NpcHtmlMessage(npc.getObjectId());
html.setHtml("<html><body>I cannot teach you any skills.<br>You must find your current class teachers. </body></html>");
player.sendPacket(html);
return;
}
if (player.getClassId().level() < 3)
{
NpcHtmlMessage html = new NpcHtmlMessage(npc.getObjectId());
html.setHtml("<html><body> You must have 3rd class change quest completed.</body></html>");
player.sendPacket(html);
return;
}
ExEnchantSkillList esl = new ExEnchantSkillList();
boolean empty = true;
List<L2EnchantSkillLearn> esll = SkillTreeTable.getInstance().getAvailableEnchantSkills(player);
for (L2EnchantSkillLearn skill : esll)
{
L2Skill sk = SkillTable.getInstance().getInfo(skill.getId(), skill.getLevel());
if (sk == null)
continue;
L2EnchantSkillData data = SkillTreeTable.getInstance().getEnchantSkillData(skill.getEnchant());
if (data == null)
continue;
esl.addSkill(skill.getId(), skill.getLevel(), data.getCostSp(), data.getCostExp());
empty = false;
}
if (empty)
{
player.sendPacket(SystemMessageId.THERE_IS_NO_SKILL_THAT_ENABLES_ENCHANT);
if (player.getLevel() < 74)
player.sendPacket(SystemMessage.getSystemMessage(
SystemMessageId.DO_NOT_HAVE_FURTHER_SKILLS_TO_LEARN_S1).addNumber(74));
else
player.sendPacket(SystemMessageId.NO_MORE_SKILLS_TO_LEARN);
}
else
player.sendPacket(esl);
player.sendPacket(ActionFailed.STATIC_PACKET);
}
When I click on button it shows me list with all availables skill which can be enchanted, but when I click on any window dissapears. This function is called from :
public void onBypassFeedback(L2PcInstance player, String command)
{
if (command.startsWith("SkillList"))
{
player.setSkillLearningClassId(player.getClassId());
showSkillList(player, player.getCurrentFolkNPC(), player.getClassId());
}
else if (command.startsWith("EnchantSkillList"))
showEnchantSkillList(player, player.getCurrentFolkNPC(), player.getClassId());
else if (command.startsWith("GiveBlessing"))
giveBlessingSupport(player);
else
super.onBypassFeedback(player, command);
}
So I thought it is enough just to copy it, because there is nothing more called to show description after clicking on skill. Anybody knows where can I intercept that clicking on skill so I could write that code to display it?
Where was I called a scammer? Is there any proof, etc.? There are a lot of reviews about our store online, etc.
https://zhyk.org/forum/showthread.php?t=1108673
🔍 Inventory 1.0 is a next-generation inventory system that stands out with its special minimal clothing system. Carefully designed and prepared according to the highest standards of your server, it not only enhances your gaming experience but also contributes to your server's infrastructure.
⚙️ Supported: QB-CORE
Features:
✅ Instant Delivery: All products you purchase will be instantly assigned to your account as soon as your payment is completed.
✅ Clothing System: With the special animated clothing configurations in your inventory, you will be able to change outfits with ease. Experience a unique roleplaying experience with high-quality animations and customizable clothing options.
✅ Minimalist Inventory System: This inventory system, with its visuals, animations, and mechanics, offers maximum efficiency without overwhelming your screen and limiting your roleplaying experience. It’s designed to be user-friendly while enhancing your roleplaying experience.
✅ Continuous Updates: The content in the inventory is regularly updated with innovative features added. New animations, additional clothing options, and cutting-edge features ensure a fresh and dynamic experience.
✅ Easy Setup and Compatibility: Compatible with QB-CORE, this system is easy to install and optimized for quick integration into your server. It works seamlessly with a simple drag-and-drop method.
✅ Performance Optimization: The system is optimized to avoid low FPS and performance drops. All features of the inventory run smoothly without affecting your server’s performance.
✅ Multilingual Support: With support for different languages, you can cater to an international player base and build a larger community on your server.
✅ Flexible Customization Options: You can fully customize the inventory according to your needs and server rules. Choose between different outfits and animations to create a unique gaming experience.
✅ Comprehensive Help and Support: With 24/7 support, you can quickly resolve any issues you encounter. Our technical support and user guides are always here to assist you.
Shop Now! Take your game to the next level with Inventory 1.0 and enjoy its unique features. Get ready to make a real difference in your roleplaying experience!
--------------------------TEBEX: https://matza.tebex.io/package/7174862 --------------------------
Question
Archagnel
Hello I wanted to create custom npc which has also ability to enchant skills. I copied function from L2NpcInstance:
public static void showEnchantSkillList(L2PcInstance player, L2Npc npc, ClassId classId) { if (((L2NpcInstance) npc).getClassesToTeach() == null) { NpcHtmlMessage html = new NpcHtmlMessage(npc.getObjectId()); final String sb = StringUtil.concat("<html><body>I cannot teach you. My class list is empty.<br>Ask admin to fix it. Need add my npcid and classes to skill_learn.sql.<br>NpcId:", String.valueOf(npc.getTemplate().getNpcId()), ", Your classId:", String.valueOf(player.getClassId().getId()), "<br></body></html>"); html.setHtml(sb); player.sendPacket(html); return; } if (!npc.getTemplate().canTeach(classId)) { NpcHtmlMessage html = new NpcHtmlMessage(npc.getObjectId()); html.setHtml("<html><body>I cannot teach you any skills.<br>You must find your current class teachers. </body></html>"); player.sendPacket(html); return; } if (player.getClassId().level() < 3) { NpcHtmlMessage html = new NpcHtmlMessage(npc.getObjectId()); html.setHtml("<html><body> You must have 3rd class change quest completed.</body></html>"); player.sendPacket(html); return; } ExEnchantSkillList esl = new ExEnchantSkillList(); boolean empty = true; List<L2EnchantSkillLearn> esll = SkillTreeTable.getInstance().getAvailableEnchantSkills(player); for (L2EnchantSkillLearn skill : esll) { L2Skill sk = SkillTable.getInstance().getInfo(skill.getId(), skill.getLevel()); if (sk == null) continue; L2EnchantSkillData data = SkillTreeTable.getInstance().getEnchantSkillData(skill.getEnchant()); if (data == null) continue; esl.addSkill(skill.getId(), skill.getLevel(), data.getCostSp(), data.getCostExp()); empty = false; } if (empty) { player.sendPacket(SystemMessageId.THERE_IS_NO_SKILL_THAT_ENABLES_ENCHANT); if (player.getLevel() < 74) player.sendPacket(SystemMessage.getSystemMessage( SystemMessageId.DO_NOT_HAVE_FURTHER_SKILLS_TO_LEARN_S1).addNumber(74)); else player.sendPacket(SystemMessageId.NO_MORE_SKILLS_TO_LEARN); } else player.sendPacket(esl); player.sendPacket(ActionFailed.STATIC_PACKET); }When I click on button it shows me list with all availables skill which can be enchanted, but when I click on any window dissapears. This function is called from :
public void onBypassFeedback(L2PcInstance player, String command) { if (command.startsWith("SkillList")) { player.setSkillLearningClassId(player.getClassId()); showSkillList(player, player.getCurrentFolkNPC(), player.getClassId()); } else if (command.startsWith("EnchantSkillList")) showEnchantSkillList(player, player.getCurrentFolkNPC(), player.getClassId()); else if (command.startsWith("GiveBlessing")) giveBlessingSupport(player); else super.onBypassFeedback(player, command); }So I thought it is enough just to copy it, because there is nothing more called to show description after clicking on skill. Anybody knows where can I intercept that clicking on skill so I could write that code to display it?
15 answers to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now