Jump to content

Recommended Posts

Posted (edited)

I think there is no point to be so pathetic. I'm trying to help you to complete this big work finally, since you've made it public, and probably you want it to be as much usable as it could be.

 

Have to remove your smile mod, since it's done for all cases, instead of doing it properly, where it's needed. But let's skip it finally.

 

I don't know which diff you are using, and don't want to know, but it's obvious that this diff is not right.

 

Ors are missed in about 20 classes (corpse_of_kurtz 1 of them)

 

image.thumb.png.d766045fc82ba21a21591c0da2396e37.png

 

More complicated case fairy_mymyu

image.thumb.png.0cf4bb1a4cba64aec10871763cbe01b0.png

 

image.thumb.png.2ab4c73e7de97d043718ba6eaa60b5ae.png

Empty parameers here and in quest_0503_imperial_gravekeeper , rodd

 

image.thumb.png.095b382c5c26269ccf994009b36f7de3.png

class party_leader_ag_casting_curse : party_leader_casting_curse

parameter_define_begin

parameter_define_end

 

 

Edited by MasterToma
Posted (edited)

Const pushing looks like in wrong place (tor)

image.thumb.png.41e926900d1e38d167215ed89fd40f04.png

 

tutorial_quest_npc

original:

	push_const 4194304
	push_const 2097152
	bit_or
	push_const 8388608
	bit_or
	not
	bit_and
	assign

recompiled

	push_const 4194304
	not
    bit_and
	push_const 2097152
	bit_or
	push_const 8388608
	bit_or
	assign

 

Edited by MasterToma
Posted

Great!

 

1. I've decompiled C1 ai.obj from leaked CHN server using @verbrannt's decompiler (branch c1-support)

2. Compiled back ai.nasc without any changes, using my C1 AI compiler

3. Splited compiled AI classes from original ai.obj and recompiled ai_decompiled.obj in separate files

4. Compared 2 directories (with ignore L\d* and fetch_i\s*//\s*(npc_)class_id

 

Here is result https://ibb.co/jSNsBy

 

Original obj code

1. extra jump is present in 10 files. This jump jumps to next line, so it's completely useless. Don't know, why compiler generates it

2. empty parameters in 4 classes (selected ones on picture) are present in original obj and missed after recompilation. This also could be ignored

class party_leader_ag_casting_curse : party_leader_casting_curse
parameter_define_begin
parameter_define_end
...

 

So, I could say, it's first decompiler for ai.obj, which works (I mean it) at least for C1. But in general, code syntax wasn't changed much in NAS language (I've checked compiler from C4 - only diagnostics were improved and few minor generator changes, but lexer/parser are the same).

 

 

 

Posted (edited)

I would like to request minor (is it?) improvement.

 

There are a lot of cases, where strings are present inside decompiled NAS file. E.g.

	TelPosList Position = {
		{"古鲁丁城镇"; -80749; 149834; -3043; 18000; 0}
	};

But actually, there should be ID from fstring.txt file. Originally, NAS Lexer translates ID from fstring.txt for TelPosList, and Code-Generator inserts string in ai.obj

 

So, this should be like this

	TelPosList Position = {
		{1000003; -80749; 149834; -3043; 18000; 0}
	};

It allowed NCSoft to do script language-agnostic.

 

Similar for AddChoise, but case is more complicated there, since it requires QuestDataChecker.exe

 

Edited by MasterToma
Posted (edited)
9 hours ago, MasterToma said:

I would like to request minor (is it?) improvement.

 

There are a lot of cases, where strings are present inside decompiled NAS file. E.g.


	TelPosList Position = {
		{"古鲁丁城镇"; -80749; 149834; -3043; 18000; 0}
	};

But actually, there should be ID from fstring.txt file. Originally, NAS Lexer translates ID from fstring.txt for TelPosList, and Code-Generator inserts string in ai.obj

 

So, this should be like this


	TelPosList Position = {
		{1000003; -80749; 149834; -3043; 18000; 0}
	};

It allowed NCSoft to do script language-agnostic.

 

Similar for AddChoise, but case is more complicated there, since it requires QuestDataChecker.exe

 

I've added issue for this. Result should have comment with original string like this:

 

{1000003; -80749; 149834; 0} // 1000003 - 古鲁丁城镇

Edited by verbrannt
Posted (edited)

New release: https://github.com/madyanov/nasc-decompiler/releases/tag/v1.5

 

  • Fixed broken precedence & associativity (thx @master-toma for feedback)
  • Recompiled AI now almost the same as original AI (at least C1, thx @master-toma for feedback)
  • GF AI now decompiles without errors (no ignored classes)
  • C1 datapack by @master-toma
  • GD datapack updates by @ChaosPaladin
  • Datapack format changes (enums.json -> pch.json, manual_pch.txt now parsed automatically)
  • AI chronicles now detected automatically
  • Added --output, --ignore & --config options
  • --chronicle option renamed to --chronicles

 

Decompiled AI examples: MEGA
Your feedback & PRs are welcome.

Edited by verbrannt
Posted
46 minutes ago, zconll said:

Thanks you for the new update, for c1 support we have download c1-support  branch from repository?

 

Yeah, wrong release title :) C1 support now only in c1-support branch.

Posted

Thank you, I see on decompiled code something weird, i use options "--chronicles=c1 --tree=0 --utf16le=1", as can you see show some KR/JP string on beginning all classes after "default_npc" class. This don't happen if use default encoded utf8 " --utf16le=0".

Quote

class default_npc {
parameter:
    int DesirePqSize = 50;
    int FavorListSize = 30;
    float IdleDesire_DecayRatio = 0.0;
    float MoveAround_DecayRatio = 0.0;
    float DoNothing_DecayRatio = 0.0;
    float Attack_DecayRatio = 0.0;
    float Chase_DecayRatio = 0.0;
    float Flee_DecayRatio = 0.0;
    float GetItem_DecayRatio = 0.0;
    float Follow_DecayRatio = 0.0;
    float Decaying_DecayRatio = 0.0;
    float MoveToWayPoint_DecayRatio = 0.0;
    float UseSkill_DecayRatio = 0.0;
    float MoveTo_DecayRatio = 0.0;
    float EffectAction_DecayRatio = 0.0;
    float IdleDesire_BoostValue = 0.0;
    float MoveAround_BoostValue = 0.0;
    float DoNothing_BoostValue = 0.0;
    float Attack_BoostValue = 0.0;
    float Chase_BoostValue = 0.0;
    float Flee_BoostValue = 0.0;
    float GetItem_BoostValue = 0.0;
    float Follow_BoostValue = 0.0;
    float Decaying_BoostValue = 0.0;
    float MoveToWayPoint_BoostValue = 0.0;
    float UseSkill_BoostValue = 0.0;
    float MoveTo_BoostValue = 0.0;
    float EffectAction_BoostValue = 0.0;
    
handler:
    EventHandler NO_DESIRE() {
    }

    EventHandler TALK_SELECTED(talker) {
        ShowPage(talker, "noquest.htm");
    }
}
挊氀愀猀猀 挀椀琀椀稀攀渀 㨀 搀攀昀愀甀氀琀开渀瀀挀 笀਀瀀愀爀愀洀攀琀攀爀㨀਀ऀ猀琀爀椀渀最 昀渀䠀椀 㴀 ∀挀栀椀⸀栀琀洀∀㬀਀ऀ਀栀愀渀搀氀攀爀㨀਀ऀ䔀瘀攀渀琀䠀愀渀搀氀攀爀 吀䄀䰀䬀䔀䐀⠀琀愀氀欀攀爀⤀ 笀਀ऀऀ匀栀漀眀倀愀最攀⠀琀愀氀欀攀爀Ⰰ 昀渀䠀椀⤀㬀਀ऀ紀਀紀਀਀class ticket_inspector : citizen {
}
挊氀愀猀猀 渀瀀挀开攀氀搀攀爀 㨀 挀椀琀椀稀攀渀 笀਀紀਀਀class ruler : citizen {
}

 

Posted
12 minutes ago, zconll said:

Thank you, I see on decompiled code something weird, i use options "--chronicles=c1 --tree=0 --utf16le=1", as can you see show some KR/JP string on beginning all classes after "default_npc" class. This don't happen if use default encoded utf8 " --utf16le=0".

 

Fixed.

Posted (edited)
On 7/18/2018 at 3:12 PM, MasterToma said:

I would like to request minor (is it?) improvement.

 

There are a lot of cases, where strings are present inside decompiled NAS file. E.g.


	TelPosList Position = {
		{"古鲁丁城镇"; -80749; 149834; -3043; 18000; 0}
	};

But actually, there should be ID from fstring.txt file. Originally, NAS Lexer translates ID from fstring.txt for TelPosList, and Code-Generator inserts string in ai.obj

 

So, this should be like this


	TelPosList Position = {
		{1000003; -80749; 149834; -3043; 18000; 0}
	};

It allowed NCSoft to do script language-agnostic.

 

Similar for AddChoise, but case is more complicated there, since it requires QuestDataChecker.exe

 

 

After I've impletented this, I found, that compiler (GF by @eressea) doesn't work properly with {int, int, int, int} syntax of TelPosList property.
I've got many errors during compilation:
 

[d:\vss\globalbranch\work\overseas\ct2_final_0109\program\server\l2npc\fstring.h][112] Can't allocate buffer for fstring


Compiler allocates buffer only for first 38 strings, any next string in OBJ file is empty.
NASC that I'm trying to compile: https://mega.nz/#!WeA1WQKQ!2UxWCjQ8x6Y1IBFlJ7nvj8oIYQM6tKyESGleUmaOPhs

 

 

Edited by verbrannt
Posted
14 hours ago, verbrannt said:

 

After I've impletented this, I found, that compiler (GF by @eressea) doesn't work properly with {int, int, int, int} syntax of TelPosList property.
I've got many errors during compilation:
 


[d:\vss\globalbranch\work\overseas\ct2_final_0109\program\server\l2npc\fstring.h][112] Can't allocate buffer for fstring


Compiler allocates buffer only for first 38 strings, any next string in OBJ file is empty.
NASC that I'm trying to compile: https://mega.nz/#!WeA1WQKQ!2UxWCjQ8x6Y1IBFlJ7nvj8oIYQM6tKyESGleUmaOPhs

 

 

 

Fixed - download http://download.l2shrine.com/MyExt64.dll

I'm getting errors about undefined variable talker - it's missing in handler arguments so compiler doesn't see it - first error I get for your AI is

07/22/2018 12:07:04.931, ERROR(780692) : Undeclared variable [talker]

Can you fix it somehow? :)
 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



  • Posts

    • DEVELOPMENT UPDATE #4 ACCOUNT AND CHARACTER SECURITY   Vaelor includes several protection layers for accounts and characters. A personal PIN protects access to the character. PIN verification is also required for sensitive character actions. Incorrect attempts are counted across the protected actions. Repeated incorrect attempts trigger an automatic security response. Computer Lock can restrict access to an authorized device. Hardware identification is used for the game-window limit. Hardware bans are checked before protected character operations. Security settings are available through Alt+B › My Character.   These systems work alongside the normal account credentials and are intended to reduce the damage caused by shared or compromised login information.     ━━━━━━━━━━━━━━━━━━━━━━   Open Beta is currently running.   Create account: https://l2vaelor.com/register Download: https://l2vaelor.com/#download Discord: https://discord.gg/qMgPxH2fd4
    • Some things that I've been working on lately. Client update A new system message window sits right above the chat. Damage, XP, pickups and system messages get their own box, so your chat stays clean. You can switch it off in the chat filter. Screenshots are now HQ and saved as PNG in dated folders. A bit of improvement from old bmp. Fixed a graphics glitch, cursor issues and the taskbar on Windows 11. Closer to retail C1 Buffs and debuffs now disappear on death, as on the original server. Clan wars last unlimited until one side surrenders. A stun is no longer broken by the hit that caused it, and Lucky no longer protects players with PKs. Doors and line of sight were checked against the original game. Sieges Castle walls can only be damaged by a Siege Golem. Players, other summons and skills cannot damage them. This is C1 mechanic so I will make a poll regarding this. Building Headquarters can be interrupted by damage, so protect your clan leader. Queen Ant and pets When Queen Ant spawns, everyone in her nest is teleported out, as on retail. Pets and servitors count as humanoid, as in C1. Original C1 bugs fixed Monsters hesitating instead of chasing you. They now finish the swing and then follow. Monsters are no longer moving while asleep or rooted. The Composite Armor set and Decrease Weight having no effect on weight fixed Anti-bot We've started building our own anti-bot system into the server itself. Bots aren't really welcome.
    • Version 0.3.0 - NPC rendering and npcpos.txt editing https://res.cloudinary.com/h4p9pew6/video/upload/v1792026335/npc-spawns-editor.mp4   A new NPC Spawns tab. Choose an L2OFF script folder and Cruma shows the server's spawns right in the game world: - Every spawn zone is a colored outline on the geodata. From high up you also see the zones far below. - NPCs stand where the server puts them. Random spawns use the same logic as the server. - Editing: move a whole zone or its corners, add and remove corners; move and turn NPCs; change the NPC, count, respawn time, AI and its parameters; add and delete zones, makers and NPCs; rename zones and makers and every reference to a zone is updated; new zones are named after the nearest zone (for example, benon_1725_07 next to benon_1725_06). - Actions: click an NPC or a zone to open its maker; double-click to start editing; search for NPCs; the focus button flies the camera to an NPC; the View menu can hide zone outlines and keep only the NPCs. - Each client remembers its own script folder, the same way it remembers its geodata folder. - Saving: only the edited lines of npcpos.txt change; before writing, you see a diff of the changes (maximum_npc 4 -> 3); every version is kept as a dated backup.   Improvements - UI changes: small fixes and a wider tool tab.   Download Link: 0.3.0
    • Why not, if you're interested I will post an update
    • UPD: New features and improvements
  • Topics

×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..