![]() |
|
|
#51 |
|
Архивный участник
Join Date: Sep 2005
Posts: 731
|
Tnx for the AI functions kvoxi , realy helpfull !!!
|
|
|
|
|
#52 |
|
Архивный участник
Join Date: May 2005
Posts: 2,033
|
very nice info again...
however static left us some time ago... he visits the forum once in a while but doesnt post anymore
|
|
|
|
|
#53 |
|
Архивный участник
Join Date: Aug 2005
Posts: 194
|
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. |
|
|
|
|
#54 | |
|
Архивный участник
Join Date: Oct 2005
Posts: 102
|
Quote:
But, i have some idea. I need a check. I will post results later |
|
|
|
|
|
#55 | |
|
Архивный участник
Join Date: Oct 2005
Posts: 102
|
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 |
|
|
|
|
|
#56 |
|
Архивный участник
Join Date: Dec 2005
Posts: 82
|
very nice :P
|
|
|
|
|
#57 |
|
Архивный участник
Join Date: Apr 2005
Posts: 357
|
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? |
|
|
|
|
#58 | |
|
Архивный участник
Join Date: Oct 2005
Posts: 102
|
Quote:
ShowChoicePage(crature, from_choice); The call ShowChoicePage(talker,0) set _from_choice to 0; |
|
|
|
|
|
#59 |
|
Архивный участник
Join Date: Apr 2005
Posts: 357
|
My post explains thet is not.
ShowChoicePage (talker,2) also not works. I mean if ( _from_choce == 2 ) { ... } |
|
|
|
|
#60 | |
|
Архивный участник
Join Date: Oct 2005
Posts: 102
|
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> |
|
|
|
|
|
#61 |
|
Архивный участник
Join Date: Apr 2005
Posts: 357
|
so maybe use choice & option variables?
Or you mean <a action="bypass -h quest_choice?_from_choice=2&_code=3">["<Choice_1 string>"]</a> ? |
|
|
|
|
#62 | |
|
Архивный участник
Join Date: Oct 2005
Posts: 102
|
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) |
|
|
|
|
|
#63 |
|
Архивный участник
Join Date: Apr 2005
Posts: 357
|
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 (в скрипте) |
|
|
|
|
#64 | |
|
Архивный участник
Join Date: Oct 2005
Posts: 102
|
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 не так как есть в спецификации, а "как в ПХП" |
|
|
|
|
|
#65 |
|
Архивный участник
Join Date: Apr 2005
Posts: 357
|
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); } } } |
|
|
|
|
#66 |
|
Архивный участник
Join Date: Oct 2005
Posts: 102
|
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 } } |
|
|
|
|
#67 | ||
|
Архивный участник
Join Date: Oct 2005
Posts: 102
|
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] |
||
|
|
|
|