Jump to content

PTS C4/Interlude Npc Speed Load (Vanganth Based)


Recommended Posts

L2Server extend part

IlExt.dll

invoke CNpcSpeedLoad::Initialize() in dllmain

Spoiler

NpcSpeedLoad.h


#pragma once

class CNpcSpeedLoad {
public:

	static void Initialize() {
		g_HookManager.WriteMemoryBYTE(0x6F1E28, 0xFF);
		g_HookManager.WriteMemoryDWORD(0x6F1F74, 100);
	}

};

 

 

L2Npc Extend part

NpcExt.dll

invoke CNpcSpeedLoad::Initialize() in dllmain

Spoiler

NpcSpeedLoad.h


#pragma once

//C - class name
//M - method name
//A - address
//RT - return type
//... - method signature
#define mdef(C, M, A, CC, RT, ...)\
	const uintptr_t M_##C##__##M = (uintptr_t) A;\
	typedef RT ( CC * M_##C##__##M##_T ) (C*, __VA_ARGS__);

//C - class name
//M - method name
//This - pointer to C
//... method parameters
#define invoke(C, M, This, ...)\
	( M_##C##__##M##_T ( M_##C##__##M ) ) (This, __VA_ARGS__)

class CNpcMakerDB;
class CNpcSpeedLoad;
class CNpcEx;

mdef(CNpcMakerDB, ProcessOneNpcMaker, 0x5517D0, __fastcall, bool)
mdef(CNpcMakerDB, ProcessOneNpcMakerEx, 0x551BF0, __fastcall, bool)
mdef(CNpcMakerDB, AddTimer, 0x47F0D0, __fastcall, bool, int, int)
mdef(CNpcMakerDB, TimerExpired, 0x551A10, __fastcall, void, int)

mdef(CNpcEx, AddTimer, 0x47F0D0, __fastcall, bool, int, int);

class CNpcSpeedLoad {
public:

	static void Initialize();

};


class CNpcEx {
public:
	bool AddTimer(int delay, int id) {
		return invoke(CNpcEx, AddTimer, this, delay, id);
	}

	static bool EnterWorld__AddTimer(CNpcEx* This, int delay, int id) {
		return This->AddTimer(0, id);
	}
};

class CNpcMakerDB {
public:

	bool ProcessOneNpcMaker() {
		return invoke(CNpcMakerDB, ProcessOneNpcMaker, this);
	}

	bool ProcessOneNpcMakerEx() {
		return invoke(CNpcMakerDB, ProcessOneNpcMakerEx, this);
	}

	bool AddTimer(int delay, int id) {
		return invoke(CNpcMakerDB, AddTimer, this, delay, id);
	}
	
	void TimerExpired(int id) {
		return invoke(CNpcMakerDB, TimerExpired, this, id);
	}

	static void TimerExpiredHook(CNpcMakerDB* This, int id);
};

 

NpcSpeedLoad.cpp


#include "StdAfx.h"
#include "NpcSpeedLoad.h"
#include "Utils.h"

void CNpcSpeedLoad::Initialize() {
	//define hooks
	//hook vtable CNpcMakerDB::TimerExpired
	WriteQWORD(0x6B8E80, uintptr_t(CNpcMakerDB::TimerExpiredHook));
	//CNpc::EnterWorld -> AddTimer
	WriteCall(0x4D1BBB, CNpcEx::EnterWorld__AddTimer);
}

void CNpcMakerDB::TimerExpiredHook(CNpcMakerDB* This, int id) {
	try {
		if(id == 1) {
			bool result = true;
			for(int i = 0 ; i < 256 && (result = This->ProcessOneNpcMaker()) ; i++);
			if(!result) {
				((int*) This)[180] = 0;//boolean tell if loading CNpcMaker
				g_Log.Add(LogBlue, "ProcessOneNpcMaker processing finish!");
				This->AddTimer(100, 2);
			} else
				This->AddTimer(100, 1);
		} else if(id == 2) {
			bool result = true;
			for(int i = 0 ; i < 256 && (result = This->ProcessOneNpcMakerEx()) ; i++);
			if(result)
				This->AddTimer(100, 2);
			else
				g_Log.Add(LogBlue, "ProcessOneNpcMakerEx processing finish!");
		}
	} catch(...) {
		g_Log.Add(LogError, L"%s error", __FUNCTIONW__);
	}
}

 

Edited by gattsuicu
  • Thanks 1
Link to comment
Share on other sites

  • 1 month later...
  • 6 months later...

Hi! good guide, but.. i have a question.

 

how to add this? 

 

in first part i create the NpcSpeedLoad.h and copy the content...

 

in 2th part i create the NpcSpeedLoad.h and .cpp and copy the content... but.

 

i have a quiestion about: 

"invoke CNpcSpeedLoad::Initialize() in dllmain"

 

i added CNpcSpeedLoad::Initialize() 
in a dllmain.h (in IlExt)

 

but the second part say same invoke CNpcSpeedLoad::Initialize() in dllmain but... in a NPCExt doesn't have a dllmain.h

Edited by katia666
Link to comment
Share on other sites

  • 1 year later...

On Npc.cpp add

 

#include "NpcSpeedLoad.h" 

and CNpcSpeedLoad::Initialize(); under

 

        CSharedFactory::Init();
        CNPC::ExtInit();
        CNPCEventFactory::Init();
        CPostLoad::Init();
        CBaseAction::Init();
        CTimer::Init();
        CScriptAccessible::Init();

Link to comment
Share on other sites

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

    • Hello everyone, forum members!!! Our service does not stand still, continuing to expand the price list and quality of services WE HAVE PREPARED A LARGE NUMBER OF ACCOUNTS IN THE WAREHOUSE FOR YOUR WORK ✔N26 + VCC DE - DE IBAN / Sepa Instant / Virtual cards / LDPlayer ✔Payset business - GB IBAN / sort code / account number / €, GBP ✔BBVA + VCC ES - IBAN ES / Visa card / transaction limit 2000€ per day ✔4x4.io EU - Virtual debit cards for GOOGLE, FACEBOOK, TIKTOK ✔Bitmart EU - Buy & Sell Crypto Instantly provider: Moonpay / Banxa / Legend Trading ✔Xapo Bank Business EU - Sort code / IBAN / account number ✔Wittix Business EU - IBAN LT, GB, DK / SEPA / SWIFT ✔Wise business + VCC - IBAN BE + GB + sort code / USD: AN+RN / Virtual cards ✔Brighty app + VCC EU - IBAN FI / Virtual cards / SWIFT / SEPA / Google, Apple pay, PayPal 2,5% ✔Paytend + VCC EU - IBAN LT / LDPlayer / Virtual card ✔PST + VCC EU - Unlimited virtual cards ✔eBay.com new and aged US - 10k$ - 25k$ limits ✔RedotPay + VCC EU - Virtual cards / Crypto / Apple Pay, Google Pay ✔Wise + VCC EU - IBAN BE + GB / Virtual cards (3DS) / VISA AND MANY OTHERS
    • CLExt Captcha System 4.69+      
    • Welcome to my store :  https://topestore.mysellix.io/fr/ 2015-2022 Aged Discord Account 2015 Discord Account : 50.99 $ 2016 Discord Account : 10$ 2017 Discord Account :3.99 $ 2018 Discord Account : 3.50$ 2019 Discord Account : 2.70 $ 2020 Discord Account :1.50$ 2021 Discord Account :0.99$ 2022 Discord Account :0.70$ Warranty :Lifetime Payment Methods : Crypto/ PayPal Contact Me On Discord Or Telegram Discord : @ultrasstore11 Welcome to my store :https://ultrasstore11.mysellix.io/fr/ 2015-2022 Aged Discord Account 2015 Discord Account : 50.99 $ 2016 Discord Account : 10.50 $ 2017 Discord Account :4.99 $ 2018 Discord Account : 3.99 $ 2019 Discord Account : 2.99 $ 2020 Discord Account :1.99$ 2021 Discord Account :1.50$ 2022 Discord Account :0.99$ Warranty :Lifetime Payment Methods : Crypto/ PayPal Contact Me On Discord Or Telegram Discord :@ultrasstore11 Telegram : https://t.me/ultrastore11   Welcome to my store :https://ultrasstore11.mysellix.io/fr/ 2015-2022 Aged Discord Account 2015 Discord Account : 50.99 $ 2016 Discord Account : 10.50 $ 2017 Discord Account :4.99 $ 2018 Discord Account : 3.99 $ 2019 Discord Account : 2.99 $ 2020 Discord Account :1.99$ 2021 Discord Account :1.50$ 2022 Discord Account :0.99$ Warranty :Lifetime Payment Methods : Crypto/ PayPal Contact Me On Discord Or Telegram Discord :@ultrasstore11 Telegram : https://t.me/ultrastore11  
  • Topics

×
×
  • Create New...