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?
You can post now and register later.
If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.
EVERYTHING THEY CAN INVENT IS USELESS! 🙂 ANY PERSON IN THIS ERA CAN CONSULT CHATGPT AND KNOW THE TRUTH THAT YOU ARE THE DONKEYS AND THAT PRACTICALLY IN L2OFF USE ALMOST EVERYTHING I GENERATE, ANY L2OFF SERVER YOU SEE HAS MY CODES AND YOU KNOW WHAT???
YOU CAN'T AVOID IT 😉
aCis is one of the oldest live pack after L2J (dec 2010) - it focuses solely on retailness and vanilla concept, over IL chronicle. It got a public and private gitlabs, because open source in L2J community is either toxic (resell/steal your work) or ungrateful. Still, a public rev is shared from time to time.
Regarding junior acceptance, you can contribute based on public revision, earn "cookies" and when you reach a given amount you can be directly registered into the private gitlab (such as Bandnentans lately). You can review all ppl who worked over aCis here : https://acis.i-live.eu/index.php?action=hof
I already had good experience with one argentinian, fernandopm, which worked under scripts rework back in 2011-2013. He came with 0 knowledge, but in the end could produce scripts.
You can check sources under https://gitlab.com/Tryskell/acis_public and join the Discord, if interested.
hello i am interested on purchasing can i get some discount if i purchase multiple system for acis 😃
i can not message you on discord your account is private
Question
Archagnel
Hello I wanted to create custom npc which has also ability to enchant skills. I copied function from L2NpcInstance:
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 :
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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.