![]() |
|
|
#1 |
|
Архивный участник
Join Date: May 2005
Posts: 368
|
Hello,
I need help with AI, i would like to make an AI for 7Signs quest registration I have 6 Marks: [dawn_seal_of_avarice] = 60101 [dawn_seal_of_gnosis] = 60102 [dawn_seal_of_strife] = 60103 [dusk_seal_of_avarice] = 60104 [dusk_seal_of_gnosis] = 60105 [dusk_seal_of_strife] = 60106 1) I would like in a 1st time learn how to make AI able to give 1 of those item to players (by a link in HTML) 2) I would like players able to get only 1 on those items. I mean HTML display a choice between 6 items and if i have 1 of the 6, NPC dont give me more or in other way i cannot get the list until i have 1 of those 6 items. 3) I would like players cannot choose a Dusk mark if they have a castle. Tx in advance for any help
|
|
|
|
|
#2 |
|
Архивный участник
Join Date: Oct 2005
Posts: 51
|
I've already started to do this! Now learning AI programming, sometning already done! I'll share some code later, when i have to finish it (will take me few days).
|
|
|
|
|
#3 |
|
Архивный участник
Join Date: May 2005
Posts: 368
|
ok take your time, i try to do something on my side, i try to learn quest structure, i use "Find Sir Windawood" quest atm
|
|
|
|
|
#4 |
|
Архивный участник
Join Date: Oct 2005
Posts: 51
|
What exactly you don't understand in quests structure?
|
|
|
|
|
#5 | |
|
Архивный участник
Join Date: May 2005
Posts: 368
|
Quote:
then i made something able to get quest items from NPC and i would like that NPC doesnt give that item if i have one yet and getting the item it cost 600 adenas, here a part of my code: Code:
... push_event // talker push_const 32 add fetch_i push_const 60101 // (Item Given by NPC) push_const 1 func_call 77 // func[GiveItem1] shift_sp -3 shift_sp -1 shift_sp 1 push_event // talker ...
|
|
|
|
|
|
#6 |
|
Архивный участник
Join Date: Sep 2005
Posts: 731
|
Krapno Download Hami's Tool Pach 1.3 maybe this will help you . Here is link
Hami's Tools . Iff you manage to complete the 7 Sign maybe you will share it . Tnx in advance
|
|
|
|
|
#7 | |
|
Архивный участник
Join Date: May 2005
Posts: 368
|
Quote:
Code:
if (item 60101 is owned) then dont give more else give one item 60101 take 600 adena end Code:
push_event // talker push_const 32 add fetch_i push_const 60101 // (Item Given by NPC) push_const 1 func_call 77 // func[GiveItem1] shift_sp -3 shift_sp -1 shift_sp 1 push_event // talker
|
|
|
|
|
|
#8 |
|
Архивный участник
Join Date: Oct 2005
Posts: 51
|
Understood! I'm trying to do this! Just wait for my share, think it will help u!
2TheOrder PM me password for l2tools1.3 plz ij u know... |
|
|
|
|
#9 | |
|
Архивный участник
Join Date: May 2005
Posts: 368
|
Quote:
|
|
|
|
|
|
#10 |
|
Архивный участник
Join Date: Oct 2005
Posts: 51
|
I'm blind) Sorry)
|
|
|
|
|
#11 | |
|
Архивный участник
Join Date: Feb 2005
Posts: 357
|
Quote:
[php:1:8dae0dd365] shift_sp 1 push_event // talker push_const 32 add fetch_i push_const 60101 func_call 81 // func[OwnItemCount] shift_sp -2 push_const 0 equal push_reg_sp fetch_i branch_false L0 shift_sp 1 push_event // talker push_const 32 add fetch_i push_const 57 func_call 81 // func[OwnItemCount] shift_sp -2 push_const 599 greater and L0 branch_false L2 L1 shift_sp 1 push_event // talker push_const 32 add fetch_i push_const 60101 push_const 1 func_call 77 // func[GiveItem1] shift_sp -3 shift_sp -1 shift_sp 1 push_event // talker push_const 32 add fetch_i push_const 57 push_const 600 func_call 80 // func[DeleteItem1] shift_sp -3 shift_sp -1 L2 [/php:1:8dae0dd365] |
|
|
|
|
|
#12 |
|
Архивный участник
Join Date: Sep 2005
Posts: 455
|
Kranpo, You also have to make sure
if(they have any mark) do not allow buy else if (they have no mark) allow buy 1 else if (you own a castle) allow only dawn mark end. |
|
|
|
|
#13 | ||
|
Архивный участник
Join Date: May 2005
Posts: 368
|
Tx a lot Sauron, i m gonna try this
so, does "shift_sp 1" mean "if" or something like that ? Quote:
Quote:
next step Kenster :!: i try to make it step by step to understand :wink: |
||
|
|
|
|
#14 |
|
Архивный участник
Join Date: Feb 2005
Posts: 357
|
nope shift_sp 1 is like "function begin"
shift_sp -3 "function has 3 vars" shift_sp -1 "function ends" and in the end, (equal, greater, less, not_equad, etc) |
|
|
|
|
#15 |
|
Архивный участник
Join Date: May 2005
Posts: 368
|
ok it works fine
i need to get some lines explained please, here my ai: Code:
... L60150 shift_sp 1 push_event // talker push_const 32 add fetch_i push_const 60101 func_call 81 // func[OwnItemCount] shift_sp -2 push_const 0 // if 0 item 60101 in pc inventory equal push_reg_sp // ?? fetch_i // ?? branch_false L60152 // if return false goto L60152 shift_sp 1 push_event // talker push_const 32 add fetch_i push_const 57 func_call 81 // func[OwnItemCount] shift_sp -2 push_const 599 // if adenas > 599 in pc inventory greater and // ?? branch_false L60152 // if return false goto L60152 ... Tx ps: In other part, i have to check if pc has a castle but i dont find func to get that... |
|
|
|
|
#16 |
|
Архивный участник
Join Date: May 2005
Posts: 2,033
|
Code:
shift_sp 1
push_event // talker
push_const 32
add
fetch_i
push_const 60101
func_call 81 // func[OwnItemCount]
shift_sp -2
push_const 0
equal
push_reg_sp
fetch_i
branch_false L0
shift_sp 1
push_event // talker
push_const 32
add
fetch_i
push_const 57
func_call 81 // func[OwnItemCount]
shift_sp -2
push_const 599
greater
and
L0
branch_false L2
L1
shift_sp 1
push_event // talker
push_const 32
add
fetch_i
push_const 60101
push_const 1
func_call 77 // func[GiveItem1]
shift_sp -3
shift_sp -1
shift_sp 1
push_event // talker
push_const 32
add
fetch_i
push_const 57
push_const 600
func_call 80 // func[DeleteItem1]
shift_sp -3
shift_sp -1
L2
the "and"... does it mean that if the condition: Code:
shift_sp 1
push_event // talker
push_const 32
add
fetch_i
push_const 57
func_call 81 // func[OwnItemCount]
shift_sp -2
push_const 599
greater
and
L0
branch_false L2
|
|
|
|
|
#17 |
|
Архивный участник
Join Date: Feb 2005
Posts: 357
|
hmm look, think it this way.
when u use push_reg_sp fetch_i then it will be replace by the 1st (and, or) u use. so u have [php:1:6cb3d588cd] shift_sp 1 // function begins push_event // talker - 1st var talker push_const 32 add fetch_i push_const 60101 // 2nd var, const 60101 (item id) func_call 81 // func[OwnItemCount] shift_sp -2 // end 2 vars function // note in this case there is no need for the shift_sp -1 // so far we have "OwnItemCount(talker, 60101)" push_const 0 // pust const 0 :P equal // this means function and value pushed has to be compared // "if(OwnItemCount(talker, 60101) == 0)" push_reg_sp // the if will continue fetch_i branch_false L0 // if return false it will jump to L0 else continue shift_sp 1 // function begin push_event // talker push_const 32 add fetch_i push_const 57 func_call 81 // func[OwnItemCount] shift_sp -2 push_const 599 greater and // to write it like a nomal languaje, this should be where the "push_reg_sp; fetch_i" is so we get if(OwnItemCount(talker, 60101) == 0 && OwnItemCount(talker, 57) > 599) { .......... } else { jump L0 } [/php:1:6cb3d588cd] |
|
|
|
|
#18 |
|
Архивный участник
Join Date: May 2005
Posts: 368
|
well, here my code updated including conditions following Sauron's instructions:
Get Mark 60101 if - 0 mark owned (between 60101 to 60106) - 600 adena (or more) owned Code:
///////////////////////////////////////////////////////////////////////// Controls L60150 shift_sp 1 push_event // talker push_const 32 add fetch_i push_const 60101 func_call 81 // func[OwnItemCount] shift_sp -2 push_const 0 // if 0 item 60101 in pc inventory equal push_reg_sp fetch_i branch_false L60152 // if return false goto L60152 shift_sp 1 push_event // talker push_const 32 add fetch_i push_const 60102 func_call 81 // func[OwnItemCount] shift_sp -2 push_const 0 // if 0 item 60102 in pc inventory equal push_reg_sp fetch_i branch_false L60152 // if return false goto L60152 shift_sp 1 push_event // talker push_const 32 add fetch_i push_const 60103 func_call 81 // func[OwnItemCount] shift_sp -2 push_const 0 // if 0 item 60103 in pc inventory equal push_reg_sp fetch_i branch_false L60152 // if return false goto L60152 shift_sp 1 push_event // talker push_const 32 add fetch_i push_const 60104 func_call 81 // func[OwnItemCount] shift_sp -2 push_const 0 // if 0 item 60104 in pc inventory equal push_reg_sp fetch_i branch_false L60152 // if return false goto L60152 shift_sp 1 push_event // talker push_const 32 add fetch_i push_const 60105 func_call 81 // func[OwnItemCount] shift_sp -2 push_const 0 // if 0 item 60105 in pc inventory equal push_reg_sp fetch_i branch_false L60152 // if return false goto L60152 shift_sp 1 push_event // talker push_const 32 add fetch_i push_const 60106 func_call 81 // func[OwnItemCount] shift_sp -2 push_const 0 // if 0 item 60106 in pc inventory equal push_reg_sp fetch_i branch_false L60152 // if return false goto L60152 shift_sp 1 push_event // talker push_const 32 add fetch_i push_const 57 func_call 81 // func[OwnItemCount] shift_sp -2 push_const 599 // if adenas > 599 in pc inventory greater and // ?? branch_false L60152 // if return false goto L60152 ///////////////////////////////////////////////////////////////////////// NPC Give Items L60151 shift_sp 1 push_event // talker push_const 32 add fetch_i push_const 60101 push_const 1 func_call 77 // func[GiveItem1] shift_sp -3 shift_sp -1 shift_sp 1 push_event // talker push_const 32 add fetch_i push_const 57 // adenas push_const 600 // take 600 adenas func_call 80 // func[DeleteItem1] shift_sp -3 shift_sp -1 shift_sp 1 push_event // talker push_const 32 add fetch_i S60152. "sevensign601_d.htm" // Quest Description push_string S60152 func_call 43 // func[ShowPage] shift_sp -2 shift_sp -1 shift_sp 1 push_event // talker push_const 32 add fetch_i S60153. "ItemSound.quest_accept" push_string S60153 func_call 173 // func[SoundEffect] shift_sp -2 shift_sp -1 L60152 exit_handler ///////////////////////////////////////////////////////////////////////// in other part, if i set marks as "is_destruct=1" in order player can change if he made a mistake registering (should i ?), then if i do like that and i destruct the Mark, quest memo stay ... then i need to delete that memo with the mark... i dunno how to do it too. finally, will i have to delete automatically all marks owned each 2 weeks ? because i cannot use MSSQL Agent do to that, it doesnt work in real time, it only deletes in databases, not in Cache :? well maybe u know a way to delete items in real time to all players who own it/them ? Regards PS: Again tx a lot to Sauron for all explanations
|
|
|
|
|
#19 |
|
Архивный участник
Join Date: May 2005
Posts: 2,033
|
so the "and" makes ai check if both/all conditions are true?
means in this case the item to be given isnt already in the inventory and the player has to have more than 599 adena (so at least 600) in order to continue... so otherwise it executes L0, right? sorry if im confusing somebody with all this but i really wanna learn this and this is my desperate attempt to it
|
|
|
|
|
#20 |
|
Архивный участник
Join Date: May 2005
Posts: 2,033
|
ok thanks...
i understood it now... must have been kinda blackout XD sorry for disturbing. lol |
|
|
|
|
#21 |
|
Архивный участник
Join Date: Sep 2005
Posts: 220
|
2 Krapno
Did you complete quest on 7 signs? Can you share your files? |
|
|
|
|
#22 |
|
Архивный участник
Join Date: Aug 2005
Posts: 434
|
Why are you still breathing?
|
|
|
|
|
#23 |
|
Архивный участник
Join Date: Sep 2005
Posts: 731
|
I doubth you will get that fix , and one more thing i last saw Krapno 2 mounths ago . I think he kinda left the community , hope i am wrong and he will reply . Srry for the OFFTOPIC
|
|
|
|
|
#24 |
|
Архивный участник
Join Date: Sep 2005
Posts: 455
|
And his c4 server shut down.
|
|
|
| Thread Tools | Search this Thread |
| Display Modes | |
|
|