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)

horyfilipe 07.11.2005 19:47

hmm thanks now it makes sense, so that player is marked.. but anyway, i put this code on the default_npc class.. but seems that not just exploiters are going there because this error is spawning like each 2 secs..

dinesat4 11.11.2005 18:59

More tutorial plz

kvoxi 12.11.2005 12:08

Quote:

Originally Posted by dinesat4
More tutorial plz

what to do this code? :)

push_const 111
push_const 222
push_reg_sp
push_reg_sp
push_reg_sp
sub
add
fetch_i

StaticVoid 12.11.2005 23:09

Quote:

Originally Posted by kvoxi
Quote:

Originally Posted by dinesat4
More tutorial plz

what to do this code? :)

push_const 111
push_const 222
push_reg_sp
push_reg_sp
push_reg_sp
sub
add
fetch_i

is that a real example? the above code makes some operations with the stack pointer so that you can get the value 111 on top of 222 since after the execution the stack looks like :

111
222
111

but you can have the same result using :
push_const 111
push_const 222
push_reg_sp
push_const 1
sub
fetch_i

There is a more powerfull way of manipulating the stack that i will present it in the next update of the tutorial, as soon as i find some time.

kvoxi 13.11.2005 10:30

Quote:

Originally Posted by StaticVoid
is that a real example? the above code makes some operations with the stack pointer so that you can get the value 111 on top of 222 since after the execution the stack looks like :
111
222
111

This is real example. This is very small part of my code. But, the code
Code:

push_const 111
push_const 222
push_reg_sp
push_const 1
sub
fetch_i

is not correct, because addresses difference is 4 (not 1)

_styx 13.11.2005 20:02

i'm sorry, but i don't fully understand push_reg_sp

shift_sp -2
push_const 1
equal
push_reg_sp
fetch_i
branch_false L33297

if i understand it right, then that would never be false

_styx 14.11.2005 00:05

also, how unique do the following need to be?
'Sxxx.'
'Lxxxxx'
do they need to be unique throughout the entire AI.obj, the class, or just the handler?

toolpunk 14.11.2005 13:13

i think it needs to be absolutely unique in the whole ai.obj...
at least it wont hurt lol :D

montejo1974 03.12.2005 20:47

This one must will be a stickie ;)

toolpunk 03.12.2005 22:52

just what is missing is what a function/handler really does...
i mean theres nothing like:
AddDoNothingDesire --> the npc receiving this command will do nothing when all conditions are ok.
well i dont know if this is what this function does.
thats why i am sorta asking for such a list.
i still want to write a quest. so i need pretty every piece of info i can get...
however its still a great tutorial and great tutorial :)

Kirikups 08.12.2005 12:58

hello, i try to check if pc (talker) is Caslte Owner in order my npc give an item only if pc owns a castle, i found this but i dont understand what it means exactly:

Code:

shift_sp 1
func_call 126        //  func[Castle_GetPledgeId]
push_event        //  talker
push_const 32
add
fetch_i                //  pledge_id
push_const 664
add
fetch_i
equal
push_reg_sp
fetch_i
branch_false LXXX

Any help is welcome, tx

montejo1974 09.12.2005 11:13

a) This post isnt for ask questions. There is a complete forum for help people.
b) That code is the way to obtain if the player talking to the NPC Castle Related, is the clan leader owning the castle to whom the NPC is associated.
c) You must have ai.obj knowledge for understand the code.
d) If you have more questions please do them at the Lineage2 Help forum...I will be pleased to answer you.

nemeek 12.12.2005 00:17

somebody know how i can use the function SetDBValue

Thanks

_styx 13.12.2005 17:22

Quote:

Originally Posted by montejo1974
a) This post isnt for ask questions. There is a complete forum for help people.
b) That code is the way to obtain if the player talking to the NPC Castle Related, is the clan leader owning the castle to whom the NPC is associated.
c) You must have ai.obj knowledge for understand the code.
d) If you have more questions please do them at the Lineage2 Help forum...I will be pleased to answer you.

This is a tutorial thread. Tutorials need to be continually modified and corrected. Asking questions here is ok. Questions asked here are most likely the FAQ. So it's easier to ask here, get an answer here, then post the Q and A on the first post for all to see.

Which reminds me, maybe I should comandeer this thread since the tutorial maker hasn't touched this thread in more than a month.

toolpunk 13.12.2005 18:29

think what you want...
i promise you less people will look in a [TUTORIAL] thread for answering questions...
so i dont mind if the thread gets flooded as hell, but it wont help the people very much.
but maybe im wrong. however this is turning in a nonsense discussion about the goddamn rules :lol:

RmzVoid 20.12.2005 02:26

Quote:

Originally Posted by toolpunk
i think it needs to be absolutely unique in the whole ai.obj...
at least it wont hurt lol :D

LXXX SXXX may be unique whole each class. I use this in my ai.obj and have no problems.


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?

kvoxi 20.12.2005 17:03

Quote:

Originally Posted by RmzVoid
If user press second URL, ask and reply in some_class1 equal to 2 and 11? Or call_super not pass parameters?

Class inheritance (from parent to child):
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

RmzVoid 20.12.2005 21:30

Quote:

Originally Posted by kvoxi
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.

sorry for my english, learn russian lang

that is all I want ot know :)

зачем мне учить русский? если я русский ))) в школе на 4 окончил ))))))

filrip 20.12.2005 21:42

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.

kvoxi 21.12.2005 06:59

Quote:

Originally Posted by filrip
AddDoNothingDesire do nothing, right. In fact it stop to do something, like attack or move. and EventHandler NO_DESIRE is called.

AddDoNothing... change NPC desire state. Its not same as "keep parameters"
Maybe, call_super pass parameters to funcs of parent classes. Ask AI lang developers about it :)

RmzVoid 21.12.2005 11:12

kvoxi, filrip wrote 2 different things. One about parameters (I asked) and 2nd about func AddNothingDesire (asked somethere above) ))

kvoxi 15.01.2006 20:24

This is complete list of C1 L2NPC.exe AI functions (my first work with IDA)

Mabus 17.01.2006 21:42

<rus>Пишу квест на страйдера. такой вот вопрос: у плеера получающего квест должен быть дракончик 55 лвл или выше тогда ему можно разрешить пройти квест на страйдера.... как узнать лвл имеющего в инвентаре дракона? или например лвл заточки вещи?</rus>

toolpunk 17.01.2006 21:47

very nice share :)
i love it...
looks very complete and informative...
thx kvoxi

kvoxi 17.01.2006 23:45

This is event variables list
Maybe StaticVoid want add some info.
He was promise to do it :)


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