![]() |
|
|
#1 |
|
Архивный участник
Join Date: May 2005
Posts: 39
|
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) |
|
|
|
|
#2 |
|
Архивный участник
Join Date: May 2005
Posts: 8
|
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 |
|
|
|
|
#3 |
|
Архивный участник
Join Date: Apr 2005
Posts: 196
|
such a compiler would be a godly blessing :O
|
|
|
|
|
#4 |
|
Архивный участник
Join Date: Mar 2005
Posts: 39
|
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
{
parameter:
int lv1_class1 = -1;
int lv1_class2 = -1;
int lv2_class11 = -1;
int lv2_class12 = -1;
int lv2_class13 = -1;
int lv2_class21 = -1;
int lv2_class22 = -1;
int lv2_class23 = -1;
int proof11 = 0;
int proof12 = 0;
int proof13 = 0;
int proof21 = 0;
int proof22 = 0;
int proof23 = 0;
handler:
EventHandler CLASS_CHANGE_REQUESTED(talker, occupation_name_id)
{
if(IsInCategory(@second_class_group, talker.occupation))
ShowPage(talker, fnYouAreSecondClass);
else if(IsInCategory(@third_class_group, talker.occupation))
ShowPage(talker, fnYouAreThirdClass);
else
{
MACRO<class_change_lv2>(lv1_class1, lv2_class11
, proof11, fnLowLevelNoProof11, fnLowLevel11, fnNoProof11, fnAfterClassChange11)
MACRO<class_change_lv2>(lv1_class1, lv2_class12
, proof12, fnLowLevelNoProof12, fnLowLevel12, fnNoProof12, fnAfterClassChange12)
MACRO<class_change_lv2>(lv1_class1, lv2_class13
, proof13, fnLowLevelNoProof13, fnLowLevel13, fnNoProof13, fnAfterClassChange13)
MACRO<class_change_lv2>(lv1_class2, lv2_class21
, proof21, fnLowLevelNoProof21, fnLowLevel21, fnNoProof21, fnAfterClassChange21)
MACRO<class_change_lv2>(lv1_class2, lv2_class22
, proof22, fnLowLevelNoProof22, fnLowLevel22, fnNoProof22, fnAfterClassChange22)
MACRO<class_change_lv2>(lv1_class2, lv2_class23
, proof23, fnLowLevelNoProof23, fnLowLevel23, fnNoProof23, fnAfterClassChange23)
}
}
}
//??, ?? ?? 1???
class human_elf_fighter_lv2_master : guild_master_lv2
{
parameter:
int lv1_class1 = @fighter;
int lv1_class2 = @elven_fighter;
int lv2_class11 = @warrior;
int lv2_class12 = @knight;
int lv2_class13 = @rogue;
int lv2_class21 = @elven_knight;
int lv2_class22 = @elven_scout;
int proof11 = @medallion_of_warrior;
int proof12 = @sword_of_ritual;
int proof13 = @beziques_recommendation;
int proof21 = @elven_knight_brooch;
int proof22 = @reoria_recommendation;
handler:
EventHandler MENU_SELECTED(talker, ask ,reply)
{
if(ask == -2 && reply == 1)
{
if(IsInCategory(@fighter_group, talker.occupation)
&& (talker.race == @race_human || talker.race == @race_elf))
{
if(talker.race == @race_human)
ShowPage(talker, fnClassList1);
else if(talker.race == @race_elf)
ShowPage(talker, fnClassList2);
}
else
ShowPage(talker, fnClassMismatch);
}
super;
}
}
...
|
|
|
|
|
#5 |
|
Архивный участник
Join Date: Apr 2005
Posts: 196
|
i dun think its possible to edit those scripts, i guess those are generated off the ai.obj file when starting the server
|
|
|
|
|
#6 |
|
Архивный участник
Join Date: May 2005
Posts: 39
|
w00t thx to det..
![]() lol sum1s gotta sum up those push_const variables.. |
|
|
|
|
#7 | |
|
Архивный участник
Join Date: Mar 2005
Posts: 39
|
I have passed this phrase
Quote:
Code:
======================================= nasc.exe : NPC AI Script Compiler(0.03) Copyright 2002 NC Soft Inc any question mail to [email protected] ======================================= |
|
|
|
|
|
#8 |
|
Архивный участник
Join Date: May 2005
Posts: 39
|
dam...lol bandwidth exceeded?
gimme the file and i'll host it lol |
|
|
|
|
#9 |
|
Архивный участник
Join Date: Mar 2005
Posts: 39
|
mail
|
|
|
|
|
#10 |
|
Архивный участник
Join Date: Jun 2005
Posts: 7
|
[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 ? |
|
|
|
|
#11 |
|
Архивный участник
Join Date: Aug 2005
Posts: 49
|
...yeah any1 want to explain what shift_sp stands for?
|
|
|
|
|
#12 |
|
Архивный участник
Join Date: May 2005
Posts: 109
|
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 |
|
|
|
|
#13 |
|
Архивный участник
Join Date: Jun 2005
Posts: 7
|
thx!
|
|
|
|
|
#14 | |
|
Архивный участник
Join Date: Aug 2005
Posts: 7
|
Quote:
|
|
|
|
| Thread Tools | Search this Thread |
| Display Modes | |
|
|