PDA

View Full Version : [Guide] AI


HF
21.06.2007, 08:02
This documentation not for sell and re-sharing. Save my name for each quote on another resource.

For newbie, for myself, for people who want know more.
Note. If you want something add, fix and etc - say. We can do good documentation for AI language.
Note 2. How to create new class on AI "C+ decompile language" (no retail language) can read there (https://postpacific.mmorpg-game.online/forums/showthread.php?t=4355).
Note 3. If you want understund AI code better, you must have C4Decompiler (by Sauron) or retail NCSoft decompiler and can make a text simpler for the understanding.

AI Header (https://postpacific.mmorpg-game.online/forums/showpost.php?p=89210&postcount=2)
AI Class (https://postpacific.mmorpg-game.online/forums/showpost.php?p=89213&postcount=3)
AI Parameters (https://postpacific.mmorpg-game.online/forums/showpost.php?p=89214&postcount=4)
AI Handler (https://postpacific.mmorpg-game.online/forums/showpost.php?p=89217&postcount=5)
AI Common commands (https://postpacific.mmorpg-game.online/forums/showpost.php?p=89220&postcount=7)

HF
21.06.2007, 08:08
AI.obj file always have this header.

Retail build523

SizeofPointer 8
SharedFactoryVersion 429
NPCHVersion 413
NASCVersion 235
NPCEventHVersion 125
Debug 0

Parameters unknown.

Note: But L2Npc.exe show red error about bad version.
Work parameters:


SizeofPointer 8
SharedFactoryVersion 427
NPCHVersion 408
NASCVersion 235
NPCEventHVersion 125
Debug 0

HF
21.06.2007, 08:33
Entire AI.obj file - this is the collection of classes.
Each class have structure:

class 1 default_npc : (null)
parameter_define_begin
parameter_define_end
property_define_begin
telposlist_begin teleportname
telposlist_end
buyselllist_begin SellList0
buyselllist_end
property_define_end
handler 0 0 // NO_DESIRE
handler_end
class_end

Where:

class 1 default_npc : (null)

class - header
1 - ?? unknown. Have 2 type: 1 and 2.
default_npc - class name
(null) - definition for main class. (null) define class without parent class. Example class 1 citizen : default_npc have parent class is 'default_npc' and use parent handlers (functions) (read in next threads).


class_end
Define end of class. Required always.

One class can have more parents classes. Example,

class 1 thermal_nepenthes : warrior_ag_casting_enchant_rangephysical_poison
class 1 warrior_ag_casting_enchant_rangephysical_poison : warrior_casting_enchant_rangephysical_poison
class 1 warrior_casting_enchant_rangephysical_poison : warrior_casting_enchant_physical_poison
class 1 warrior_casting_enchant_physical_poison : warrior
class 1 warrior : warrior_parameter
class 1 warrior_parameter : monster_parameter
class 1 monster_parameter : default_npc
class 1 default_npc : (null)

HF
21.06.2007, 09:01
parameter_define_begin
(content)
parameter_define_end
Each class can use custom constant's. You can define types - string, int, float, waypointstype, waypointdelaystype. Example,
int residence_id 2
float MoveToTarget_BoostValue 5.00000
string fnHi "silvia001.htm"
This contants can use in all class tree - from this class to last parent class.
Same constants define and in npcdata.txt
npc_ai={[silvia];{[fnHi]=[silvia001.htm]};...
1) If parameter define in npcdata.txt then this constant will be have value as in npcdata.txt (value inherint npcdata definition).
2) If npcdata have not this definition, AI class will be use value from parameter_define area.
3) If npcdata have param, but AI class (full tree structure for this class) have not this param in parameter_define area, then npcserver show error in console:

06/18/2007 14:07:xx.xx2, Npc[silvia] doesn't have parameter[fnHi]. failed to set

3.1) parameter must be have same name like in AI.obj (lowcase, highcase). Example: If you have 'fnhi' in npcdata.txt, but have 'fnHi' in AI.obj, then npcserver show same error

06/18/2007 14:07:xx.xx2, Npc[silvia] doesn't have parameter[fnhi]. failed to set


property_define_begin
(content)

where
property_define_begin - start word for properties
property_define_end - end word for properties
This area can have two definitions - teleport list (telposlist) for gatekeeper and merchant buy/sell (buyselllist) for shops
Example:

telposlist_begin RaidBossList20_29
{"Madness Beast (lv20)"; -54096; 84288; -3512; 0; 0 }
telposlist_end
buyselllist_begin SellList5
{3960; 20; 0.000000; 0 }
buyselllist_end

where
telposlist_begin - start word for teleport list definitions
RaidBossList20_29 - name of teleport list
telposlist_end - end word for teleport list definitions
each property can have more then one teleport list, but teleportname must be unique in this property. Example,

telposlist_begin RaidBossList20_29
{"Madness Beast (lv20)"; -54096; 84288; -3512; 3000; 5 }
telposlist_end
telposlist_begin RaidBossList20_30
{"Madness Beast ANother (lv21)"; -54111; 22222; -3333; 0; 0 }
telposlist_end

Where in
{"Madness Beast (lv20)"; -54096; 84288; -3512; 0; 0 }
"Madness Beast (lv20)" - name of place. What you see in GK dialoge.
-54096; 84288; -3512; - X, Y, Z coordinates where you will be after selected this place
3000 - price for teleport. Can be only positive (or 0, for free teleport).
5 - parent castle name for this teleport location. If goes on the siege of castle with number 5 (Aden), then you will not be able to teleport, until siege goes on.
Note. If your teleport coordinates wrong, l2server show red error
container NULL pos[X, Y, Z]..."
Solution: find this bad X,Y and fix to correct.



buyselllist_begin SellList5
{3960; 20; 0.000000; 0 }
buyselllist_end

Shop list. Where -
buyselllist_begin - start word for shop list definitions
SellList5 - name of buy/sell list
buyselllist_end - end word for shop list definitions
each property can have more then one shop list, but shoplist name must be unique in this property. Example,
buyselllist_begin SellList5
{3960; 20; 0.000000; 0 }
{3960; 20; 0.000000; 0 }
buyselllist_end
buyselllist_begin SellList6
{3960; 20; 0.000000; 0 }
buyselllist_end

where in '{3960; 20; 0.000000; 0 }'
3960 - item id. name=[Mercenary Posting Ticket (Sword/Stationary)]
20 - Castle Town Tax Rate (in %). Example, full price for item in shop = default_price (in itemdata) + default_price * Castle Tax Rate% + default_price * Castle Town Tax Rate%.
0.000000 - unknown
0 - unknown

HF
21.06.2007, 09:09
Each handler have structure:
handler 3 0 // TALKED
variable_begin
"talker"
"myself"
"_choiceN"
"_code"
"_from_choice"
variable_end

handler_end

Where
handler - start word for handler
3 - handler id (full list sometime later)
0 - amount handler code lines (later)
TALKED - name of handler (this only commentarie)
variable_begin - start word for variable list
variable_end - end word for variable list
handler_end - end word for handler
Example
handler 10 0 // MY_DYING
handler_end
handler 11 0 // TIMER_FIRED
handler_end

variable_begin must be defined always. Guide to list of paramerer later.

Amount lines in handler
Example:

handler 3 6 // TALKED
variable_begin
"talker"
"myself"
"_choiceN"
"_code"
"_from_choice"
variable_end

push_event // myself
push_const 704
jump L4249
L4248
push_event // myself
push_const 704
handler_end

Where handler have 6 work lined, except Empty lines and Variable block.
Value for amount lines in handler define "How much memory required by server for working with this handler." If you have small value - your server can be crashed because memory not enought for working this npc. Or, if you have big value - your server can be use a lot memory and cause leak memory after sometimes.

Bloodust
21.06.2007, 09:14
Looks nice as always, thanks

HF
21.06.2007, 09:39
Handler
call_super
exit_handler

Variable definition type
fetch_f
fetch_i4
fetch_d
fetch_i

Stack using
push_const
push_string
add_string
push_parameter
push_property
push_reg_sp

Arithmetical commands
assign4
assign
add
sub
div
mul
negate
mod

Bit operation
bit_or
bit_and
xor
not

Functions
func_call

Logical
equal
greater
greater_equal
not_equal
less_equal
less
and
or

Stack using
shift_sp

Hyperlinks
jump
branch_false
branch_true

Labels
Lxxx
Sxxx

note. where * - increased number

HF
21.06.2007, 09:45
Note. Guide for using all push_

push_const
push_string
add_string
push_parameter
push_property

push_const 1000
Push to stack value 1000
push_string S0
Read string data from label S0 to memory.
push_parameter fnHi
Same like push_const, but reading constant from 'parameter_define_begin' block.
push_property SellList0
Push property name for next using teleport list or buy/sell list from 'property_define_begin' block.
add_string 1025 split last event as string to previous stack string value

S973. "crop_client_info"
push_string S973
push_parameter manor_id
add_string 1025
S974. ".htm"
push_string S974
add_string 1028

"crop_client_info" + manor_id + ".htm"

HF
21.06.2007, 10:26
How use commands:
push_event, push_const, add, fetch_i, push_string, func_call, shift_sp, Sxxx

Example

handler 4 13 // TALK_SELECTED
variable_begin
"talker"
"myself"
"_choiceN"
"_code"
"_from_choice"
variable_end

push_event // myself
push_const 704
add
fetch_i
push_event // talker
push_const 40
add
fetch_i
S0. "noquest.htm"
push_string S0
func_call 184680516 // func[ShowPage]
shift_sp -2
shift_sp -1
handler_end


My commentary: i cant tell you full how work 'fetch_i' and 'add'. It no easy to tell on english. I can give you guide about common of working AI.

1) handler 4 13 // TALK_SELECTED

Some examples:
Handler 'TALK_SELECTED' uses when player select link 'Quest'.
Handler 'TALKED' uses if your npc can show dialoge for you (not attacked). Uses for checking PK player for open required dialog or etc.
Handler 'CREATED' uses for npc who create Privates around self.
Example, Pytan spawned. Server check handler 'CREATED' in 'pytan' ai class and start it. Next reading Private list and spawned privates from this handler.
Example 2, this handler uses for start walking npc to required point, for start timer and etc.


2) Variables

variable_begin
"talker"
"myself"
"_choiceN"
"_code"
"_from_choice"
variable_end

Here handler will be use 2 variable 'talker' and 'myself' (note. 'myself' define always and everywhere)

3) Code
3.1)

push_event // myself
push_const 704
add
fetch_i

Show what server use event with ID 704 (myself) and save it to memory for next using (add).
Note. server save not integer 704, but real memory offcet for this event


push_event // talker
push_const 40
add
fetch_i

add to memory and event 'talker'


S0. "noquest.htm"
push_string S0

Label 'S0.' define parameter into code with label name S0.
push_string command read string data from label S0 to memory.

Function
func_call 184680516 // func[ShowPage]
Each function have required params list for running and output param (required params can by empty, and output can be empty, but cant be empty both)
Function 'ShowPage' have id in npcserver as 184680516.
Note. Retail pack (free share C4server retail pack) have bug value for fetch, event, func.
Function 'ShowPage' required 2 input parameter and 1 output. This function in decompiled mode:
myself->ShowPage(talker, fnHi);
What happening next. Before running, server read 2 params (it 'talker' and 'fnhi'). Function show server Html page (fnHi) to player ('talker').
Note. This decompiled format use C4Decompiler (by Sauron). Another developer can use another, like this:
ShowPage(talker.myself, fnHi);

Stack using

shift_sp -2
shift_sp -1

Clear (or shift offset marker) to -2 (because we use 2 input params)
Clear -1 stack because we used 1 output 'myself->' param.

handler_end
Required handler end definition. Check amount lines - 13.

HF
21.06.2007, 10:43
Simple using Function.
Func_call, push_const, mul


push_event // myself
push_const 704
add
fetch_i
push_const 1005
push_const 120
push_const 1000
mul
func_call 184680487 // func[AddTimerEx]
shift_sp -2
shift_sp -1

Make all by step-by-step (1,2,3- stack value's in stack)

add myself event to stack (1)
add value 1005 stack (2)
add value 120 to stack (3)
add value 1000 to stack (4)
use 'mul'. Mul - arithmetical command for * two value. Read 2 last stack value and made operation - 120* 1000. Save to stack (120*1000) (3)
start funtion AddTimerEx with use 2 params and 1 output
myself->AddTimerEx(1005, (120 * 1000));
clear this unused stack values from stack -2 (1)
clear this unused stack values from stack -1 (0)

ateh
21.06.2007, 10:49
Logical commands
sub
div
mul
negate
- Also:
add
xor
mod
bit_or
bit_and
not
--------

Class 1
Class 2
Type 1 for NPCs, Type 2 for Npc Maker (defines spawning rules)

--------

Are you sure that labels are not counted in handlers lenght? Cos from original AI I can tell that they are counted.

HF
21.06.2007, 10:52
Example for using branch_false, not_equal (decompiled code If, else)

Note. 'PARTY_ATTACKED' uses if monster see what one from him party has been attacked


class 1 party_private : party_private_param
...
handler 19 224 // PARTY_ATTACKED
variable_begin
"attacker"
"private"
"damage"
"f0"
"myself"
"_choiceN"
"_code"
"_from_choice"
variable_end

push_event // private
push_const 64
add
fetch_i
push_event // myself
push_const 704
add
fetch_i // sm
push_const 544
add
fetch_i
not_equal
branch_false L10262
L10261



There you have known structure for using function and new command 'branch_false' and working 'add' for multiple events.
Note:
add
fetch_i // ...
show as additional name for parameter (for server - it working with memory offset)

push_event // myself
push_const 704
add
fetch_i // sm
push_const 544
is 'myself.sm'

add event 'private' to stack (1)
add 'myself' to stack (2)
add 'sm' to previous value = myself.sm (2)
use logical operation not_equal with use two lastest stack values
private != myself.sm
use logical checking
branch_false L10262
If last operation is False then made jump (goto) in code to label L10262. If True then work with next code line.



handler PARTY_ATTACKED (attacker, private, damage, f0)
{
if (private != myself.sm)
{
...
}
....


------------
Another example for brench_false without second param.

class 1 castle_merchant : citizen
...
push_event // myself
push_const 704
add
fetch_i
push_event // talker
push_const 40
add
fetch_i
func_call 184615062 // func[IsMyLord]
shift_sp -1
branch_false L4128
L4127
push_event // myself
push_const 704
add
fetch_i
push_event // talker
push_const 40
add
fetch_i
push_parameter fnMyLord
func_call 184680516 // func[ShowPage]
shift_sp -2
shift_sp -1

show in code like this

if (myself->IsMyLord(talker))
{
myself->ShowPage(talker, fnMyLord);
}


but for good understanding it can show like:
if (myself->IsMyLord(talker) == True)
because all operations must be success/failed results (in server memory)

HF
21.06.2007, 11:00
- Also:
add
xor
mod
bit_or
bit_and
not

Can give how it to see in decompiled mode?

add = +
xor = xor
mod = /
...


Are you sure that labels are not counted in handlers lenght? Cos from original AI I can tell that they are counted.
Yes. It question has been discussed some month ago. But.. i told only what i find in retail AI.obj. All handlers have value equal amount line into handler without Lxx, Empty lines and Variables block. Maybe you know "NCSoft real true" or have retail Compiler? :)

HF
21.06.2007, 11:11
Use 'assign'


class 1 undead_priest : warrior_pa_slow_type2
handler 10 329 // MY_DYING
variable_begin
"always_list"
"c1"
"code_info"
"i9"
"last_attacker"
"lparty"
"member"
"random1_list"
"target"
"myself"
"_choiceN"
"_code"
"_from_choice"
variable_end

push_event // always_list
push_const 688
add
push_reg_sp
fetch_i
push_event // gg
push_const 632
add
fetch_i
func_call 218103812 // func[AllocCodeInfoList]
assign
shift_sp -1

- two last stack values
always_list (1) and gg->AllocCodeInfoList() (2) uses in
- operation is value assignment 'gg->AllocCodeInfoList()' for variable 'always_list'


always_list = gg->AllocCodeInfoList();


---------
Short and easy example:


L2269
push_event // i0
push_const 260
add
push_reg_sp
fetch_i
push_event // i0
push_const 260
add
fetch_i4
push_const 1000322
add
assign4
shift_sp -1

show like this

i0 = i0 + 1000322;

Tilluss
21.06.2007, 14:48
This is awesome, i was taking my first look at ai last night and this is just what i needed to get me started, thanks.

HF
21.06.2007, 15:06
...
this is just what i needed to get me started, thanks.
i know. It what i needed in my "young time of developing"

ateh
21.06.2007, 16:10
Can give how it to see in decompiled mode?

add = +
xor = xor
mod = /
...

That's what I added to Sauron's decompiler:

case 'mul':
$stack[$sp-1] = $stack[$sp-1].' * '.$stack[$sp];
if($sp != 0) $stack[$sp-1] = '( '.$stack[$sp-1].' )';
$sp--; array_pop($stack);
break;
case 'xor':
$stack[$sp-1] = $stack[$sp-1].' ^ '.$stack[$sp];
if($sp != 0) $stack[$sp-1] = '( '.$stack[$sp-1].' )';
$sp--; array_pop($stack);
break;
case 'mod':
$stack[$sp-1] = $stack[$sp-1].' % '.$stack[$sp];
if($sp != 0) $stack[$sp-1] = '( '.$stack[$sp-1].' )';
$sp--; array_pop($stack);
break;
case 'bit_or':
$stack[$sp-1] = $stack[$sp-1].' | '.$stack[$sp];
if($sp != 0) $stack[$sp-1] = '( '.$stack[$sp-1].' )';
$sp--; array_pop($stack);
break;
case 'bit_and':
$stack[$sp-1] = $stack[$sp-1].' & '.$stack[$sp];
if($sp != 0) $stack[$sp-1] = '( '.$stack[$sp-1].' )';
$sp--; array_pop($stack);
break;
case 'negate':
$stack[$sp] *= -1;
break;
case 'not':
$stack[$sp] = '~('.$stack[$sp].')';
break;

Well, some of this lines were already there, so check which you don't have.

Yes. It question has been discussed some month ago. But.. i told only what i find in retail AI.obj. All handlers have value equal amount line into handler without Lxx, Empty lines and Variables block. Maybe you know "NCSoft real true" or have retail Compiler? :)

Well, I don't have retail compiler ;P But I was sure I had original AI from begining and there Lxxx were counted into handler... Gonna try with lowering this number by count of Lxxx and see what happens :)

HF
21.06.2007, 16:24
That's what I added to Sauron's decompiler:

...

Well, some of this lines were already there, so check which you don't have.

Well, I don't have retail compiler ;P But I was sure I had original AI from begining and there Lxxx were counted into handler... Gonna try with lowering this number by count of Lxxx and see what happens :)


1) maybe you can more changes in decompiler? :) "New unoffical release"
:rolleyes:

2) Oh.. yes... I wrong. Wrong only in thread. Yes. Need count all and Lxxx labels too. I can confirm it - my tool, im always counting with Labels.
But another developers have different openition. You can find thread about "C4 compiler" service.
I'll fix everywhere in this thread all my errors.

DeKoth
21.06.2007, 17:24
This thread is amazing, great work HF im impressed, I hope you build on this further.

Kenjiro
21.06.2007, 17:38
So many work in one place. Big kudos!

ateh
21.06.2007, 18:24
1) maybe you can more changes in decompiler? :) "New unoffical release"
:rolleyes:
I think this was all that I added there myself. Plus changes some data files as some IDs were not matching NPC server I use...
Or maybe you are interested in version for C1? I made one by changing Sauron's C4 version.

HF
21.06.2007, 18:42
I think this was all that I added there myself. Plus changes some data files as some IDs were not matching NPC server I use...
Or maybe you are interested in version for C1? I made one by changing Sauron's C4 version.
No no. I mean C4. For C1 i used HDDecompiler

tpuNIsher
21.06.2007, 19:57
Great thread indeed. Pretty awesome job HF. :)

AI.obj file always have this header.

Retail build523


SizeofPointer 8
SharedFactoryVersion 429
NPCHVersion 413
NASCVersion 235
NPCEventHVersion 125
Debug 0


Parameters unknown.

Note: But L2Npc.exe show red error about bad version.
Work parameters:


SizeofPointer 8
SharedFactoryVersion 427
NPCHVersion 408
NASCVersion 235
NPCEventHVersion 125
Debug 0


About that..my 2 cents..

Those're revisions. SizeofPointer is the pointer which makes the ai.obj 'xx-bits'.. so.. 8^8 = 64 bit. 20^8 = 160 bits. try it, u'll see msg.. like.. Invalid ai.obj compiled from 160 bit nasc blabla in console if u change the pointer to 20. it's hardcoded in l2npc.

SharedFactoryVersion is a version info too l2npc related, also hardocded.
NPCHVersion aka npc.h version is header for nasc obviously, so anyways.. true values depends on l2npc itself. it's hardcoded in l2npc.
NASCVersion..nasc version ai was compiled from..also hardcoded in l2npc..
NPCEvent header.. also hardcoded..
i dunno about debug.. yet.

And also.. the true values for each of these in l2npc..IDA wise..


SharedFactoryVersion:
.rdata:0000000000691CB8 aRevision427 db '$Revision: 427 $',0 ; DATA XREF: sub_581860+42A

NPCHVersion:
.rdata:00000000006909C8 -> SharedFactoryVersion ver info start.

NASCVersion:
.rdata:000000000067E078 aRevision235 db '$Revision: 235 $',0 ; DATA XREF: .text:000000000042C32B

NPCEventHVersion
starting of the NPCEventVersion version info is at: .rdata:00000000006909B0 ...

it's different for diff l2npc. that's all.

FidoW
21.06.2007, 20:01
2) Oh.. yes... I wrong. Wrong only in thread. Yes. Need count all and Lxxx labels too. I can confirm it - my tool, im always counting with Labels.
But another developers have different openition. You can find thread about "C4 compiler" service.

I dont know what discussion are you talking about but i dont remember nothing like that, there is only one way to get the second parameter of a handler declaration, the number of lines include labels, you need to count lines beggining after the var declaration... example...


handler 0 0 // NO_DESIRE
variable_begin
"myself"
"_choiceN"
"_code"
"_from_choice"
variable_end

handler_end

No one... 0


handler 4 13 // TALK_SELECTED
variable_begin
"talker"
"myself"
"_choiceN"
"_code"
"_from_choice"
variable_end

1 push_event // myself
2 push_const 704
3 add
4 fetch_i
5 push_event // talker
6 push_const 40
7 add
8 fetch_i
9 S0. "noquest.htm"
10 push_string S0
11 func_call 184680516 // func[ShowPage]
12 shift_sp -2
13 shift_sp -1
handler_end



handler 3 38 // TALKED
variable_begin
"talker"
"myself"
"_choiceN"
"_code"
"_from_choice"
variable_end

1 push_event // talker
2 push_const 40
3 add
4 fetch_i // karma
5 push_const 468
6 add
7 fetch_i4
8 push_const 0
9 greater
10 branch_false L2
11 L1
12 push_event // myself
13 push_const 704
14 add
15 fetch_i
16 push_event // talker
17 push_const 40
18 add
19 fetch_i
20 push_parameter fnYouAreChaotic
21 func_call 184680516 // func[ShowPage]
22 shift_sp -2
23 shift_sp -1
24 jump L3
25 L2
26 push_event // myself
27 push_const 704
28 add
29 fetch_i
30 push_event // talker
31 push_const 40
32 add
33 fetch_i
34 push_parameter fnHi
35 func_call 184680516 // func[ShowPage]
36 shift_sp -2
37 shift_sp -1
38 L3
handler_end

Le][u$
21.06.2007, 21:42
buyselllist_begin SellList5
{3960; 20; 0.000000; 0 }
{3960; 20; 0.000000; 0 }
buyselllist_end
buyselllist_begin SellList6
{3960; 20; 0.000000; 0 }
buyselllist_end

where in '{3960; 20; 0.000000; 0 }'
3960 - item id. name=[Mercenary Posting Ticket (Sword/Stationary)]
20 - Castle Town Tax Rate (in %). Example, full price for item in shop = default_price (in itemdata) + default_price * Castle Tax Rate% + default_price * Castle Town Tax Rate%.
0.000000 - unknown
0 - unknown
0.000000 - time in hour (1.000000 = 1 hour, 0.500000 = 30 min)
0 - count of items that sell...
Ex.: {3960; 20; 1.000000; 5 } - in one hour we may buy only 5 items.

/rus
0.000000 - время в часах
0 - количество итемов доступных на продажу. Если там например стоит 5 - то купив эти 5 шт, новые появятся только черех промежуток времени обозначенный выше,
например: {3960; 20; 1.000000; 5 } - получается в час можно купить 5 штук этого итема.
p.s.: со временем могу конечно ошибаться - замерял "на глаз" :)
rus/

<^_^>
21.06.2007, 23:34
Мне убится=) Но как первый пост прочитать если он английский перевидете малолетке который жаждет перевода:p

Lirix
22.06.2007, 01:02
Лучше убейся. учи английский.

HF
22.06.2007, 03:45
Great thread indeed. Pretty awesome job HF. :)
About that..my 2 cents..

But. Changes in revision affected to AI work?

I dont know what discussion are you talking about but i dont remember nothing like that, there is only one way to get the second parameter of a handler declaration, the number of lines include labels, you need to count lines beggining after the var declaration... example...
...
FidoW, i already confirmed that it was mistaken. But only in post. My tool generate value with Labels.
"I dont know what discussion" What discussion? :) Because i has long discussion on russian forum about it. And this why i add checkbox "Count without labels" to my 'L2SM:HandlerLine Checker' module. :)

[u$;89308']0.000000 - time in hour (1.000000 = 1 hour, 0.500000 = 30 min)
0 - count of items that sell...
Ex.: {3960; 20; 1.000000; 5 } - in one hour we may buy only 5 items.
Fantastic!

Reputation for all! :)


P.S. It thread not ended. Sure, i'll continue. All this I wrote in the state, when it was boring.

tpuNIsher
22.06.2007, 11:00
SizeofPointer does. AI won't work with it being more than 64 bit. Rest, i have no idea, prolly with different l2npc, it will.

I had this one AI where the nascversion and sharedfactoryversion was different, that's when i tried and found the values.

<^_^>
22.06.2007, 12:02
HF - как пурга поживает?=)

Yui-Ikari
22.06.2007, 17:22
I havent go through your entire guide yet but this is what i was looking for. Thanks! <3 much appreciated ^^

ateh
14.07.2007, 18:32
Some 'vars' I've found which were now included in Sauron's decompiler data. Because they were not used in retail c4 pts AI, but they might be usefull for someone. Names are my own imagination :P


284|default|exp_**
368|talker_*|base_INT_**
372|talker_*|base_STR_**
376|talker_*|base_CON_**
380|talker_*|base_MEN_**
384|talker_*|base_DEX_**
388|talker_*|base_WIT_**
456|default|pvp_points_**
464|default|pk_pardon_points_**
472|default|recomendations_remaining_**
476|default|evaluation_score_**
484|default|quest_memo1_id_**
488|default|quest_memo1_value_**
492|default|quest_memo1_state_**
496|default|quest_memo1_**
500|default|quest_memo2_id_**
504|default|quest_memo2_value_**
508|default|quest_memo2_state_**
512|default|quest_memo2_**
516|default|quest_memo3_id_**
520|default|quest_memo3_value_**
524|default|quest_memo3_state_**
528|default|quest_memo3_**
532|default|quest_memo4_id_**
536|default|quest_memo4_value_**
540|default|quest_memo4_state_**
544|default|quest_memo4_**
548|default|quest_memo5_id_**
552|default|quest_memo5_value_**
556|default|quest_memo5_state_**
560|default|quest_memo5_**
564|default|quest_memo6_id_**
568|default|quest_memo6_value_**
572|default|quest_memo6_state_**
576|default|quest_memo6_**
580|default|quest_memo7_id_**
584|default|quest_memo7_value_**
588|default|quest_memo7_state_**
592|default|quest_memo7_**
596|default|quest_memo8_id_**
600|default|quest_memo8_value_**
604|default|quest_memo8_state_**
608|default|quest_memo8_**
612|default|quest_memo9_id_**
616|default|quest_memo9_value_**
620|default|quest_memo9_state_**
624|default|quest_memo9_**
628|default|quest_memo10_id_**
632|default|quest_memo10_value_**
636|default|quest_memo10_state_**
640|default|quest_memo10_**
644|default|quest_memo11_id_**
648|default|quest_memo11_value_**
652|default|quest_memo11_state_**
656|default|quest_memo11_**
660|default|quest_memo12_id_**
664|default|quest_memo12_value_**
668|default|quest_memo12_state_**
672|default|quest_memo12_**
676|default|quest_memo13_id_**
680|default|quest_memo13_value_**
684|default|quest_memo13_state_**
688|default|quest_memo13_**
692|default|quest_memo14_id_**
696|default|quest_memo14_value_**
700|default|quest_memo14_state_**
704|default|quest_memo14_**
708|default|quest_memo15_id_**
712|default|quest_memo15_value_**
716|default|quest_memo15_state_**
720|default|quest_memo15_**
724|default|quest_memo16_id_**
728|default|quest_memo16_value_**
732|default|quest_memo16_state_**
736|default|quest_memo16_**
988|talker_*|char_id_**
1052|default|current_INT_**
1056|default|current_STR_**
1060|default|current_CON_**
1064|default|current_MEN_**
1068|default|current_DEX_**
1072|default|current_WIT_**
1168|default|inventory_max_storage_**
1172|default|inventory_count_**
1176|default|weight_**


Usage of course look like this:

push_event // talker
push_const 40
add
fetch_i // exp_**
push_const 284
add
fetch_i4

HF
14.07.2007, 18:36
Some 'vars' I've found which were now included in Sauron's decompiler data. Because they were not used in retail c4 pts AI, but they might be usefull for someone. Names are my own imagination :P


284|default|exp_**
...

hoho... where you gave this? l2server researching?

one question - ** - it normal, full name for this vars? so strange

ateh
14.07.2007, 19:04
I said I made this names from my head ;) _** was to point that this are new values.
I found them in easy way - by making AI with like 800 executions of function Say() and by reading what it outputs... ;P

Kenjiro
14.07.2007, 20:26
Wow, this is great, thanks a lot :).

Skye
08.08.2007, 02:02
Awesome guide, I learned a lot.