Jump to content

Recommended Posts

Posted

Hi everyone,

 

thanks to Sauron, I was able to decompile and manually fix the whole Gracia Final AI.

 

All sources can be compiled with MyExt64 compiler and the output seems completely right :) If you find any bug/error, please let me know.

 

Download here http://download.l2shrine.com/ai.tar.bz2

 

  • Like 1
  • Thanks 1
Posted

goog work eressea, could you share your complete ai.obj compiled from script folder?

from leaked pack is different i need to know which class were add by rgb-club for work with clean ai.

Posted

goog work eressea, could you share your complete ai.obj compiled from script folder?

from leaked pack is different i need to know which class were add by rgb-club for work with clean ai.

 

Here you go http://download.l2shrine.com/ai.obj.bz2

  • 3 weeks later...
Posted

How to build it?

 

You can either compile just one NASC file (but you'll have to add stubs for all base classes - you need just class definition + parameters used in subclasses) or you can join the whole thing into single NASC file and compile whole AI at the time:

#!/usr/bin/env python

# join NASC AI files to single NASC file

from os import walk, getcwd
from codecs import open

cwd = getcwd()
cwd = u"\\\\?\\%s" % (cwd, )

fw = open("ai.nasc", "w", "utf-16le")

for path, dirs, files in walk("%s\\ai-src" % (cwd, )):
    for file in files:
        print file
        fw.write(open("%s\\%s" % (path, file, ), "r", "utf-8").read())

fw.close()


  • 1 month later...
  • 8 months later...
Posted (edited)

please help deompiled code:

Spoiler

		

		class 1 sia_premium : citizen
		parameter_define_begin
		    int nMoneyId1 4037
		    int nAmount1 150
		    int nDuration1 604800
		    float nAdenaRate1 1.500000
		    float nItemRate1 1.500000
		    float nSpoilRate1 1.500000
		    float nExpRate1 1.500000
		    float nSpRate1 1.500000		

		    int nMoneyId2 4037
		    int nAmount2 250
		    int nDuration2 1296000
		    float nAdenaRate2 1.500000
		    float nItemRate2 1.500000
		    float nSpoilRate2 1.500000
		    float nExpRate2 1.500000
		    float nSpRate2 1.500000		

		    int nMoneyId3 4037
		    int nAmount3 450
		    int nDuration3 2592000
		    float nAdenaRate3 1.500000
		    float nItemRate3 1.500000
		    float nSpoilRate3 1.500000
		    float nExpRate3 1.500000
		    float nSpRate3 1.500000
		    string fnOk "gmshop_premium_activated.htm"
		    string fnError "gmshop_premium_error.htm"
		    string fnAll "gmshop_premium_already.htm"
		parameter_define_end
		handler 32 349    //  MENU_SELECTED
		    variable_begin
		        "talker"
		        "ask"
		        "reply"
		        "myself"
		        "_choiceN"
		        "_code"
		        "_from_choice"
		    variable_end		

		    push_event
		    push_const 160
		    add
		    fetch_i4
		    push_const 360
		    equal
		    branch_false L18
		L0
		    push_event
		    push_const 704
		    add
		    fetch_i
		    push_event
		    push_const 40
		    add
		    fetch_i
		    push_const 0
		    func_call 184680556
		    shift_sp -2
		    push_event
		    push_const 704
		    add
		    fetch_i
		    push_event
		    push_const 40
		    add
		    fetch_i
		    push_const 1
		    func_call 184680556
		    shift_sp -2
		    push_const 0.800000
		    mul
		    greater_equal
		    push_reg_sp
		    fetch_i
		    branch_true L1
		    push_event
		    push_const 704
		    add
		    fetch_i
		    push_event
		    push_const 40
		    add
		    fetch_i
		    push_const 2
		    func_call 184680556
		    shift_sp -2
		    push_event
		    push_const 704
		    add
		    fetch_i
		    push_event
		    push_const 40
		    add
		    fetch_i
		    push_const 3
		    func_call 184680556
		    shift_sp -2
		    push_const 0.800000
		    mul
		    greater_equal
		    or
		L1
		    branch_false L3
		L2
		    push_event
		    push_const 704
		    add
		    fetch_i
		    push_event
		    push_const 40
		    add
		    fetch_i
		    push_const 1118
		    func_call 184680517
		    shift_sp -2
		    shift_sp -1
		    exit_handler
		L3
		    push_event
		    push_const 40
		    add
		    fetch_i
		    push_const 144
		    add
		    fetch_i4
		    push_const 0
		    equal
		    branch_false L16
		L4
		    push_event
		    push_const 164
		    add
		    fetch_i4
		    push_const 1
		    equal
		    branch_false L8
		L5
		    push_event
		    push_const 704
		    add
		    fetch_i
		    push_event
		    push_const 40
		    add
		    fetch_i
		    push_parameter nMoneyId1
		    func_call 184680579
		    shift_sp -2
		    push_parameter nAmount1
		    greater_equal
		    branch_false L7
		L6
		    push_event
		    push_const 704
		    add
		    fetch_i
		    push_event
		    push_const 40
		    add
		    fetch_i
		    push_parameter nMoneyId1
		    push_parameter nAmount1
		    func_call 184746114
		    shift_sp -3
		    shift_sp -1
		    push_event
		    push_const 704
		    add
		    fetch_i
		    push_event
		    push_const 40
		    add
		    fetch_i
		    push_parameter nAdenaRate1
		    push_parameter nItemRate1
		    push_parameter nSpoilRate1
		    push_parameter nExpRate1
		    push_parameter nSpRate1
		    push_parameter nDuration1
		    func_call 185008561
		    shift_sp -7
		    shift_sp -1
		    push_event
		    push_const 704
		    add
		    fetch_i
		    push_event
		    push_const 40
		    add
		    fetch_i
		    push_parameter fnOk
		    func_call 184680516
		    shift_sp -2
		    shift_sp -1
		    jump L17
		L7
		    push_event
		    push_const 704
		    add
		    fetch_i
		    push_event
		    push_const 40
		    add
		    fetch_i
		    push_parameter fnError
		    func_call 184680516
		    shift_sp -2
		    shift_sp -1
		    jump L17
		L8
		    push_event
		    push_const 164
		    add
		    fetch_i4
		    push_const 2
		    equal
		    branch_false L12
		L9
		    push_event
		    push_const 704
		    add
		    fetch_i
		    push_event
		    push_const 40
		    add
		    fetch_i
		    push_parameter nMoneyId2
		    func_call 184680579
		    shift_sp -2
		    push_parameter nAmount2
		    greater_equal
		    branch_false L11
		L10
		    push_event
		    push_const 704
		    add
		    fetch_i
		    push_event
		    push_const 40
		    add
		    fetch_i
		    push_parameter nMoneyId2
		    push_parameter nAmount2
		    func_call 184746114
		    shift_sp -3
		    shift_sp -1
		    push_event
		    push_const 704
		    add
		    fetch_i
		    push_event
		    push_const 40
		    add
		    fetch_i
		    push_parameter nAdenaRate2
		    push_parameter nItemRate2
		    push_parameter nSpoilRate2
		    push_parameter nExpRate2
		    push_parameter nSpRate2
		    push_parameter nDuration2
		    func_call 185008561
		    shift_sp -7
		    shift_sp -1
		    push_event
		    push_const 704
		    add
		    fetch_i
		    push_event
		    push_const 40
		    add
		    fetch_i
		    push_parameter fnOk
		    func_call 184680516
		    shift_sp -2
		    shift_sp -1
		    jump L17
		L11
		    push_event
		    push_const 704
		    add
		    fetch_i
		    push_event
		    push_const 40
		    add
		    fetch_i
		    push_parameter fnError
		    func_call 184680516
		    shift_sp -2
		    shift_sp -1
		    jump L17
		L12
		    push_event
		    push_const 164
		    add
		    fetch_i4
		    push_const 3
		    equal
		    branch_false L17
		L13
		    push_event
		    push_const 704
		    add
		    fetch_i
		    push_event
		    push_const 40
		    add
		    fetch_i
		    push_parameter nMoneyId3
		    func_call 184680579
		    shift_sp -2
		    push_parameter nAmount3
		    greater_equal
		    branch_false L15
		L14
		    push_event
		    push_const 704
		    add
		    fetch_i
		    push_event
		    push_const 40
		    add
		    fetch_i
		    push_parameter nMoneyId3
		    push_parameter nAmount3
		    func_call 184746114
		    shift_sp -3
		    shift_sp -1
		    push_event
		    push_const 704
		    add
		    fetch_i
		    push_event
		    push_const 40
		    add
		    fetch_i
		    push_parameter nAdenaRate3
		    push_parameter nItemRate3
		    push_parameter nSpoilRate3
		    push_parameter nExpRate3
		    push_parameter nSpRate3
		    push_parameter nDuration3
		    func_call 185008561
		    shift_sp -7
		    shift_sp -1
		    push_event
		    push_const 704
		    add
		    fetch_i
		    push_event
		    push_const 40
		    add
		    fetch_i
		    push_parameter fnOk
		    func_call 184680516
		    shift_sp -2
		    shift_sp -1
		    jump L17
		L15
		    push_event
		    push_const 704
		    add
		    fetch_i
		    push_event
		    push_const 40
		    add
		    fetch_i
		    push_parameter fnError
		    func_call 184680516
		    shift_sp -2
		    shift_sp -1
		    jump L17
		L16
		    push_event
		    push_const 704
		    add
		    fetch_i
		    push_event
		    push_const 40
		    add
		    fetch_i
		    push_parameter fnAll
		    func_call 184680516
		    shift_sp -2
		    shift_sp -1
		L17
		    exit_handler
		L18
		    call_super
		handler_end		

		class_end		

 

Edited by webdes27
Posted

Probably something like this but I can't figure out what variable is 144 on talker (CSharedCreatureData + 0x90) - you'll have to find it in your extender (it doesn't seem to be in C4 l2npc.exe):

set_compiler_opt base_event_type(@NTYPE_NPC_EVENT)

class sia_premium : citizen {
parameter:
	int nMoneyId1 = 4037;
	int nAmount1 = 150;
	int nDuration1 = 604800;
	float nAdenaRate1 = 1.500000;
	float nItemRate1 = 1.500000;
	float nSpoilRate1 = 1.500000;
	float nExpRate1 = 1.500000;
	float nSpRate1 = 1.500000;

	int nMoneyId2 = 4037;
	int nAmount2 = 250;
	int nDuration2 = 1296000;
	float nAdenaRate2 = 1.500000;
	float nItemRate2 = 1.500000;
	float nSpoilRate2 = 1.500000;
	float nExpRate2 = 1.500000;
	float nSpRate2 = 1.500000;

	int nMoneyId3 = 4037;
	int nAmount3 = 450;
	int nDuration3 = 2592000;
	float nAdenaRate3 = 1.500000;
	float nItemRate3 = 1.500000;
	float nSpoilRate3 = 1.500000;
	float nExpRate3 = 1.500000;
	float nSpRate3 = 1.500000;
	string fnOk = "gmshop_premium_activated.htm";
	string fnError = "gmshop_premium_error.htm";
	string fnAll = "gmshop_premium_already.htm";

handler:
	EventHandler MENU_SELECTED(talker, ask, reply)
	{
		if (ask == 360) {
			if (GetInventoryInfo(talker, 0) >= GetInventoryInfo(talker, 1) * 0.8
				|| GetInventoryInfo(talker, 2) >= GetInventoryInfo(talker, 3) * 0.8) {

				ShowSystemMessage(talker, 1118);
				return;
			}

			if (talker.unknown144 == 0) { // COULDN'T FIND OUT WHAT IS THIS - It's INT32 on CSharedCreatureData+0x90
				if (reply == 1) {
					if (OwnItemCount(talker, nMoneyId1) >= nAmount1) {
						DeleteItem1(talker, nMoneyId1, nAmount1)
						ChangeDynamicRates(talker, nAdenaRate1, nItemRate1,
							nSpoilRate1, nExpRate1, nSpRate1, nDuration1);
						ShowPage(talker, fnOk);
						return;
					} else {
						ShowPage(talker, fnError);
						return;
					}
				} else if (reply == 2) {
					if (OwnItemCount(talker, nMoneyId2) >= nAmount2) {
						DeleteItem1(talker, nMoneyId2, nAmount2)
						ChangeDynamicRates(talker, nAdenaRate2, nItemRate2,
							nSpoilRate2, nExpRate2, nSpRate2, nDuration2);
						ShowPage(talker, fnOk);
						return;
					} else {
						ShowPage(talker, fnError);
						return;
					}
				} else if (reply == 3) {
					if (OwnItemCount(talker, nMoneyId3) >= nAmount3) {
						DeleteItem1(talker, nMoneyId3, nAmount3)
						ChangeDynamicRates(talker, nAdenaRate3, nItemRate3,
							nSpoilRate3, nExpRate3, nSpRate3, nDuration3);
						ShowPage(talker, fnOk);
						return;
					} else {
						ShowPage(talker, fnError);
						return;
					}
				}
			} else {
				ShowPage(talker, fnAll);
			}
			return;
		}
		super();
	}
}

 

Posted

This nasc code looks like from AdvExt. I do not know which extender you are working on, but looks like the "unknown144" is:

 

int CNPC::IsUserVip(CSharedCreatureData *c);

 

so try to replace like this:

 

if (talker.IsUserVip == 0)

 

cheers

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Posts

    • L2 DEVS - HTML DESIGN (ALL NPC'S)    
    • I only share for free what they are reselling 🙂 You keep crying in all the publications, and if you are looking for h5 or gd wait for 5 or 6 years... cheers.... GENERAL Cached Extended to 8192kb IOBuffer Hair2SlotCache ItemBidAuctioner Clan Hall Current Olympiad Season Rank pages System (Shows Points/Games - Fully Configurable) Automatic Flag Around Raidboss System Offline Shop & Buffers Restore After Restart (Fixed location) Offline Buffer System PvP Auto Announce System Rebuilt with Extra Addons (Fully Configurable, Name, Zones, Rewards) Automatic Announce System Rebuilt with Extra Addons (Fully Configurable) ALT+B Augmentation House Shift+Click Droplist/Spoil List Epic Items Rank RB points Rank ChangeColorName ChangeColorTitle Change Skin (Race) Change Gender Custom Subclass (Acumulative) Achievements Item Delivery System  Augmentations/Enchants Automatic Announce System Auto Learn Skills PvP Reward Pk Reward War Reward Scheme buffer GlobalChatTrade Trade Augment Items Castle Announce Time Castle Standby Time Fix Spiritshots delay SpellbooksDrop Enable/Disable Drop custom Fully configurable, lvl min max allmobs, allrb, individual New cancel effect min,max BlessedarmorEnchantRate BlessedmagicWeaponEnchantRate BlessednormalWeaponEnchantRate MaxSlosChars MaxSlotsDwarfs Enable or disable all commands Fix fast loading npc OlympiadRestoreStatsOnFightStart OlympiadSystemSecondTimeEnabled OlympiadEnterLast10Minute OlympiadThirdClassSummons MinLevelTrade AnnounceSubClassMsg1 AnnounceSubClassMsg2 AnnounceSubClassMsg3 LimitedSubClassRace NoSellItems Change ID SealStones for AA NoPrivateBuyItems NoDropPlayerOnDie DisableSkillEnchantData Show Level Mobs Show npc clan flag DespawnSummonEnBattle SummonPetEnBattle RideSummonPetEnBattle DitanceToTargetMove EnterWorld_Undying EnterWorld_UnHide BlockWhispMessagePlayerToGM UseItemsWithHide CriticalSkillDamageBonusPer=4.0 Disable SSQSystem OnCastle Siege End Use any dyes Buy halls directly in auctioneer without waiting for the auction, configuration to change the item you consume MensajeEnterWorldServer Command .hero enable/disable hero aura Config vip global chat character, chat by systemsg Soulshots: NoSendSystemMessageUse Panel //admin Global vote reward Agathions system Anti Interface, control all patch files by md5 Command .menu configurable, last restart, name, maxusers, privatestores Spawn protection activate deactivate consume items to activate  Activate or deactivate autoloot for vip characters EVENTS Happy Hour Event reworked Configurable by announcements or systemsg Team VS Team Capture The Flag Death Match Last Man Standing Destroy The Base Korean Style Castle Siege Check if the player is inside the tvt event due to disconnection/critical error Top 1/5 killer reward/announce TimeAfk ResetReuseSkills ResetBuffsOnFinish Firework effect Reward win/lost Add Team Location Title custom Red/blue Open Door/Wall System BalanceBishops Show kills in title Invest positions Show Death To Top Delete Non-Subclass Skills     RELOADS Reload Enterworld Html Option Reload Faction System Reload Donate Shop Reload OfflineBuffer Reload Champion NPC Reload CliExt Reload AntiBot Reload Vip System Reload Auction Reload AutoLoot Reload CastleSiegeManager Reload CharacterLock Reload ClanPvPStatus Reload AutoLearn Reload ClanReputationRank Reload ClanSystem Reload CreatureAction Reload Customs.ini Reload L2server.ini Reload SkillData.txt Reload doordata.txt Reload decodata.txt Reload Multisell Reload DropList   Extender tested for more than 3 years. Assured stability. Possibility of adding MOD's upon request. (Not included, consult).
    • some peoples trash is another mans treasure, is that your treasure?   people might like the content but you are still the rat in the room     thats the community judging you.  
    • Keep reselling what I publish here for free!!! 🙂 GG  
  • Topics

×
×
  • Create New...