Jump to content

Recommended Posts

Posted (edited)

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
  • 1 month later...
  • 6 months later...
Posted (edited)

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
  • 1 year later...
Posted

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();

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

    • I tried it, very neat work. Just keep improving it, there's potential.
    • 🔥 Grand Opening: 29 May 2026 – 19:00 Germany Time Website: https://l2-lorena.com/ Discord: https://discord.gg/TYZ88Tgx4b ━━━━━━━━━━━━━━━━━━━━━━ General Information • Chronicle: Interlude • Server Type: PvP Rates • EXP/SP: x5000 • Adena: x500 • Drop: x500 Premium Account • 2x EXP / Drop / Adena ━━━━━━━━━━━━━━━━━━━━━━ Starting Setup • Starting Town: Aden • Starting Level: 76 • Starting Gear: S-Grade ━━━━━━━━━━━━━━━━━━━━━━ Enchant System • Safe Enchant: +4 • Normal Scroll: 50% • Blessed Scroll: 70% • Crystal Scroll: 100% ━━━━━━━━━━━━━━━━━━━━━━ Subclass System • All classes available • Dominator subclass enabled • Dominator subclass cost: 20 Donate Coins ━━━━━━━━━━━━━━━━━━━━━━ Items Balance • Custom items • Elegia Armor added as Custom Set • Rare S-Grade items with boosted stats • Balanced PvP gameplay ━━━━━━━━━━━━━━━━━━━━━━ Siege & PvP Rewards • Aden Castle special reward: 200 Donate Coins • Competitive PvP and siege-focused gameplay ━━━━━━━━━━━━━━━━━━━━━━ Epic Bosses • All Epic Bosses available up to Valakas ━━━━━━━━━━━━━━━━━━━━━━ Augmentation Rates • Top LS: 100% skill chance • High LS: 7% skill chance • Mid LS: 3% skill chance ━━━━━━━━━━━━━━━━━━━━━━ Perfect For Players Who Want ✔ Fast progression ✔ Clean Interlude gameplay without custom chaos ✔ Active PvP action ✔ Competitive sieges ✔ Long-term fun
    • I think u need https://adrenalinebot.com/en/script/anti-captcha/ But contact tech support to be sure it works on ur server
    • Hello everyone, Are you looking for a server where you can have fun with friends and relive the good old days of Lineage II? Join us for an enjoyable adventure, exciting battles, and a nostalgic old-school experience together with the community. Introducing a Gold-style fast progression gameplay experience — no more spending months in the same zone farming endlessly. Enjoy faster progress, more action, and a more rewarding adventure from the very beginning. For more information and updates, visit our Facebook page and join the community! Download patch:https://mega.nz/file/hEUAFIAY#8F5BMBRV_v-O1gjDTLsCkmFiWFMvT3hzVYSMdswm2rs
  • 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..