Call core method from NPC

This is not a Support area! Discuss about the Server here. Non-Server related discussion goes in Off-Topic Discussion.
Forum rules
READ NOW: L2j Forums Rules of Conduct
Post Reply
User avatar
pinkcore
Posts: 247
Joined: Fri Jul 24, 2009 3:04 am
Location: Czech Republic

Call core method from NPC

Post by pinkcore »

Hello, I'm doing rank system but I have little problem.
I can't found any example so I'm asking you there.

How can i call method from core / java scripts or something else by NPC's button / link.

For example I have method:

Code: Select all

public void checkForNewRank(){  // Do something}
And i want to call it by button / link from NPC. I never needed to combine Java with Html in this radius and i want to learn something new.

Thanks for replies :)
I'm not here only for food!
User avatar
Zoey76
L2j Inner Circle
L2j Inner Circle
Posts: 7008
Joined: Tue Aug 11, 2009 3:36 am

Re: Call core method from NPC

Post by Zoey76 »

Long way, you can create a bypass handler for that.

If the class that manage the NPC extends Quest you can use an event and onAdvEvent call that function.
Powered by Eclipse 4.34 🌌 | Eclipse Temurin 21 ☕ | MariaDB 11.3.2 🗃️ | L2J Server 2.6.3.0 - High Five 🚀

🔗 Join our Discord! 🎮💬
User avatar
pinkcore
Posts: 247
Joined: Fri Jul 24, 2009 3:04 am
Location: Czech Republic

Re: Call core method from NPC

Post by pinkcore »

Zoey76 wrote:Long way, you can create a bypass handler for that.

If the class that manage the NPC extends Quest you can use an event and onAdvEvent call that function.
I saw in many cases onBypass method for that but i really don't know how to make method call to <a href="bypass .......
It's out of my logic at this time, I need to explain it in myself or by someone there(so it will be faster).
I'm stuyding a logic of lot examples, but I need to sort it in my head. :D
I'm not here only for food!
User avatar
Szponiasty
Advanced User
Advanced User
Posts: 557
Joined: Mon Apr 21, 2008 1:31 pm
Location: Eastern Poland

Re: Call core method from NPC

Post by Szponiasty »

pinkcore wrote:
Zoey76 wrote:Long way, you can create a bypass handler for that.

If the class that manage the NPC extends Quest you can use an event and onAdvEvent call that function.
I saw in many cases onBypass method for that but i really don't know how to make method call to <a href="bypass .......
It's out of my logic at this time, I need to explain it in myself or by someone there(so it will be faster).
I'm stuyding a logic of lot examples, but I need to sort it in my head. :D
See .java scrips in data/scripts/handlers/bypasshandlers. Guess its self explanatory :)
And in the next chronicle they went into space, fighting the evil empire... In a galaxy far, far away xD
User avatar
pinkcore
Posts: 247
Joined: Fri Jul 24, 2009 3:04 am
Location: Czech Republic

Re: Call core method from NPC

Post by pinkcore »

Szponiasty wrote:
pinkcore wrote:
Zoey76 wrote:Long way, you can create a bypass handler for that.

If the class that manage the NPC extends Quest you can use an event and onAdvEvent call that function.
I saw in many cases onBypass method for that but i really don't know how to make method call to <a href="bypass .......
It's out of my logic at this time, I need to explain it in myself or by someone there(so it will be faster).
I'm stuyding a logic of lot examples, but I need to sort it in my head. :D
See .java scrips in data/scripts/handlers/bypasshandlers. Guess its self explanatory :)
:shock: Thanks you very much, I'v forget about this folder. Now it's fine :)

EDIT: I'm finally done, I'v created new Bypass handler. Thanks you very much guys for helping. :)
I'm not here only for food!
Post Reply