![]() |
Quote:
Question: class some_class1 : default_npc handler 32 // MENU_SELECTED variable_begin "talker" "ask" "reply" "myself" "_choiceN" "_code" "_from_choice" variable_end .... handler_end class_end class some_class2 : some_class1 handler 32 // MENU_SELECTED variable_begin "talker" "ask" "reply" "myself" "_choiceN" "_code" "_from_choice" variable_end .... call_super handler_end class_end npc_ai={[some_class2]} in some_class2 I process this URL menu_select?ask=2&reply=10 in some_class1 I process menu_select?ask=2&reply=11 If user press second URL, ask and reply in some_class1 equal to 2 and 11? Or call_super not pass parameters? |
Quote:
some_class2 <- some_class1 <- default_npc Event data proccessing flow (from child to parent): some_class2 -> some_class1 -> default_npc ASK & REPLY - is EVENT structure variables If u will pass ask&reply pair to the some_class2 menu_selected handler, it is possible to process EVENT values in menu_selected handler of every parent class. "call_super" never pass the parameters from child to parent class -- sorry for my english, learn russian lang |
Quote:
зачем мне учить русский? если я русский ))) в школе на 4 окончил )))))) |
call_super keep the parameter in the function
is you have MENU_SELECTED(talker,ask,reply) and do a "call_super", all variables "talker", "ask" & "reply" will have correct value, not reset to 0 in the child. AddDoNothingDesire do nothing, right. In fact it stop to do something, like attack or move. and EventHandler NO_DESIRE is called. |
Quote:
Maybe, call_super pass parameters to funcs of parent classes. Ask AI lang developers about it :) |
kvoxi, filrip wrote 2 different things. One about parameters (I asked) and 2nd about func AddNothingDesire (asked somethere above) ))
|
This is complete list of C1 L2NPC.exe AI functions (my first work with IDA)
|
<rus>Пишу квест на страйдера. такой вот вопрос: у плеера получающего квест должен быть дракончик 55 лвл или выше тогда ему можно разрешить пройти квест на страйдера.... как узнать лвл имеющего в инвентаре дракона? или например лвл заточки вещи?</rus>
|
very nice share :)
i love it... looks very complete and informative... thx kvoxi |
This is event variables list
Maybe StaticVoid want add some info. He was promise to do it :) |
Tnx for the AI functions kvoxi , realy helpfull !!!
|
very nice info again...
however static left us some time ago... he visits the forum once in a while but doesnt post anymore :( |
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. |
Quote:
But, i have some idea. I need a check. I will post results later |
Quote:
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 |
very nice :P
|
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? |
Re: wtf
Quote:
ShowChoicePage(crature, from_choice); The call ShowChoicePage(talker,0) set _from_choice to 0; |
My post explains thet is not.
ShowChoicePage (talker,2) also not works. I mean if ( _from_choce == 2 ) { ... } |
Quote:
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> |
so maybe use choice & option variables?
Or you mean <a action="bypass -h quest_choice?_from_choice=2&_code=3">["<Choice_1 string>"]</a> ? |
Quote:
<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) |
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 (в скрипте) |
Quote:
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 не так как есть в спецификации, а "как в ПХП" |
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); } } } |
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 } } |
Quote:
[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 15:12. |