![]() |
AI breakdown?
hmm i tried searching but i was only able to find small amount of breakdowns
can anyone explain the structur of AI.obj? (especially checking lvl, class of the character) |
push_event // talker
push_const 32 // - This is our player add fetch_i // level push_const 888 // this is for level add fetch_i push_const 19 // level to check greater_equal // if greater, then continue push_reg_sp fetch_i branch_false L22776 //else go to this branch push_event // talker push_const 32 add fetch_i // occupation push_const 152 // yo! this is for char class add fetch_i push_const 25 // char class = elven_mage, look for manual_pch.txt equal // if equal then continue and push_reg_sp fetch_i branch_false L22776 //else - go to this branch And so on. Ai.obj is pseudoassembler file, it's not structured at all and rather stupid. But it's not imposible to edit it by hand. Of course some people have working compiler for scripts, but they are to greedy to share it to mortals |
such a compiler would be a godly blessing :O
|
you can write ai on other language. see SCRIPT folder in meifu distrib.
part of code for source file : Code:
class guild_master_lv2 : guild_master |
i dun think its possible to edit those scripts, i guess those are generated off the ai.obj file when starting the server
|
w00t thx to det.. :D
lol sum1s gotta sum up those push_const variables.. |
I have passed this phrase
Quote:
Code:
======================================= |
dam...lol bandwidth exceeded?
gimme the file and i'll host it lol |
mail
|
[php:1:3002df8168]
class human_elf_fighter_lv2_master : guild_master_lv2 parameter_define_begin int lv1_class1 0 int lv1_class2 18 int lv2_class11 1 int lv2_class12 4 int lv2_class13 7 int lv2_class21 19 int lv2_class22 22 int proof11 1145 int proof12 1161 int proof13 1190 int proof21 1204 int proof22 1217 parameter_define_end //EventHandler MENU_SELECTED(talker, ask ,reply){ handler 32 // MENU_SELECTED variable_begin "talker" "ask" "reply" "myself" "_choiceN" "_code" "_from_choice" variable_end //if(ask == -2 && reply == 1){ push_event // ask push_const 100 add fetch_i push_const 2 negate equal push_reg_sp fetch_i branch_false L238 //and reply == 1 push_event // reply push_const 104 add fetch_i push_const 1 equal and L238 branch_false L240 //if(IsInCategory(@fighter_group, talker.occupation) // && (talker.race == @race_human || talker.race == @race_elf)) L239 //IsInCategory(@fighter_group, talker.occupation) shift_sp 1 push_const 0 push_event // talker push_const 32 add fetch_i // occupation push_const 152 add fetch_i func_call 143 // func[IsInCategory] shift_sp -2 push_reg_sp fetch_i branch_false L241 //and talker.race == @race_human push_event // talker push_const 32 add fetch_i // race push_const 148 add fetch_i push_const 0 equal push_reg_sp fetch_i branch_true L242 //or talker.race == @race_elf push_event // talker push_const 32 add fetch_i // race push_const 148 add fetch_i push_const 1 equal or L242 and L241 branch_false L244 //if(talker.race == @race_human) L243 push_event // talker push_const 32 add fetch_i // race push_const 148 add fetch_i push_const 0 equal branch_false L246 //ShowPage(talker, fnClassList1); L245 shift_sp 1 push_event // talker push_const 32 add fetch_i push_parameter fnClassList1 func_call 43 // func[ShowPage] shift_sp -2 shift_sp -1 jump L247 //if(talker.race == @race_elf) L246 push_event // talker push_const 32 add fetch_i // race push_const 148 add fetch_i push_const 1 equal branch_false L249 //ShowPage(talker, fnClassList2); L248 shift_sp 1 push_event // talker push_const 32 add fetch_i push_parameter fnClassList2 func_call 43 // func[ShowPage] shift_sp -2 shift_sp -1 L249 //goto L250; L247 jump L250 //ShowPage(talker, fnClassMismatch); L244 shift_sp 1 push_event // talker push_const 32 add fetch_i push_parameter fnClassMismatch func_call 43 // func[ShowPage] shift_sp -2 shift_sp -1 L250 //super; L240 call_super handler_end [/php:1:3002df8168] i wonder what "shift_sp nr" meens ? |
...yeah any1 want to explain what shift_sp stands for?
|
The code in ai.obj is assembly for a stack machine. The shift_sp command is to adjust the Stack Pointer.
http://en.wikipedia.org/wiki/Reverse_Polish_notation http://www.flipcode.com/articles/scr..._issue01.shtml |
thx!
|
Quote:
|
| All times are GMT. The time now is 15:25. |