Page 1 of 1
Call core method from NPC
Posted: Fri Oct 22, 2010 9:07 pm
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

Re: Call core method from NPC
Posted: Fri Oct 22, 2010 10:01 pm
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.
Re: Call core method from NPC
Posted: Fri Oct 22, 2010 10:34 pm
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.

Re: Call core method from NPC
Posted: Sat Oct 23, 2010 1:28 am
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.

See .java scrips in data/scripts/handlers/bypasshandlers. Guess its self explanatory

Re: Call core method from NPC
Posted: Sat Oct 23, 2010 10:37 am
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.

See .java scrips in data/scripts/handlers/bypasshandlers. Guess its self explanatory


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.
