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

    • The bot video lasts 35 minutes and not everything is shown there, if everything was shown, the video could have lasted several hours. Also, the video quality is reduced so as not to take up much space.The last minutes of the video show bots attacking each other on the event. https://dropmefiles.com/1jMi2
    • We also forgot to say that the deal will be the way you want it, we are ready for almost any of your demands. And we ask the administration to review our post as soon as possible, because several hours have passed and it still hasn't passed moderation, thank you in advance!  
    • 💥Super offer GitHub Account  (5 years)💥 ⚠️ Available to order for only $20🔥
    • Good day to all! We present to your attention our source code h5, where several projects used and achieved very good results, both in terms of online and in general for the project. (Due to confidentiality, the list of projects, the test server and what the basis of the source code will be provided only to real buyers, where they can go and check them out)   The main feature is bots, which are very animated, one to one like real players. But, in addition to bots, the build has a lot of interesting and modern things. Below will be a video showing bots and a little about the server.   As we said, the build was used on several projects, so the first thing that is there is not a single backdoor on the server, all serious and critical errors have been fixed. Races and classes are closer to the official PTS platform.   And also the server can be used as a classic server, as well as a server with add-ons, because the server has added many new things, weapons, armor, jewelry, hats, cloaks, etc.   The server has a full working community board (alt+b), working locations, quests, geodata, mechanism, working ai, in general there are no problems and complaints. In alt+b, shops, various services, buffer, player statistics, clan statistics, mail, profession change, personal account, registration for events, etc. are available.   Additional services: Premium account, visual costumes, nickname change services (for yourself and your pet), nickname and title painting service, karma/PC cleaning, expand services, weapon/armor/jewelry sharpening service, level up and down service, nobles purchase service, beauty salon (new hairstyle change from higher chronicles and face change), additional window purchase service, clan reputation purchase service, weapon augmentation purchase service.   Internal services: auto potions (acp), referral system, repair services, automatic reward delivery after n. time, additional auction, and other working systems, also many available commands, such as: exact date of epic respawn, password change directly inside the game, offline buffer, auto att, registration for castle sieges directly by entering a command and other available commands.   The server has protection (both on the server side and on the client side) that protects against free software and also several other anti-bot systems that will not give the slightest chance to bot users. But if you want people to use software, you just turn it off.   Bots. As we said, one of the main features of our server is bots, they are one to one like real players, now a little about bots and below is a link to a video about how they work: Server bots are like real players, their AI is copied from the AI ??of real characters, and therefore they get what real players get and you can also do with them everything that can be done with real characters.   They write in chats, in all chats, trade, shout, pm, clan chat, general chat. They walk around the cities, level up, farm, kill each other in pvp and pc, put on weapons, armor, jewelry, sharpen weapons. According to their level, they will choose their professions, join clans, participate in different events, use alt+b services - I'm telling you, their AI is copied and adapted like a real player's AI, so they can do everything that a real player can.   Bot control: You can set a chat and words for bots, how often or rarely they will write in chats, you can control where and how the bots will level up, you can control what events they will be at, you can control what cities they will run in, you can control where they will stand, you can even call them to you and that's not all, they are completely in your hands and you can twist them as you want. The bot video lasts 35 minutes and not everything is shown there, if everything was shown, the video could have lasted several hours. Also, the video quality is reduced so as not to take up much space.   You can check the rest yourself on the test server and we will fully show you everything that bots are capable of and you will be surprised)   Now about the price and a little about our work and what is included in this price. We do not sell only the build, we sell the source code in its entirety, so that you can adapt something for yourself. The price of the source code: 15,000 euros. What is included in this price: 1. We do not have a license, you buy it once and you can use it for the rest of your life. 2. There is no online limit and there is also no limit on running bots, the server can support as much online and bots as your VDS is powerful. 3. Client-side protection. You will not pay extra for protection, the source code already has everything. 4. All builds that we have created for projects that bought the source from us (they have ready-made servers, with their own ready-made concepts, configs, different alt+b designs, for different rates x1, x10, x20, x50, x100, x1200, x5000, there are also servers for classics and servers with add-ons, they all have configured bots for their servers) all this will be included in this price. You will receive all the builds of these projects. 5. Once a year we update and improve the source, we will also improve the bots, make different paths for them, different farming places, and revive them more and more, to get them you will have to pay 20 euros to get the updates. 6. You will receive all the bot settings from our first projects to the last, the video shows little, our last configured bots are almost indistinguishable from real players and you will see this yourself on the test server or later. (Our last setup and development of bots lasted 11 months and these works and what bots can do cannot be described in words, you yourself must see them to feel this work and power) 7. We will teach you how to control both the server and training on setting up and controlling bots. 8. We will provide you with VDS for 3 months and if necessary we will help you as much as we can until the first launch of your project! 9. Our bots move, they don't stand in one place, they walk around the cities and use a teleport, after the teleport they move on to the farming place in random places. They communicate in the chat and if you hit them, they can hit you back. They are in almost every city and farming location, near many key NPCs, instance zone managers, etc. They are automatically updated and move around the cities and farming zones. They attack those who have a flag and those who is pk. These are simply unique bots that can help you in terms of your online and your project in general! 10. As we said, our latest bot development lasted 11 months and we made 92 new farm zones for bots, more than 150,000 new paths for all locations, different methods of dressing their equipment, different methods of their behavior and more than 40,000 universal words in the chat, in different languages, where no one can even doubt that these are bots! Our contact information Telegramm: https://t.me/jg_uc Discord: j.g.u.c_dev
  • Topics

×
×
  • Create New...