![]() |
|
|
#1 |
|
Архивный участник
Join Date: Aug 2005
Posts: 1,531
|
So, i start "AI Decompiler Project" and finding man who understund work AI.obj. I know and understund AI.obj code and can do new code, but... for developing need more knowledge.
This is first code ![]() Code:
//---------------------------------------------------
// L2ScriptMaker AI Decompiler Project
//---------------------------------------------------
// Decompiling: xx.xx.2007 17:36:50
// Decompiler build is: 1.0.0.0
//---------------------------------------------------
SizeofPointer 8
SharedFactoryVersion 427
NPCHVersion 408
NASCVersion 235
NPCEventHVersion 125
Debug 0
class 1 default_npc : (null)
{
parameter_define_begin
int residence_id = 0;
int DesirePqSize = 50;
int FavorListSize = 30;
int MoveAroundSocial = 0;
int MoveAroundSocial1 = 0;
int MoveAroundSocial2 = 0;
float IdleDesire_DecayRatio = 0.000000;
string fnHi = "chi.htm";
parameter_define_end
handler NO_DESIRE ()
{
}
handler TALK_SELECTED (talker)
{
ShowPage(talker, "noquest.htm")->myself;
}
}
class 1 azit_contest_flag_b : siege_instant_teleporter
{
}
class 1 messenger_rogin : citizen
{
handler CREATED ()
{
AddMoveSuperPointDesire(name, 2, 2000)->sm;
ChangeMoveType(1)->myself;
super;
}
handler SCRIPT_EVENT (script_event_arg1script_event_arg2)
{
jump L207097
L207096
jump L207100
L207099
MakeFString(1010215, "", "", "", "", "")-> Say(myself)->myself;
...
}
|
|
|
|
|
#2 |
|
Архивный участник
Join Date: Aug 2005
Posts: 1,531
|
Only one man help me. But good man. Results for free share no good
I sure.Current status of developing very good... ~20-40% code analysed and decoding w/o errors. 2 days of works. Code:
//---------------------------------------------------
// L2ScriptMaker AI Decompiler Project
//---------------------------------------------------
// Decompiling: xx.xx.2007 0:23:42
// Decompiler build is: 1.0.0.0
//---------------------------------------------------
class 1 party_private : party_private_param
{
parameter_define_begin
int DDMagic = 1;
parameter_define_end
handler NO_DESIRE ()
{
if (myself.boss.alive)
{
myself->AddFollowDesire(myself.boss, 5);
}
else
{
myself->AddMoveAroundDesire(5, 5);
}
}
handler CREATED ()
{
myself->AddTimerEx(1005, 120 * 1000);
myself->AddTimerEx(1006, 20000);
super;
}
handler TIMER_FIRED_EX (timer_id)
{
if (timer_id == 1005)
{
if (myself->InMyTerritory(myself.sm) == 0 && myself.boss.alive != 0 && myself.p_state != 3)
{
myself->InstantTeleport(myself.sm, myself->FloatToInt(myself.boss.x), myself->FloatToInt(myself.boss.y), myself->FloatToInt(myself.boss.z));
}
myself->AddTimerEx(1005, 120 * 1000);
}
if (myself.p_state != 3 && myself.p_state != 10)
{
}
}
myself->AddTimerEx(1006, 20000);
}
super;
}
..
class 1 monster_parameter : default_npc
{
parameter_define_begin
int AttackLowLevel = 0;
int CreviceOfDiminsion = 0;
parameter_define_end
handler ATTACK_FINISHED (target)
{
if (target.alive == 0 && target.is_pc == 0)
{
if (myself->IsInCategory(11, target.npc_class_id) != 0)
{
myself->AddAttackDesire(target.master, 1, 500);
}
}
}
}
class 1 default_npc : (null)
{
parameter_define_begin
int residence_id = 0;
int DesirePqSize = 50;
float EffectAction_BoostValue = 0.000000;
float MoveToTarget_BoostValue = 0.000000;
parameter_define_end
handler NO_DESIRE ()
{
}
handler TALK_SELECTED (talker)
{
myself->ShowPage(talker, "noquest.htm");
}
}
|
|
|
|
|
#3 |
|
Архивный участник
Join Date: Jun 2005
Posts: 374
|
Feel free to PM me when you need help.
|
|
|
|
|
#4 |
|
Архивный участник
Join Date: Apr 2006
Posts: 461
|
I wish I could help but there are better people at AI than myself, and I'm really busy with my real life atm
However, good luck with it. It's an awesome project.
|
|
|
|
|
#5 |
|
Архивный участник
Join Date: Feb 2006
Posts: 453
|
HF: their official compiler did lot of bad mistakes in code, so it just impossible to recover ALL code into C-like stuff. Just dont get in stuck =) finish all common expressions, like switch, case, if, else, while. Make sure that all correct and add "Warnings" in all other cases.
Luck! |
|
|
|
|
#6 |
|
Архивный участник
Join Date: May 2006
Posts: 135
|
Sweet, keep up the good work mate!
|
|
|
|
|
#7 |
|
Архивный участник
Join Date: Aug 2005
Posts: 1,531
|
I do it... Main stage complete...
:santa: Вложения из исходного сообщения (сами файлы в копии отсутствуют): ai_out.txt — 6566 байт |
|
|
|
|
#8 |
|
Архивный участник
Join Date: Apr 2006
Posts: 554
|
Very..very very good HF!
/rus/ Отличная работа, продолжай ) |
|
|
|
|
#9 |
|
Архивный участник
Join Date: Sep 2005
Posts: 1,014
|
Look at line 211, there are a mistake with ( and )
Code:
if ((myself->GetPathfindFailCount() > 10 && speller == myself.top_desire_target) Same on line 192-193, 161-162, 131-132 .... |
|
|
|
|
#10 | |
|
Архивный участник
Join Date: Aug 2005
Posts: 1,531
|
Quote:
![]() Code:
}
if ((myself->GetPathfindFailCount() > 10) && (speller == myself.top_desire_target) && (myself->FloatToInt(myself.sm.hp) != myself->FloatToInt(myself.sm.max_hp)))
{
myself->InstantTeleport(myself.sm, myself->FloatToInt(speller.x), myself->FloatToInt(speller.y), myself->FloatToInt(speller.z));
}
}
|
|
|
|
|
|
#11 | |
|
Архивный участник
Join Date: Sep 2005
Posts: 1,014
|
Quote:
GJ HF
|
|
|
|
|
|
#12 |
|
Архивный участник
Join Date: Feb 2005
Posts: 357
|
if you need help pm me
|
|
|
|
|
#13 |
|
Архивный участник
Join Date: Aug 2005
Posts: 1,531
|
I DO IT!!! Omg
Code:
handler MENU_SELECTED (talker, ask, reply, state, fhtml0, i0, i1, i2)
{
if (ask == -231)
{
if (reply == 1)
{
myself->ShowSellSeedList(talker, manor_id);
}
elseif (reply == 2)
{
myself->ShowProcureCropList(talker, manor_id);
}
elseif (reply == 3)
{
myself->FHTML_SetFileName(fhtml0, ("seed_client_info" + state + ".htm"));
for (i2 = 1; i2 <= 25; i2 = i2 + 1 )
{
myself->FHTML_SetInt(fhtml0, ("CurrentSeedCount" + i2), (myself->GetCurrentSeedSellCountSet(state, i2)));
myself->FHTML_SetInt(fhtml0, ("CurrentSeedPrice" + i2), (myself->GetCurrentSeedPrice(state, i2)));
myself->FHTML_SetInt(fhtml0, ("CurrentSeedRemain" + i2), (myself->GetCurrentSeedRemainCount(state, i2)));
}
myself->ShowFHTML(talker, fhtml0);
}
|
|
|
|
|
#14 |
|
Архивный участник
Join Date: Mar 2006
Posts: 104
|
HF, that's so frickin' sweet!
|
|
|
|
|
#15 |
|
Архивный участник
Join Date: Oct 2006
Posts: 47
|
some (all :P) c4 handlers from my analysis
Code:
0|NO_DESIR 1|ATTACKED 2|SPELLED 3|TALKED 4|TALK_SELECTED 5|SEE_CREATURE 6|DISAPPEAR_CREATURE 7|SEE_ITEM 8|DISAPPEAR_ITEM 9|MASTER_ATTACK 10|MY_DYING 11|TIMER_FIRED 12|TIMER_FIRED_EX 13|CREATED 14|TIME 15|SEE_ATTACK 16|SEE_SPELL 17|OUT_OF_TERRITORY 18|DESIRE_MANIPULATION 19|PARTY_ATTACKED 20|PARTY_SPELLED 21|PARTY_DIED 22|FRIEND_ATTACKED 23|CLAN_ATTACKED 24|CLAN_SPELLED 25|STATIC_OBJECT_CLAN_ATTACKED 26|STATIC_OBJECT_CLAN_SPELLED 27|HOLYTHING_SPELLED 28|TELEPORT_REQUESTED 29|BUY_REQUESTED 30|SELL_REQUESTED 31|QUEST_ACCEPTED 32|MENU_SELECTED 33|LEARN_SKILL_REQUESTED 34|ENCHANT_SKILL_REQUESTED 35|ONE_SKILL_SELECTED 36|ONE_ENCHANT_SKILL_SELECTED 37|SKILL_QUEST_ACCEPTED 38|CLASS_CHANGE_REQUESTED 39|MANOR_MENU_SELECTED 40|CMD_FOLLOW_ME 41|CMD_ATTACK 42|GOD_SHOUT 43|GOD_SELL_GOODS 44|GOD_BUY_GOODS 45|CREATE_PLEDGE 46|DISMISS_PLEDGE 47|REVIVE_PLEDGE 48|LEVEL_UP_PLEDGE 49|ATTACKED_BY_PLEDGE 50|MANAGE_CASTLE_SIEGE 51|CREATE_ALLIANCE 52|SCRIPT_EVENT 53|TUTORIAL_EVENT 54|QUESTION_MARK_CLICKED 55|USER_CONNECTED 56|IDLE_FINISHED 57|MOVE_AROUND_FINISHED 58|ATTACK_FINISHED 59|CHASE_FINISHED 60|FLEE_FINISHED 61|GET_ITEM_FINISHED 62|DECAYING_FINISHED 63|FOLLOW_FINISHED 64|MOVE_TO_WAY_POINT_FINISHED 65|USE_SKILL_FINISHED 66|MOVE_TO_FINISHED 67|IDLE_INTRRUPTED 68|MOVE_AROUND_INTERRUPTED 69|ATTACK_INTERRUPTED 70|CHASE_INTERRUPTED 71|FLEE_INTERRUPTED 72|GET_ITEM_INTERRUPTED 73|DECAYING_INTERRUPTED 74|FOLLOW_INTERRUPTED 75|MOVE_TO_WAY_POINT_INTERRUPTED 76|USE_SKILL_INTERRUPTED 77|MOVE_TO_INTERRUPTED 78|DOOR_HP_LEVEL_INFORMED 79|CONTROLTOWER_LEVEL_INFORMED 80|TB_REGISTER_PLEDGE_RETURNED 81|TB_REGISTER_MEMBER_RETURNED 82|TB_GET_NPC_TYPE_INFORMED 83|TB_SET_NPC_TYPE_RETURNED 84|TB_GET_PLEDGE_REGISTER_STATUS_INFORMED 85|TB_GET_BATTLE_ROYAL_PLEDGE_LIST_INFORMED 86|SUBJOB_LIST_INFORMED 87|SUBJOB_CREATED 88|SUBJOB_CHANGED 89|SUBJOB_RENEWED 90|ON_SSQ_SYSTEM_EVENT 91|SET_AGIT_DECO_RETURNED 92|RESET_AGIT_DECO_RETURNED 93|CLAN_DIED 94|SET_NOBLESS_RETURNED 95|SET_HERO_RETURNED 96|DELETE_PREVIOUS_OLYMPIAD_POINT_RETURNED 97|PSTATE_IDLE 98|PSTATE_MOVE_AROUND 99|PSTATE_DO_NOTHING 100|PSTATE_ATTACK 101|PSTATE_CHASE 102|PSTATE_FLEE 103|PSTATE_GET_ITEM 104|PSTATE_FOLLOW 105|PSTATE_DECAYING 106|PSTATE_MOVE_TO_WAY_POINT 107|PSTATE_USE_SKILL 108|PSTATE_MOVE_TO 109|PSTATE_EFFECT_ACTION 110|PSTATE_PET_DEFAULT 111|PSTATE_MOVE_TO_TARGET 112|PSTATE_MOVE_SUPERPOINT 113|MSTATE_NORMAL 114|MSTATE_BERSERK 115|MS_SILENCE 116|FRIEND 117|SAME_PARTY 118|SAME_BLOODPLEDGE |
|
|
|
|
#16 |
|
Архивный участник
Join Date: Aug 2005
Posts: 1,531
|
Next step... if, elseif, for... Complete. (i hope)
Code:
//---------------------------------------------------
// L2ScriptMaker AI Decompiler Project
//---------------------------------------------------
// Decompiling: xx.xx.2007 1:07:56
// Decompiler build is: 1.0.0.41533
//---------------------------------------------------
....
elseif ((reply == 3))
{
myself->FHTML_SetFileName(fhtml0, ("seed_client_info" + state + ".htm"));
for ( i2 = 1; i2 <= 25; i2 = i2 + 1)
{
myself->FHTML_SetInt(fhtml0, ("CurrentSeedCount" + i2), (myself->GetCurrentSeedSellCountSet(state, i2)));
myself->FHTML_SetInt(fhtml0, ("CurrentSeedPrice" + i2), (myself->GetCurrentSeedPrice(state, i2)));
myself->FHTML_SetInt(fhtml0, ("CurrentSeedRemain" + i2), (myself->GetCurrentSeedRemainCount(state, i2)));
}
myself->ShowFHTML(talker, fhtml0);
}
....
handler SUBJOB_LIST_INFORMED (talker, ask, i0, i1, i2, i3, i4, i5, i6, i7, i8, fhtml0)
{
if ((ask == 1))
{
if ((i8 == 0))
{
if ((i2 == -1) && myself->GetOneTimeQuestFlag(talker, 235) || (i2 != -1) && (i3 >= 75) && (i4 == -1) || (i4 != -1) && (i5 >= 75) && (i6 == -1) && (i0 != 16) && (i0 != 97) && (i2 != 16) && (i2 != 97) && (i4 != 16) && (i4 != 97) && (i6 == -1) && myself->IsInCategory(7, i0) || myself->IsInCategory(8, i0))
{
myself->CreateSubJob(talker, 16);
}
else.
{
myself->ShowPage(talker, "master_lv3_hec_04.htm");
}
}
elseif ((i0 != 16) && (i0 != 97) && (i2 != 16) && (i2 != 97) && (i4 != 16) && (i4 != 97))
{
if ((i8 == 1) && (i3 < 40))
{
myself->ShowPage(talker, "master_lv3_hef_19.htm");
|
|
|
|
|
#17 |
|
Архивный участник
Join Date: Nov 2006
Posts: 203
|
cool. good job.
|
|
|
|
|
#18 |
|
Архивный участник
Join Date: May 2006
Posts: 166
|
ownage dude! keep up your work.
|
|
|
|
|
#19 |
|
Архивный участник
Join Date: Aug 2005
Posts: 1,531
|
have problem in decompiling this part of code
original ai.obj code Code:
push_event // myself push_const 704 add fetch_i push_event // target push_const 96 add fetch_i push_const 1170 func_call 184680579 // func[OwnItemCount] shift_sp -2 push_const 1 equal push_reg_sp fetch_i branch_false L118403 L118402 push_event // always_list push_const 688 add fetch_i push_const 0 push_event // target push_const 96 add fetch_i func_call 251789313 // func[SetInfo] shift_sp -2 shift_sp -1 L118403 L118404 push_event // gg push_const 632 add fetch_i push_event // code_info push_const 696 add push_reg_sp fetch_i push_event // always_list push_const 688 add fetch_i func_call 251658240 // func[Next] assign fetch_i func_call 218169355 // func[IsNull] shift_sp -1 push_const 0 equal branch_false L118405 push_event // code_info push_const 696 add fetch_i // code push_const 60 add fetch_i4 push_reg_sp fetch_i push_const 0 equal branch_false L118408 L118407 my decompiling Code:
if (myself->OwnItemCount(target, 1170) == 1)
{
always_list->SetInfo(0, target);
}
gg = code_info + always_list->Next();
if (code_info.code == 0)
{
myself->SetCurrentQuestID(402);
Code:
if( myself->OwnItemCount(target,1170) == 1 )
{
always_list->SetInfo(0,target);
}
while( code_info = always_list->Next()->() == 0 )
{
if( code_info.code == 0 )
- how you think - how must be decompiled code here - maybe ai.obj code have errors Problem. I cant decompile this code... Im crazy. |
|
|
|
|
#20 |
|
Архивный участник
Join Date: Jul 2006
Posts: 39
|
Why label L118404 are in the code? Is there any link on it? I think that the answers to this Q will make decompilation understandable.
Mistakes in AI? I do not exclude, but rather on a logical level, not compiler errors, whem label appear without meaning. |
|
|
|
|
#21 | |
|
Архивный участник
Join Date: Aug 2005
Posts: 1,531
|
Quote:
Maybe because it made in NCSoft?!With and without - result is one. Problem in code. What must be in source? Ehheehe... |
|
|
|
|
|
#22 |
|
Архивный участник
Join Date: Jan 2006
Posts: 607
|
there's a jump L118404 in that ai class, so L118404 is needed.
|
|
|
|
|
#23 |
|
Архивный участник
Join Date: Aug 2005
Posts: 1,531
|
AIDecompiler complete 98%
Final conclusion: NCSoft AI.obj code is made shoddily, dishonestly. |
|
|
|
|
#24 |
|
Архивный участник
Join Date: Dec 2005
Posts: 156
|
and AI Compiler? :P
|
|
|
|
|
#25 |
|
Архивный участник
Join Date: Aug 2005
Posts: 1,531
|
|
|
|
| Thread Tools | Search this Thread |
| Display Modes | |
|
|