• Unfortunately, we have experienced significant hard drive damage that requires urgent maintenance and rebuilding. The forum will be a state of read only until we install our new drives and rebuild all the configurations needed. Please follow our Facebook page for updates, we will be back up shortly! (The forum could go offline at any given time due to the nature of the failed drives whilst awaiting the upgrades.) When you see an Incapsula error, you know we are in the process of migration.

Healing Pets

Skilled Illusionist
Joined
Oct 31, 2008
Messages
341
Reaction score
294
config:
Index = index need to be in Inventory
Amiun = how much healed
Cooldown = 2 Seconds
PHP:
(Index 48)(Amount 300)(Cooldown 2)
I'm not sure if it's stable.

Sign up if you have problems


#Update

Item must now be worn
 

Attachments

You must be registered for see attachments list
Last edited:
Experienced Elementalist
Joined
Sep 29, 2014
Messages
214
Reaction score
20
why when i download it i get a php file not a winrar file ?
 
Skilled Illusionist
Joined
Oct 31, 2008
Messages
341
Reaction score
294
PHP:
// dllmain.cpp : Definiert den Einstiegspunkt für die DLL-Anwendung.
#include "stdafx.h"

#include <fstream>
#include <iostream>
#include <string>
#include <vector>

#include <io.h>
#include <fcntl.h>

namespace GameServer
{
	namespace IOCriticalSection
	{
		static void(__thiscall *Enter)(void *Section) = (void(__thiscall*)(void*))0x00423640;
		static void(__thiscall *Leave)(void *Section) = (void(__thiscall*)(void*))0x004236d0;
	}
	namespace Link
	{
		static void(__thiscall* MoveTo)(void *Object, int x) = (void(__thiscall*)(void*, int))0x00438C40;
	}
	namespace Player
	{
		static void* (__thiscall *FindItem)(void* Player, int Index,int Num) = (void* (__thiscall*)(void*,int, int a6))0x0045D190; 
		static char* (__cdecl *UpdateProperty)(void* Player, int Type, int IncDec, signed __int64 Amount) = (char* (__cdecl*)(void* Player, int Type, int IncDec, signed __int64 Amount))0x00458800; 
	}
	namespace MainServer
	{
		static BOOL(__cdecl *ConsoleWriteBlue)(const char* text, ...) = (BOOL(__cdecl*)(const char* text, ...))0x00432860;
	}
	namespace Item
	{
		static int (__thiscall *IsState)(int thispointer, int a2) = (int (__thiscall*)(int thispointer, int a2))0x00427130;
	}
}
struct SPets
{
	int Index;
	int Amount;
	int Cooldown;
	int Counter;
};
std::vector<SPets> HealPetsVec;
unsigned long __stdcall MainThread(void* _k)
{
	UNREFERENCED_PARAMETER(_k);
	Sleep(3000);
	GameServer::MainServer::ConsoleWriteBlue("--->>>>> Healing Pet's - Done! <<<<-----");
	/*int hCrtIn, hCrtOut;
	FILE *conIn, *conOut;
 
	AllocConsole();
	hCrtIn = _open_osfhandle ((intptr_t) GetStdHandle(STD_INPUT_HANDLE), _O_TEXT);
	hCrtOut = _open_osfhandle ((intptr_t) GetStdHandle(STD_OUTPUT_HANDLE), _O_TEXT);
	conIn = _fdopen( hCrtIn, "r" );
	conOut = _fdopen( hCrtOut, "w" );
	*stdin = *conIn;
	*stdout = *conOut;
	*/
	std::ifstream spawnitem;
	spawnitem.open("HealPets.txt");
	std::string strTemp;
	std::string line;
	if(spawnitem.is_open())
	{
		while (std::getline(spawnitem,line,'(').good())
		{
				SPets pet;
				spawnitem >> strTemp >> pet.Index >> strTemp >> pet.Amount >> strTemp >> pet.Cooldown;
				HealPetsVec.push_back(pet);
		}
	}
	spawnitem.close();

	Sleep(10000);
	do
	{
		Sleep(1000);
		for(std::vector<SPets>::iterator it = HealPetsVec.begin(); it != HealPetsVec.end(); ++it) 
		{
			it->Counter+=1;
			if(it->Counter >= it->Cooldown)
			{
				GameServer::IOCriticalSection::Enter((void*)0x4e2078);
				GameServer::IOCriticalSection::Enter((void*)0x4e2098);
				GameServer::Link::MoveTo((void*)0x4e200c, (int)0x4e2004);
				GameServer::IOCriticalSection::Leave((void*)0x4e2098);

				int* Playerp = 0;
				for (unsigned long i = *(unsigned long*)0x4e2004; i != 0x4e2004; i = *(unsigned long*)i)
				{
					Playerp = (int*)(i - 428);
					if (Playerp)
					{
						int* pItem = (int*)GameServer::Player::FindItem(Playerp,it->Index,1);
						if(pItem)
						{
							//int isOn = GameServer::Item::IsState((int)pItem,1);
							int state = pItem[12];
							if(state == 1 || state == 9 || state == 129)
							{
								GameServer::Player::UpdateProperty(Playerp,7,1,it->Amount);
							}
						}
						
					}
				}
				GameServer::IOCriticalSection::Leave((void*)0x4e2078);
				it->Counter == 0;
			}
		}
				
	}while(true);

	return TRUE;
}


void init()
{
	CreateThread(0,0,MainThread,nullptr,0,nullptr);
}
BOOL APIENTRY DllMain( HMODULE hModule,DWORD  ul_reason_for_call,LPVOID lpReserved)
{
	DisableThreadLibraryCalls(hModule);
	switch (ul_reason_for_call)
	{
		case DLL_PROCESS_ATTACH:
			init();
		break;
	}
	return TRUE;
}