Post Pacific

Post Pacific (https://postpacific.mmorpg-game.online/index.php)
-   Lineage 2 Server Modifications ONLY! (https://postpacific.mmorpg-game.online/forumdisplay.php?f=28)
-   -   [SHARE][TUTORIAL]AI.OBJ (https://postpacific.mmorpg-game.online/showthread.php?t=2367)

TheOrder 18.01.2006 07:23

Tnx for the AI functions kvoxi , realy helpfull !!!

toolpunk 18.01.2006 08:57

very nice info again...
however static left us some time ago...
he visits the forum once in a while but doesnt post anymore :(

2Rain 19.01.2006 02:24

push_const 1003
func_call 65 // func[GetOneTimeQuestFlag]

This is string for 1-time quest.
How make 2-time quest (not multi)?

PS: I see... Need make dual checking in each for 1-time quest. If first checking returns (quest complete)? than go to checking2.

So, if ch1 & ch2 not conmleted - may jump to run quest.
If ch1 completed - jump ch2. If ch2 not completed - may jump to run quest.
If ch1 & ch2 are completed - jump ti "Go to asshole, dude!" :lol:

Special thanks to kvoxi for представленную инфу. :wink:

PPS: I think, in this case must found 2 different Quest ID.

kvoxi 19.01.2006 19:01

Quote:

Originally Posted by 2Rain
PPS: I think, in this case must found 2 different Quest ID.

I think too
But, i have some idea. I need a check. I will post results later

kvoxi 20.01.2006 16:11

Quote:

Originally Posted by kvoxi
But, i have some idea. I need a check. I will post results later

i got this results:
SetOneTimeQuestFlag(creature, quest_id, flag)
flag=GetOneTimeQuestFlag(creature, quest_id)
flag=[0,1]

There is QuestFlag_bitmask.
How it works (C-like language):

SetOneTimeQuestFlag():
flag<>0: creature.QuestFlag_bitmask |= 1 << quest_id;
flag==0: creature.QuestFlag_bitmask &= ~(1 << quest_id);

GetOneTimeQuestFlag():
(creature.QuestFlag_bitmask & 1 << quest_id) ? 1:0;

If quest_id <0 or quest_id > 255, then u get error.
ONLY quests with ID>=0 && ID<=255 can have a OneTimeQuestFlag
Conclusion: Set|GetOneTimeQuestFlag() functions is not usefull for making 2-time quest.

Try to use SetMemoState|GetMemoState functions.
good luck

SlayerX 20.01.2006 19:35

very nice :P

RmzVoid 25.01.2006 12:40

wtf
 
class citizen
{
EventHandler TALKED(talker)
{
ShowPage(talker,"sm_hi.htm");
}
}

class sample : citizen
{
handler:
EventHandler TALK_SELECTED(talker)
{
if ( _from_choice == 0 )
{
//Do something
}
if ( _from_choice == 1 )
{
//Do something 2
}
}

EventHandler MENU_SELECTED(talker, ask ,reply)
{
if(ask == 2)
{
if ( reply == 33 )
{
AddChoice(2,"choice 0 2");
AddChoice(3,"choice 0 2");
ShowChoicePage(talker,0);
}
if ( reply == 34 )
{
AddChoice(6,"choice 1 6");
AddChoice(7,"choice 1 7");
ShowChoicePage(talker,1);
}
}
}

When I select reply 34, I see list of choices and then press on one choice I enter in TALK_SELECTED handler and normally exec "if ( _from_choice == 1 ){..}" block. But if I select reply 33 I also see appropriate choices, but not enter to TALK_SELECTED handler then i select one of choice, I just see sm_hi.htm page again. Can anybody help me? How use ShowChoicePage func?

kvoxi 25.01.2006 21:28

Re: wtf
 
Quote:

Originally Posted by RmzVoid
Can anybody help me? How use ShowChoicePage func?

IMHO:
ShowChoicePage(crature, from_choice);
The call ShowChoicePage(talker,0) set _from_choice to 0;

RmzVoid 26.01.2006 00:26

My post explains thet is not.
ShowChoicePage (talker,2) also not works. I mean if ( _from_choce == 2 ) { ... }

kvoxi 26.01.2006 07:10

Quote:

Originally Posted by RmzVoid
My post explains thet is not.
ShowChoicePage (talker,2) also not works. I mean if ( _from_choce == 2 ) { ... }

ShowChoicePage(talker, option)
What is "option" - i dont know
All choices must be processed by TALK_SELECTED handler in <if(_from_choice==1) {...}> branch

PS:
func ShowChoicePage pass the user HTML like:
<HTML><BODY>
<a action="bypass -h quest_choice?choice="<Choice_1>"&option="<Option>" >["<Choice_1 string>"]</a>
...
<a action="bypass -h quest_choice?choice="<Choice_N>"&option="<Option>" >["<Choice_N string>"]</a>

</BODY></HTML>

RmzVoid 26.01.2006 09:10

so maybe use choice & option variables?
Or you mean
<a action="bypass -h quest_choice?_from_choice=2&_code=3">["<Choice_1 string>"]</a>
?

kvoxi 26.01.2006 10:18

Quote:

Originally Posted by RmzVoid
so maybe use choice & option variables?
Or you mean
<a action="bypass -h quest_choice?_from_choice=2&_code=3">["<Choice_1 string>"]</a>
?

I mean
<a action="bypass -h quest_choice?choice="<Choice_1>"&option="<Option>" >["<Choice_1 string>"]</a>
and NOTHING ELSE!!!
Where u see "quest_choice?_from_choice=..." ???
no more comments...
PS:
in AI u mau use:
_from_choice (=1 if TALK_SELECTED handler process "bypass -h quest_choice" user request)
_code (=choice from HTML)

RmzVoid 26.01.2006 11:25

and what is it "_code" in your case?

Квохи ты че тупишь!
choice - нет такой переменной в АИ.обж
есть _from_choice _code и _ChoiceN

проведи аналогию
MENU_SELECTED ask,reply
action="menu_select?ask=2&reply=3"
это как в ПХП, далее будут использоваться ask и reply (в скрипте)

kvoxi 29.01.2006 18:05

Quote:

Originally Posted by kvoxi
ShowChoicePage(talker, option)
What is "option" - i dont know

Correction (not tested):
if OPTION=0, then l2npc.exe generate TALKED event with followed initialized variables:
myself;
talker;
_from_choice=1;
_code;
if OPTION<>0, then l2npc.exe generate TALK_SELECTED event with followed initialized variables:
myself;
talker;
_from_choice=1;
_code;
PS
и еще обязательно надо рассказать "тупым" людям, чтоб положили на RFC HTTP протокола и сделали на веб-серверах обработку передаваемых из хтмл-форм данных методами POST, GET не так как есть в спецификации, а "как в ПХП"

RmzVoid 30.01.2006 00:34

I make by another way
 
class sample : citizen
{
handler:
EventHandler CREATED()
{
myself.i_ai0=0;
}

EventHandler TALK_SELECTED(talker)
{
if ( _from_choice!=0 && myself.i_ai0==1 )
{
//Do something
myself.i_ai0 = 0;
}
if ( _from_choice!=0 && myself.i_ai0==2 )
{
//Do something 2
myself.i_ai0 = 0;
}
}

EventHandler MENU_SELECTED(talker, ask ,reply)
{
if(ask == 2)
{
if ( reply == 33 )
{
AddChoice(2,"choice 0 2");
AddChoice(3,"choice 0 2");
myself.i_ai0 = 1;
ShowChoicePage(talker,1);

}
if ( reply == 34 )
{
AddChoice(6,"choice 1 6");
AddChoice(7,"choice 1 7");
myself.i_ai0 = 2;
ShowChoicePage(talker,1);
}
}
}

kvoxi 30.01.2006 03:16

EventHandler TALK_SELECTED(talker)
{
if ( _from_choice!=0 && (_code==2 || _code==3) ) {
//Do something
}
if ( _from_choice!=0 && (_code==6 || _code==7) ) {
//Do something 2
}
}

kvoxi 30.01.2006 11:31

Quote:

Originally Posted by kvoxi
Quote:

Originally Posted by kvoxi
ShowChoicePage(talker, option)
What is "option" - i dont know

Correction (not tested):
if OPTION=0, then l2npc.exe generate TALKED event with followed initialized variables:
myself; talker; _from_choice=1; _code;
if OPTION<>0, then l2npc.exe generate TALK_SELECTED event with followed initialized variables:
myself; talker; _from_choice=1; _code;

tested - worked:
[php:1:d1d73b739f]
EventHandler TALKED (talker,_from_choice,_code)
{
if (_from_choice==0) {
AddChoice(11, "Choice_11");
AddChoice(12, "Choice_12");
AddChoice(13, "Choice_13");
AddChoice(14, "Choice_14");
ShowChoicePage(talker,0);
}
if (_from_choice!=0) {
SayInt(_code);
AddChoice(21, "TALKED: Choice_21");
AddChoice(22, "TALKED: Choice_22");
AddChoice(23, "TALKED: Choice_23");
AddChoice(24, "TALKED: Choice_24");
ShowChoicePage(talker,1);
}
}

EventHandler TALK_SELECTED (talker, _from_choice, _code)
{
if (_from_choice!=0) {
SayInt(_code);
AddChoice(31, "TALK_SELECTED: Choice_31");
AddChoice(32, "TALK_SELECTED: Choice_32");
AddChoice(33, "TALK_SELECTED: Choice_33");
AddChoice(34, "TALK_SELECTED: Choice_34");
ShowChoicePage(talker,1);
}
}
[/php:1:d1d73b739f]


All times are GMT. The time now is 16:52.