Jump to content

Recommended Posts

Hi,

 

As far as yo know, there was only nc.exe for C0, which was patched by kvoxi to be compatible with C1. However, it has few bugs (some offsets are wrong, for meal for example). So I've decompied NASC for C1. It took me only 3 days, since everything is inside 1 function (apart yacc modules and NPC-related data, which was decompiled in scope o L2NPC.exe), which is about 2200 lines long.

 

It's original compilator from C1, which is built inside L2NPC.exe. Feel free to use it. However, custom C1 Script code won't compile, you will get errors for missed fields:

 field[m_nNPC_clan_id] doesn't exist
 field[m_nBuilderLevel] doesn't exist
 field[curslot] doesn't exist
 field[m_bIsOnline] doesn't exist
 field[m_bIsPledgeMaster] doesn't exist
 field[m_bIsNPC_in_Clan] doesn't exist
 field[m_nPledgeId] doesn't exist
 field[m_nResidenceId] doesn't exist
 field[m_nMountType] doesn't exist
 field[feet_uid] doesn't exist
 field[head_uid] doesn't exist
 field[exp] doesn't exist
 field[m_Direction] doesn't exist
 field[sex] doesn't exist
 field[m_bIsRunning] doesn't exist

I know, that it's very easy to fix, but my goal is to provide ORIGINAL C1 compiler. For those, who need just tweaked one, might use kvoxi's mode.

 

C1 sources are very similar to C4 ones, where actually only error diagnostic was improved, and few more changes in ai.obj out were added. But to test C4 I need a C4 scripts. If someone could share them, then I can decompile and build C4 compilator.

 

PS: It's  x64 version

Share this post


Link to post
Share on other sites

very nice +1

 

PS: By scripts you mean the whole folder from a c4 pack? Would the postpacific release be ok? I never found the original c4 leaked files, and not sure if PPC modified or added any custom.

Share this post


Link to post
Share on other sites

No, I mean AI scripts in NCSOFT scripting language. Code like this:

 

class my_ai
{
handler:
	EventHandler CREATED()
	{
		if( ShoutMsg1 > 0 )
		{
			Shout(MakeFString(ShoutMsg1,"","","","",""));
		}
		if( MoveAroundSocial > 0 || ShoutMsg2 > 0 || ShoutMsg3 > 0 )
		{
			AddTimerEx(1001,actInterval);
		}
	}
}

This one is passed as an input to the NASC to get ai.obj. Probably someone has them in private (decompiled with sauron's C4 decompiled and fixed manually)

Share this post


Link to post
Share on other sites

Thanks you for this original c1 nasc, i have this c4 ai (not 100% fixed). I hope you will be very helpful.

C4 Ai merged

 

btw Could to be possible compile nasc c1 in release mode please?  msvc2015 redist.  have missing debug libraries and then need install full visual studio 2015.

Share this post


Link to post
Share on other sites
28 minutes ago, zconll said:

Thanks you for this original c1 nasc, i have this c4 ai (not 100% fixed). I hope you will be very helpful.

C4 Ai merged

 

btw Could to be possible compile nasc c1 in release mode please?  msvc2015 redist.  have missing debug libraries and then need install full visual studio 2015.

Tnx for C4 scripts. I'll check them!

 

Yes, ofc. I re-uploaded release version with static c-runtime, so no redist is needed. Thx for note!

Share this post


Link to post
Share on other sites

Thanks you again.

I am testing your compiler, when compiler find one error during code compilation not dump information about error(s) found in "compile_msg.txt" only show quantity errors found so  it's hard to fix code.

Share this post


Link to post
Share on other sites
Posted (edited)

@zconll, tnx a lot for the feedback! Indeed, this part of code haven't been revealed. Ofc, it's a bug in decompiled sources. I fixed it and re-uploaded newest version.

 

 

Edited by MasterToma

Share this post


Link to post
Share on other sites

Okay, I've found some error root-causes (if talking about C1-package from PP and smeli) . Few variables were present with same offset in original C1, but have another names. So, in your script files (ai_macro.txt, ai_script.txt and questdata.txt) you have to change 

m_bIsPledgeMaster -> is_pledge_master
m_nResidenceId -> residence_id
m_nPledgeId -> pledge_id

 

and remove all        

 int residence_id = 0;

(probably it was a work-around, related with wrong name). About all other errors, I will figure out, when all L2NPC.exe will be decompiled. Probaby there are some functions in script
 

  • Thanks 1

Share this post


Link to post
Share on other sites

Not yet. But I've posted extended compiler 

NASC-C1 compilator is on done. Extended compiler might be found here (use --extmode)
and will publish Quest Compiler soon.

Share this post


Link to post
Share on other sites

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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×