We moved our repositories to BitBucket!

If you can't login or you can't register to the forums do not rise an issue, instead please write to support (at) l2jserver.com

Check our wiki!

Report server issues here

Forum has been updated to phpBB 3.2, let's see if this fixes some minor bugs we had.

Thank you for visiting http://www.l2jserver.com/

How start quest even in onAdvEvent

If something doesn't fit in any other forum then post it here.
Forum rules
READ NOW: L2j Forums Rules of Conduct
Post Reply
User avatar
KGB1st
Posts: 225
Joined: Sat Jul 26, 2014 5:58 pm
Location: ИРК, РФ, СИБИРЬ!
Contact:

How start quest even in onAdvEvent

Post by KGB1st » Mon Nov 16, 2015 6:14 am

I've some event in onAdvEvent. In this event I wrote a html and sended result to player.

Code: Select all

@Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{
   case "some event":
   {
      String some_html = "<button ... -bypass COMMAND .../>";
      
      showResult(player, some_html, null);
      
      break;
   }
   
   if(event.startsWith("COMMAND"))
   {
      SOME CODE HERE.. AND FROM HERE I NEED REDIRECT PLAYER BACK to THE "some event"
   }
   
   return htmltext;
   
   // it's example :\
}
This some_html contains another bypass command, I need redirecting player again to the "some event" after using this command.
Can you help me? Pls.... :roll:
Last edited by KGB1st on Wed Nov 18, 2015 7:27 am, edited 1 time in total.
SPOILER:
Image
### GameServer: Started, free memory 1794 Mb of 3641 Mb
## -Xms2048m -Xmx4096m -XX:+AggressiveOpts
# GameServer: Server loaded in 51 seconds.

User avatar
Gladicek
Posts: 633
Joined: Wed Jan 19, 2011 6:25 pm
Location: Czech Republic

Re: How start quest even in onAdvEvent

Post by Gladicek » Mon Nov 16, 2015 11:33 am

First at all it should be like this (only one event now :problem: ) And now I don't get that what you wanna do next. You wanna call this event again or another one?
Gist by: Gladicek
ImageImage
L2J retired

User avatar
KGB1st
Posts: 225
Joined: Sat Jul 26, 2014 5:58 pm
Location: ИРК, РФ, СИБИРЬ!
Contact:

Re: How start quest even in onAdvEvent

Post by KGB1st » Mon Nov 16, 2015 1:37 pm

Gladicek wrote:And now I don't get that what you wanna do next. You wanna call this event again or another one?

Code: Select all

@Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{
   case "some event":
   {
      String some_html = "<button ... -bypass COMMAND .../>";
      
      showResult(player, some_html, null);
      
      break;
   }
   
   if(event.startsWith("COMMAND"))
   {
      SOME CODE HERE.. AND FROM HERE I NEED REDIRECT PLAYER BACK to THE "some event"
   }
   
   return htmltext;
   
   // it's example :\
}
SPOILER:
Image
### GameServer: Started, free memory 1794 Mb of 3641 Mb
## -Xms2048m -Xmx4096m -XX:+AggressiveOpts
# GameServer: Server loaded in 51 seconds.

User avatar
Gladicek
Posts: 633
Joined: Wed Jan 19, 2011 6:25 pm
Location: Czech Republic

Re: How start quest even in onAdvEvent

Post by Gladicek » Mon Nov 16, 2015 1:55 pm

You wanna call that event again? Why? :D You can call just for htmltext some_html to show that bypass again from COMMAND event. Or its gonna do something when you call some_event again? It would be easier when you would say what that thing should do, because for now its retarded (no offense).
ImageImage
L2J retired

User avatar
KGB1st
Posts: 225
Joined: Sat Jul 26, 2014 5:58 pm
Location: ИРК, РФ, СИБИРЬ!
Contact:

Re: How start quest even in onAdvEvent

Post by KGB1st » Mon Nov 16, 2015 6:01 pm

wtf? Is my request hard? I need use some functon for this bypass and redirect player again on the same html.
I told about it because I'm too lazy for creating new html files.
SPOILER:
Image
### GameServer: Started, free memory 1794 Mb of 3641 Mb
## -Xms2048m -Xmx4096m -XX:+AggressiveOpts
# GameServer: Server loaded in 51 seconds.

User avatar
Gladicek
Posts: 633
Joined: Wed Jan 19, 2011 6:25 pm
Location: Czech Republic

Re: How start quest even in onAdvEvent

Post by Gladicek » Mon Nov 16, 2015 8:13 pm

Gladicek wrote:You wanna call that event again? Why? :D You can call just for htmltext some_html to show that bypass again from COMMAND event. Or its gonna do something when you call some_event again? It would be easier when you would say what that thing should do, because for now its retarded (no offense).
htmltext = "some_html";
ImageImage
L2J retired

User avatar
KGB1st
Posts: 225
Joined: Sat Jul 26, 2014 5:58 pm
Location: ИРК, РФ, СИБИРЬ!
Contact:

Re: How start quest even in onAdvEvent

Post by KGB1st » Tue Nov 17, 2015 8:10 am

I understand. Make this String to public and call with showResult? :think:
It works but variables in this part not changed. It's dynamic HTML - it's answer for your question why called again/
SPOILER:
Image
### GameServer: Started, free memory 1794 Mb of 3641 Mb
## -Xms2048m -Xmx4096m -XX:+AggressiveOpts
# GameServer: Server loaded in 51 seconds.

User avatar
Gladicek
Posts: 633
Joined: Wed Jan 19, 2011 6:25 pm
Location: Czech Republic

Re: How start quest even in onAdvEvent

Post by Gladicek » Tue Nov 17, 2015 12:17 pm

And that's why I asked you for "complete" info about it.
ImageImage
L2J retired

User avatar
KGB1st
Posts: 225
Joined: Sat Jul 26, 2014 5:58 pm
Location: ИРК, РФ, СИБИРЬ!
Contact:

Re: How start quest even in onAdvEvent

Post by KGB1st » Tue Nov 17, 2015 1:40 pm

I'm not pro in Java and can not understand many questions correctly :wave:
SPOILER:
Image
### GameServer: Started, free memory 1794 Mb of 3641 Mb
## -Xms2048m -Xmx4096m -XX:+AggressiveOpts
# GameServer: Server loaded in 51 seconds.

User avatar
SaveGame
Posts: 121
Joined: Thu Oct 30, 2014 9:54 pm

Re: How start quest even in onAdvEvent

Post by SaveGame » Tue Nov 17, 2015 5:57 pm

KGB1st wrote:I'm not pro in English and can not understand many questions correctly :wave:
fixed :problem:
Image

User avatar
KGB1st
Posts: 225
Joined: Sat Jul 26, 2014 5:58 pm
Location: ИРК, РФ, СИБИРЬ!
Contact:

Re: How start quest even in onAdvEvent

Post by KGB1st » Wed Nov 18, 2015 7:27 am

Close. Changed.
SPOILER:
Image
### GameServer: Started, free memory 1794 Mb of 3641 Mb
## -Xms2048m -Xmx4096m -XX:+AggressiveOpts
# GameServer: Server loaded in 51 seconds.

HorridoJoho
L2j Senior Developer
L2j Senior Developer
Posts: 795
Joined: Sun Aug 14, 2005 11:27 am

Re: How start quest even in onAdvEvent

Post by HorridoJoho » Thu Jun 08, 2017 3:56 pm

Code: Select all

@Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{
    String htmltext = null;

    switch (event)
    {
        case "COMMAND":
            // do COMMAND things
            // don't put break; so "some event" is executed after this "COMMAND" and when event is "some event"
        case "some event":
            htmltext = "<button ... -bypass COMMAND .../>";
            break;
    }

    return htmltext;
}

User avatar
Sdw
L2j Veteran
L2j Veteran
Posts: 855
Joined: Mon May 03, 2010 8:38 am
Location: France

Re: How start quest even in onAdvEvent

Post by Sdw » Sun Jul 09, 2017 10:00 am

You got owned by a bot, nize

philippe05
Posts: 1
Joined: Wed Feb 20, 2019 2:33 pm

Re: How start quest even in onAdvEvent

Post by philippe05 » Wed Feb 20, 2019 2:35 pm

Gladicek wrote:
Mon Nov 16, 2015 1:55 pm
You wanna call that event again? Why? :D You can call just for htmltext some_html to show that bypass again from COMMAND event. Or its gonna do something when you call some_event again référenceur freelance paris ? It would be easier when you would say what that thing should do, because for now its retarded (no offense).
Maybe it's just a small delay to the too many deliveries they have to make.

Post Reply