![]() |
Priest of Dawn/Dusk AI
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 :) |
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).
|
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 :D
|
What exactly you don't understand in quests structure?
|
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:
... |
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
|
Quote:
Code:
if (item 60101 is owned) thenCode:
push_event // talker |
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... |
Quote:
|
I'm blind) Sorry)
|
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] |
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. |
Tx a lot Sauron, i m gonna try this :)
so, does "shift_sp 1" mean "if" or something like that ? Quote:
Quote:
i try to make it step by step to understand :wink: |
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) |
ok it works fine :)
i need to get some lines explained please, here my ai: Code:
...Tx ps: In other part, i have to check if pc has a castle but i dont find func to get that... |
Code:
shift_sp 1 the "and"... does it mean that if the condition: Code:
shift_sp 1 |
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] |
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:
///////////////////////////////////////////////////////////////////////// Controlsin 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 :) |
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 :p |
ok thanks...
i understood it now... must have been kinda blackout XD sorry for disturbing. lol |
2 Krapno
Did you complete quest on 7 signs? Can you share your files? |
Why are you still breathing?
|
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
|
And his c4 server shut down.
|
| All times are GMT. The time now is 21:40. |