Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

Client Addons Source v.1.0.0.2

Newbie Spellweaver
Joined
Dec 11, 2007
Messages
9
Reaction score
0
who have this addon for main 1.03.52 ( titantechs 11.oo) ??
 
Junior Spellweaver
Joined
Jul 30, 2005
Messages
176
Reaction score
110
[*] Problems with the closing of the client on different operating systems of Windows. Fixed
[*] The problem with the braking when using Skill Bird character DarkLord.
Unnable to find these two fixes in the source code...

Some clue ?
 
Newbie Spellweaver
Joined
Jan 13, 2010
Messages
98
Reaction score
118
[*] Problems with the closing of the client on different operating systems of Windows. Fixed
[*] The problem with the braking when using Skill Bird character DarkLord.


More attention on functions. GetMemBuffer, UnProtect -> The first fix for correct access memory to read/write some values. In this case is 3d camera values.
Second fix is method of intercept function, method like used in this source, I mean opengl.dll is more fast like this for example:
Therefore, when I using skill Bird no more brakings like in my old source. You can compare this.
 
Experienced Elementalist
Joined
Apr 15, 2012
Messages
203
Reaction score
25
Can u help me to fix the black spaces?
Im using main 1.04D GMO protocol.

QSaPXtt - Client Addons Source v.1.0.0.2 - RaGEZONE Forums
 

Attachments

You must be registered for see attachments list
Joined
Jun 18, 2013
Messages
474
Reaction score
73
Little Description








A Little More Description

Main Addons
Developed by Mr.Kernighan​

# First version: 1.0.0.1

  • Linear fog
    Screenshots:



    - Web Tool to generate rgb color



  • Linear Smoothing
    Screenshots:



# Update to version: 1.0.0.2

  • Increased the limit load the textures of objects and weapons.
  • Increased the slots of added items and weapons. (Max. 127 for each category)
    [*] Problems with the closing of the client on different operating systems of Windows. Fixed
    [*] The problem with the braking when using Skill Bird character DarkLord. Fixed
    [*] Low cpu usage (Thanks for giving Hybrid source). Fixed
    [*] Support for new stones used RMST server. (Thanks for giving SmallHabit source code). Added
    [*] Separation of system messages from the game chat (Thanks for giving Hybrid source). Added

Configuration file
Code:
; #########################
; 3D Camera settings   
; #########################

; ~~~~~~~~~~~~~~~~~~~~~~~~~
[3D]
; ~~~~~~~~~~~~~~~~~~~~~~~~~
IsActive  = 1 ; 
; ~~~~~~~~~~~~~~~~~~~~~~~~~
Sensivity = 8 ; 
; ~~~~~~~~~~~~~~~~~~~~~~~~~


; #########################
; Linear smoothing settings
; #########################

; ~~~~~~~~~~~~~~~~~~~~~~~~~
[Smoothing]
; ~~~~~~~~~~~~~~~~~~~~~~~~~
IsEnabled = 1     
; ~~~~~~~~~~~~~~~~~~~~~~~~~

; #########################
; Linear fog settings
; #########################

; ~~~~~~~~~~~~~~~~~~~~~~~~~
[Fog]
; ~~~~~~~~~~~~~~~~~~~~~~~~~
IsEnabled = 1     
; ~~~~~~~~~~~~~~~~~~~~~~~~~
Start = 1600.0    
; ~~~~~~~~~~~~~~~~~~~~~~~~~
End = 2100.0      
; ~~~~~~~~~~~~~~~~~~~~~~~~~

; #########################

; ~~~~~~~~~~~~~~~~~~~~~~~~~
[Default]
red = 0.0
green = 0.0
blue = 0.0
; ~~~~~~~~~~~~~~~~~~~~~~~~~
[Lorencia]
red = 0.83
green = 0.8025
blue = 0.2805
; ~~~~~~~~~~~~~~~~~~~~~~~~~
[Dungeon]
red = 0.83
green = 0.7581
blue = 0.6142
; ~~~~~~~~~~~~~~~~~~~~~~~~~
[Devias]
red = 0.6643
green = 0.8158
blue = 0.91
; ~~~~~~~~~~~~~~~~~~~~~~~~~
[Noria]
red = 0.3689
green = 0.58
blue = 0.2552
; ~~~~~~~~~~~~~~~~~~~~~~~~~
[LostTower]
red = 0.0
green = 0.0
blue = 0.0
; ~~~~~~~~~~~~~~~~~~~~~~~~~
[Stadium]
red = 0.56
green = 0.4424
blue = 0.308
; ~~~~~~~~~~~~~~~~~~~~~~~~~
[Atlans]
red = 0.451
green = 0.6478
blue = 0.82
; ~~~~~~~~~~~~~~~~~~~~~~~~~
[Tarkan]
red = 0.83
green = 0.667
blue = 0.3154
; ~~~~~~~~~~~~~~~~~~~~~~~~~
[Icarus]
red = 0.077
green = 0.1318
blue = 0.22
; ~~~~~~~~~~~~~~~~~~~~~~~~~
[Kalima]
red = 0.1736
green = 0.3475
blue = 0.56
; ~~~~~~~~~~~~~~~~~~~~~~~~~
[ValeyOfLoren]
red = 0.85
green = 0.3156
blue = 0.1872
; ~~~~~~~~~~~~~~~~~~~~~~~~~
[LandOfTrial]
red = 0.0
green = 0.0
blue = 0.0
; ~~~~~~~~~~~~~~~~~~~~~~~~~
[Aida]
red = 0.3403
green = 0.47
blue = 0.3008
; ~~~~~~~~~~~~~~~~~~~~~~~~~
[CryWolf]
red = 0.39
green = 0.3156
blue = 0.1872
; ~~~~~~~~~~~~~~~~~~~~~~~~~
[Kanturu]
red = 0.18
green = 0.1708
blue = 0.1494
; ~~~~~~~~~~~~~~~~~~~~~~~~~
[BalgasBarrack]
red = 0.47
green = 0.1363
blue = 0.1363
; ~~~~~~~~~~~~~~~~~~~~~~~~~
[Elbeland]
red = 0.76
green = 0.76
blue = 0.76
; ~~~~~~~~~~~~~~~~~~~~~~~~~
[Raklion]
red = 0.6643
green = 0.8158
blue = 0.91
; ~~~~~~~~~~~~~~~~~~~~~~~~~
[SantaTown]
red = 0.6643
green = 0.8158
blue = 0.91
; ~~~~~~~~~~~~~~~~~~~~~~~~~

Link:

Credits: Brain aka Mr.Kernighan, SmallHabbit, Gembrid aka Hybrid, ZergNM.

Estj vazhmozhnastj peredelatj etat source pod 1.04E main.exe?

ENG.
Its possible to adapt source for 1.04E main.exe?
 
Experienced Elementalist
Joined
Apr 15, 2012
Messages
203
Reaction score
25
Estj vazhmozhnastj peredelatj etat source pod 1.04E main.exe?

ENG.
Its possible to adapt source for 1.04E main.exe?

Yes brother, im using that in 1.04D, and it's the same poop lol
 
Experienced Elementalist
Joined
Apr 15, 2012
Messages
203
Reaction score
25
Maybe u can share it here? I want to try it on 1.04E main.exe

Yeap, i only used the 3d cam.

3DCamera.cpp
Code:
#include "Stdafx.h"
#include "3DCamera.h"


//1.04D OFFSETS
#define CAMERA_ZOOM   0x00D27BFC
#define CAMERA_ROTY   0x00D27B88
#define CAMERA_ROTZ   0x087933D8
#define CAMERA_POSZ   0x00D255AC
#define CAMERA_CLIPX  0x00D2C848
#define CAMERA_CLIPY  0x00D2C894
#define CAMERA_GLCLIP 0x00D2570C 

#define Main_PrintGlobal 00597630H;


int *MAIN_STATE_ADDR  = (int*)0x00E609E8; 
int *MAP_CHECKER_ADDR = (int*)0x00E61E18;  


#define CAM_DEFAULT (*Camera_PosZ != 150.0f || *Camera_RotZ != -45.0f || *Camera_RotY != -48.5f || *Camera_Zoom != 35.0f)

enum MAINSTATE {
	SELECT_SERVER    = 2,
	SELECT_CHARACTER = 4,
	SELECT_GAME      = 5,
};

bool CAM_Init = true;
bool CAM_Move = false;
bool VK_IsPressed = false;


void Message(int ColorId, char* Message)
{
	_asm
	{
		Mov Edi,Main_PrintGlobal
        Push ColorId
        Push Message
        Call Edi
		Add Esp,0x8
	}
}

//int Is3D = 1; //GetPrivateProfileIntA("3D", "IsEnabled", true, "./Custom/Settings.ini");
int CAM_IsActive = 1;
//int CAM_IsActive = GetPrivateProfileIntA("3D", "IsActive", 1, ".\\Custom\\Settings.ini");
int Sensivity = GetPrivateProfileIntA("3D", "Sensivity", 8, ".\\Custom\\Settings.ini");

BOOL KeyboardSetHook(BOOL set_or_remove) {
	if(set_or_remove == TRUE) {
		if(KeyboardHook == NULL) {
			KeyboardHook = SetWindowsHookEx(WH_KEYBOARD, (HOOKPROC)KeyboardProc, hInstance, GetCurrentThreadId());
			if(!KeyboardHook) { return FALSE; }
		}
	} 
	else {
		KeyboardHook = NULL;
		return UnhookWindowsHookEx(KeyboardHook);
	}
	return TRUE;
}

BOOL MouseSetHook(BOOL set_or_remove) {
	if(set_or_remove == TRUE) {
		if(MouseHook == NULL) {
			MouseHook = SetWindowsHookEx(WH_MOUSE, MouseProc, hInstance, GetCurrentThreadId());
			if(!MouseHook) { return FALSE; }
		}
	} 
	else { 
		MouseHook = NULL;
		return UnhookWindowsHookEx(MouseHook); 
	}
	return TRUE;
}

float GetMemBuffer(DWORD *dwpAddress) {
	float pBuffer;
	if (ReadProcessMemory(GetCurrentProcess(), dwpAddress, (float*)&pBuffer, 4, 0) == TRUE) 
		return pBuffer;
	else return 0;
}

void UnProtect(DWORD *dwpAddress, float pBuffer) {
	DWORD dwOldProtect = 0;
	HANDLE hWnd = GetCurrentProcess();
	VirtualProtectEx(hWnd, dwpAddress, 4, PAGE_EXECUTE_READWRITE, &dwOldProtect);
	WriteProcessMemory(hWnd, dwpAddress, (void*)&pBuffer, 4, 0);
	VirtualProtectEx(hWnd, dwpAddress, 4, PAGE_EXECUTE_READWRITE, &dwOldProtect);
}

LRESULT CALLBACK KeyboardProc(int nCode, WPARAM wParam, LPARAM lParam) {	
	if (((lParam >> 31) & 1) && (nCode == HC_ACTION)) {
		
		if (wParam == VK_F10)	{
			if (VK_IsPressed == false && CAM_IsActive == true)	{
				VK_IsPressed = true; CAM_IsActive = false;
				Message(1,"Camera OFF");
			}
			else	{
				VK_IsPressed = false; CAM_IsActive = true;
				Message(1,"Camera ON");
			}
		}

		if (wParam == VK_F9) {
			_beginthread(CAMDefault, 0, NULL); 
			Message(1,"Camera Reseted");
		}
	}	
	return CallNextHookEx(KeyboardHook, nCode, wParam, lParam);
}


LRESULT CALLBACK MouseProc(int code, WPARAM wParam, LPARAM lParam){
	MOUSEHOOKSTRUCTEX* mhs = (MOUSEHOOKSTRUCTEX*)lParam;
	HWND MuWnd = FindWindow("MU", NULL);

	if (*MAIN_STATE_ADDR == SELECT_CHARACTER || *MAP_CHECKER_ADDR == 0x1E || *MAP_CHECKER_ADDR == 0x3E) {
		InitCamera = false;
		UnProtect((DWORD*)Camera_ClipX, Camera.ClipX);
		UnProtect((DWORD*)Camera_ClipY, Camera.ClipY); 
		UnProtect((DWORD*)Camera_GlClip, Camera.GlClip);
		UnProtect((DWORD*)Camera_PosZ, 150.0f); 
		UnProtect((DWORD*)Camera_RotY, -48.5f);
		UnProtect((DWORD*)Camera_RotZ, -45.0f);
		UnProtect((DWORD*)Camera_Zoom, 35.0f);
	} 

	if (CAM_IsActive) {
		if (GetForegroundWindow() == MuWnd) {
			if (InitCamera) {		
				Camera.ClipX = *Camera_ClipX; Camera.ClipY = *Camera_ClipY; Camera.GlClip = *Camera_GlClip;
				Camera.PosZ = *Camera_PosZ; Camera.RotY = *Camera_RotY; Camera.RotZ = *Camera_RotZ; Camera.Zoom = *Camera_Zoom;
				InitCamera = false;
			}
			else if (wParam == WM_MOUSEWHEEL) {
				int direction = mhs->mouseData;
				if (direction > 0) {
					if(*Camera_Zoom < 60) { 
						UnProtect((DWORD*)Camera_Zoom, (GetMemBuffer((DWORD*)CAMERA_ZOOM))+2);
					}
				}
				else if (direction < 0) {
					if (*Camera_Zoom > 12) { 
						UnProtect((DWORD*)Camera_Zoom, (GetMemBuffer((DWORD*)CAMERA_ZOOM))-2);
					}
				}

				float Aux = abs(GetMemBuffer((DWORD*)CAMERA_POSZ) - 100) * 3;
				UnProtect((DWORD*)Camera_ClipX, 1190.0f + Aux + 3000.0f);
				UnProtect((DWORD*)Camera_ClipY, 2400.0f + Aux + 3000.0f);
				UnProtect((DWORD*)Camera_GlClip, 3000.0f + Aux + 1500.0f);
			}
			else if (wParam == WM_MBUTTONDOWN) {
				MouseX = mhs->pt.x;
				MouseY = mhs->pt.y;
				MoveCamera = true;
			}
			else if (wParam == WM_MBUTTONUP) {
				MoveCamera = false;
			}
			else if (wParam == WM_MOUSEMOVE) {
				if (MoveCamera) {
					if (MouseX < mhs->pt.x) {
						UnProtect((DWORD*)Camera_RotZ, (GetMemBuffer((DWORD*)CAMERA_ROTZ))+Sensivity);
						if (*Camera_RotZ > 315) {
							UnProtect((DWORD*)Camera_RotZ, -45.0f);
						}
					}
					else if (MouseX > mhs->pt.x) {
						UnProtect((DWORD*)Camera_RotZ, (GetMemBuffer((DWORD*)CAMERA_ROTZ))-Sensivity);
						if (*Camera_RotZ < -405) {
							UnProtect((DWORD*)Camera_RotZ, -45.0f);
						}
					}
					if (MouseY < mhs->pt.y) {
						if (*Camera_RotY < -45) {	
							UnProtect((DWORD*)Camera_PosZ, (GetMemBuffer((DWORD*)CAMERA_POSZ))-44);;
							UnProtect((DWORD*)Camera_RotY, (GetMemBuffer((DWORD*)CAMERA_ROTY))+2.42f);		
						}
					}
					else if (MouseY > mhs->pt.y) {
						if (*Camera_RotY > -90) {
							UnProtect((DWORD*)Camera_PosZ, (GetMemBuffer((DWORD*)CAMERA_POSZ))+44);
							UnProtect((DWORD*)Camera_RotY, (GetMemBuffer((DWORD*)CAMERA_ROTY))-2.42f);
						}
					}

					MouseX = mhs->pt.x;
					MouseY = mhs->pt.y;
			
					float Aux = abs(GetMemBuffer((DWORD*)CAMERA_POSZ) - 150) * 3;
					UnProtect((DWORD*)Camera_ClipX, 1190.0f + Aux + 3000.0f);
					UnProtect((DWORD*)Camera_ClipY, 2400.0f + Aux + 3000.0f);
					UnProtect((DWORD*)Camera_GlClip, 3000.0f + Aux + 1500.0f);
				}
			}
		}
	}
	return CallNextHookEx(MouseHook, code, wParam, lParam);
}

void CAMDefault(void *lParam)
{
	while (CAM_DEFAULT)
	{
		(*Camera_PosZ > 150.0f) ? UnProtect((DWORD*)Camera_PosZ, (GetMemBuffer((DWORD*)CAMERA_POSZ))-5.0f) : UnProtect((DWORD*)Camera_PosZ, (GetMemBuffer((DWORD*)CAMERA_POSZ))+5.0f);
		if (*Camera_PosZ > 146.0f && *Camera_PosZ < 152.0f)
			UnProtect((DWORD*)Camera_PosZ, 150.0f);

		(*Camera_RotZ > -45.0f) ? UnProtect((DWORD*)Camera_RotZ, (GetMemBuffer((DWORD*)CAMERA_ROTZ))-1.0f) : UnProtect((DWORD*)Camera_RotZ, (GetMemBuffer((DWORD*)CAMERA_ROTZ))+1.0f);
		if (*Camera_RotZ > -47.0f && *Camera_RotZ < -43.0f)
			UnProtect((DWORD*)Camera_RotZ, -45.0f);

		(*Camera_RotY > -48.5f) ? UnProtect((DWORD*)Camera_RotY, (GetMemBuffer((DWORD*)CAMERA_ROTY))-0.5f) : UnProtect((DWORD*)Camera_RotY, (GetMemBuffer((DWORD*)CAMERA_ROTY))+0.5f);
		if (*Camera_RotY > -50.5f && *Camera_RotY < -46.5f)
			UnProtect((DWORD*)Camera_RotY, -48.5f);

		(*Camera_Zoom > 35.0f) ? UnProtect((DWORD*)Camera_Zoom, (GetMemBuffer((DWORD*)CAMERA_ZOOM))-1.0f) : UnProtect((DWORD*)Camera_Zoom, (GetMemBuffer((DWORD*)CAMERA_ZOOM))+1.0f);
		if (*Camera_Zoom > 33.0f && *Camera_Zoom < 37.0f)
			UnProtect((DWORD*)Camera_Zoom, 35.0f);

		Sleep(2);
	}
	_endthread();
};


3DCamera.h
Code:
#pragma once 
#include "StdAfx.h"

#ifndef __LALA_H_
#define __LALA_H_

static HINSTANCE hInstance;

#pragma data_seg(".SHAREDDATA")
static HHOOK MouseHook = NULL; 
static HHOOK KeyboardHook = NULL;
#pragma data_seg()

#pragma comment(linker, "/SECTION:.SHAREDDATA,RWS")

struct CameraStruct 
{
		float Zoom;
		float RotY;
		float RotZ;
		float PosZ;
		float ClipX;
		float ClipY;
		float GlClip;
} Camera;


float *Camera_Zoom    = (float*) 0x00D27BFC;
float *Camera_RotY    = (float*) 0x00D27B88;
float *Camera_RotZ    = (float*) 0x087933D8;
float *Camera_PosZ    = (float*) 0x00D255AC;
float *Camera_ClipX   = (float*) 0x00D2C848;
float *Camera_ClipY   = (float*) 0x00D2C894;
float *Camera_GlClip  = (float*) 0x00D2570C;

int MouseX; 
int MouseY; 

bool InitCamera = true; 
bool MoveCamera = false;

BOOL KeyboardSetHook(BOOL set_or_remove);
BOOL MouseSetHook(BOOL set_or_remove);
LRESULT CALLBACK KeyboardProc(int nCode, WPARAM wParam, LPARAM lParam);
LRESULT CALLBACK MouseProc(int code, WPARAM wParam, LPARAM lParam);

float GetMemBuffer(DWORD *dwpAddress);
void UnProtect(DWORD *dwpAddress, float Buffer);

void CAMDefault(void *lParam);

#endif // __LALA_H_

The BOOL of StdAfx.h and the dll entry.
Code:
BOOL MouseSetHook(BOOL);
BOOL KeyboardSetHook(BOOL);


Just, i can't make it work correcty with the zoom out...

Brain - Client Addons Source v.1.0.0.2 - RaGEZONE Forums


I think it's the float <> double convertion of the ClipX, but, i get compiler warning if use double.
 
Joined
Jun 18, 2013
Messages
474
Reaction score
73
Yeap, i only used the 3d cam.

3DCamera.cpp
Code:
#include "Stdafx.h"
#include "3DCamera.h"


//1.04D OFFSETS
#define CAMERA_ZOOM   0x00D27BFC
#define CAMERA_ROTY   0x00D27B88
#define CAMERA_ROTZ   0x087933D8
#define CAMERA_POSZ   0x00D255AC
#define CAMERA_CLIPX  0x00D2C848
#define CAMERA_CLIPY  0x00D2C894
#define CAMERA_GLCLIP 0x00D2570C 

#define Main_PrintGlobal 00597630H;


int *MAIN_STATE_ADDR  = (int*)0x00E609E8; 
int *MAP_CHECKER_ADDR = (int*)0x00E61E18;  


#define CAM_DEFAULT (*Camera_PosZ != 150.0f || *Camera_RotZ != -45.0f || *Camera_RotY != -48.5f || *Camera_Zoom != 35.0f)

enum MAINSTATE {
    SELECT_SERVER    = 2,
    SELECT_CHARACTER = 4,
    SELECT_GAME      = 5,
};

bool CAM_Init = true;
bool CAM_Move = false;
bool VK_IsPressed = false;


void Message(int ColorId, char* Message)
{
    _asm
    {
        Mov Edi,Main_PrintGlobal
        Push ColorId
        Push Message
        Call Edi
        Add Esp,0x8
    }
}

//int Is3D = 1; //GetPrivateProfileIntA("3D", "IsEnabled", true, "./Custom/Settings.ini");
int CAM_IsActive = 1;
//int CAM_IsActive = GetPrivateProfileIntA("3D", "IsActive", 1, ".\\Custom\\Settings.ini");
int Sensivity = GetPrivateProfileIntA("3D", "Sensivity", 8, ".\\Custom\\Settings.ini");

BOOL KeyboardSetHook(BOOL set_or_remove) {
    if(set_or_remove == TRUE) {
        if(KeyboardHook == NULL) {
            KeyboardHook = SetWindowsHookEx(WH_KEYBOARD, (HOOKPROC)KeyboardProc, hInstance, GetCurrentThreadId());
            if(!KeyboardHook) { return FALSE; }
        }
    } 
    else {
        KeyboardHook = NULL;
        return UnhookWindowsHookEx(KeyboardHook);
    }
    return TRUE;
}

BOOL MouseSetHook(BOOL set_or_remove) {
    if(set_or_remove == TRUE) {
        if(MouseHook == NULL) {
            MouseHook = SetWindowsHookEx(WH_MOUSE, MouseProc, hInstance, GetCurrentThreadId());
            if(!MouseHook) { return FALSE; }
        }
    } 
    else { 
        MouseHook = NULL;
        return UnhookWindowsHookEx(MouseHook); 
    }
    return TRUE;
}

float GetMemBuffer(DWORD *dwpAddress) {
    float pBuffer;
    if (ReadProcessMemory(GetCurrentProcess(), dwpAddress, (float*)&pBuffer, 4, 0) == TRUE) 
        return pBuffer;
    else return 0;
}

void UnProtect(DWORD *dwpAddress, float pBuffer) {
    DWORD dwOldProtect = 0;
    HANDLE hWnd = GetCurrentProcess();
    VirtualProtectEx(hWnd, dwpAddress, 4, PAGE_EXECUTE_READWRITE, &dwOldProtect);
    WriteProcessMemory(hWnd, dwpAddress, (void*)&pBuffer, 4, 0);
    VirtualProtectEx(hWnd, dwpAddress, 4, PAGE_EXECUTE_READWRITE, &dwOldProtect);
}

LRESULT CALLBACK KeyboardProc(int nCode, WPARAM wParam, LPARAM lParam) {    
    if (((lParam >> 31) & 1) && (nCode == HC_ACTION)) {
        
        if (wParam == VK_F10)    {
            if (VK_IsPressed == false && CAM_IsActive == true)    {
                VK_IsPressed = true; CAM_IsActive = false;
                Message(1,"Camera OFF");
            }
            else    {
                VK_IsPressed = false; CAM_IsActive = true;
                Message(1,"Camera ON");
            }
        }

        if (wParam == VK_F9) {
            _beginthread(CAMDefault, 0, NULL); 
            Message(1,"Camera Reseted");
        }
    }    
    return CallNextHookEx(KeyboardHook, nCode, wParam, lParam);
}


LRESULT CALLBACK MouseProc(int code, WPARAM wParam, LPARAM lParam){
    MOUSEHOOKSTRUCTEX* mhs = (MOUSEHOOKSTRUCTEX*)lParam;
    HWND MuWnd = FindWindow("MU", NULL);

    if (*MAIN_STATE_ADDR == SELECT_CHARACTER || *MAP_CHECKER_ADDR == 0x1E || *MAP_CHECKER_ADDR == 0x3E) {
        InitCamera = false;
        UnProtect((DWORD*)Camera_ClipX, Camera.ClipX);
        UnProtect((DWORD*)Camera_ClipY, Camera.ClipY); 
        UnProtect((DWORD*)Camera_GlClip, Camera.GlClip);
        UnProtect((DWORD*)Camera_PosZ, 150.0f); 
        UnProtect((DWORD*)Camera_RotY, -48.5f);
        UnProtect((DWORD*)Camera_RotZ, -45.0f);
        UnProtect((DWORD*)Camera_Zoom, 35.0f);
    } 

    if (CAM_IsActive) {
        if (GetForegroundWindow() == MuWnd) {
            if (InitCamera) {        
                Camera.ClipX = *Camera_ClipX; Camera.ClipY = *Camera_ClipY; Camera.GlClip = *Camera_GlClip;
                Camera.PosZ = *Camera_PosZ; Camera.RotY = *Camera_RotY; Camera.RotZ = *Camera_RotZ; Camera.Zoom = *Camera_Zoom;
                InitCamera = false;
            }
            else if (wParam == WM_MOUSEWHEEL) {
                int direction = mhs->mouseData;
                if (direction > 0) {
                    if(*Camera_Zoom < 60) { 
                        UnProtect((DWORD*)Camera_Zoom, (GetMemBuffer((DWORD*)CAMERA_ZOOM))+2);
                    }
                }
                else if (direction < 0) {
                    if (*Camera_Zoom > 12) { 
                        UnProtect((DWORD*)Camera_Zoom, (GetMemBuffer((DWORD*)CAMERA_ZOOM))-2);
                    }
                }

                float Aux = abs(GetMemBuffer((DWORD*)CAMERA_POSZ) - 100) * 3;
                UnProtect((DWORD*)Camera_ClipX, 1190.0f + Aux + 3000.0f);
                UnProtect((DWORD*)Camera_ClipY, 2400.0f + Aux + 3000.0f);
                UnProtect((DWORD*)Camera_GlClip, 3000.0f + Aux + 1500.0f);
            }
            else if (wParam == WM_MBUTTONDOWN) {
                MouseX = mhs->pt.x;
                MouseY = mhs->pt.y;
                MoveCamera = true;
            }
            else if (wParam == WM_MBUTTONUP) {
                MoveCamera = false;
            }
            else if (wParam == WM_MOUSEMOVE) {
                if (MoveCamera) {
                    if (MouseX < mhs->pt.x) {
                        UnProtect((DWORD*)Camera_RotZ, (GetMemBuffer((DWORD*)CAMERA_ROTZ))+Sensivity);
                        if (*Camera_RotZ > 315) {
                            UnProtect((DWORD*)Camera_RotZ, -45.0f);
                        }
                    }
                    else if (MouseX > mhs->pt.x) {
                        UnProtect((DWORD*)Camera_RotZ, (GetMemBuffer((DWORD*)CAMERA_ROTZ))-Sensivity);
                        if (*Camera_RotZ < -405) {
                            UnProtect((DWORD*)Camera_RotZ, -45.0f);
                        }
                    }
                    if (MouseY < mhs->pt.y) {
                        if (*Camera_RotY < -45) {    
                            UnProtect((DWORD*)Camera_PosZ, (GetMemBuffer((DWORD*)CAMERA_POSZ))-44);;
                            UnProtect((DWORD*)Camera_RotY, (GetMemBuffer((DWORD*)CAMERA_ROTY))+2.42f);        
                        }
                    }
                    else if (MouseY > mhs->pt.y) {
                        if (*Camera_RotY > -90) {
                            UnProtect((DWORD*)Camera_PosZ, (GetMemBuffer((DWORD*)CAMERA_POSZ))+44);
                            UnProtect((DWORD*)Camera_RotY, (GetMemBuffer((DWORD*)CAMERA_ROTY))-2.42f);
                        }
                    }

                    MouseX = mhs->pt.x;
                    MouseY = mhs->pt.y;
            
                    float Aux = abs(GetMemBuffer((DWORD*)CAMERA_POSZ) - 150) * 3;
                    UnProtect((DWORD*)Camera_ClipX, 1190.0f + Aux + 3000.0f);
                    UnProtect((DWORD*)Camera_ClipY, 2400.0f + Aux + 3000.0f);
                    UnProtect((DWORD*)Camera_GlClip, 3000.0f + Aux + 1500.0f);
                }
            }
        }
    }
    return CallNextHookEx(MouseHook, code, wParam, lParam);
}

void CAMDefault(void *lParam)
{
    while (CAM_DEFAULT)
    {
        (*Camera_PosZ > 150.0f) ? UnProtect((DWORD*)Camera_PosZ, (GetMemBuffer((DWORD*)CAMERA_POSZ))-5.0f) : UnProtect((DWORD*)Camera_PosZ, (GetMemBuffer((DWORD*)CAMERA_POSZ))+5.0f);
        if (*Camera_PosZ > 146.0f && *Camera_PosZ < 152.0f)
            UnProtect((DWORD*)Camera_PosZ, 150.0f);

        (*Camera_RotZ > -45.0f) ? UnProtect((DWORD*)Camera_RotZ, (GetMemBuffer((DWORD*)CAMERA_ROTZ))-1.0f) : UnProtect((DWORD*)Camera_RotZ, (GetMemBuffer((DWORD*)CAMERA_ROTZ))+1.0f);
        if (*Camera_RotZ > -47.0f && *Camera_RotZ < -43.0f)
            UnProtect((DWORD*)Camera_RotZ, -45.0f);

        (*Camera_RotY > -48.5f) ? UnProtect((DWORD*)Camera_RotY, (GetMemBuffer((DWORD*)CAMERA_ROTY))-0.5f) : UnProtect((DWORD*)Camera_RotY, (GetMemBuffer((DWORD*)CAMERA_ROTY))+0.5f);
        if (*Camera_RotY > -50.5f && *Camera_RotY < -46.5f)
            UnProtect((DWORD*)Camera_RotY, -48.5f);

        (*Camera_Zoom > 35.0f) ? UnProtect((DWORD*)Camera_Zoom, (GetMemBuffer((DWORD*)CAMERA_ZOOM))-1.0f) : UnProtect((DWORD*)Camera_Zoom, (GetMemBuffer((DWORD*)CAMERA_ZOOM))+1.0f);
        if (*Camera_Zoom > 33.0f && *Camera_Zoom < 37.0f)
            UnProtect((DWORD*)Camera_Zoom, 35.0f);

        Sleep(2);
    }
    _endthread();
};


3DCamera.h
Code:
#pragma once 
#include "StdAfx.h"

#ifndef __LALA_H_
#define __LALA_H_

static HINSTANCE hInstance;

#pragma data_seg(".SHAREDDATA")
static HHOOK MouseHook = NULL; 
static HHOOK KeyboardHook = NULL;
#pragma data_seg()

#pragma comment(linker, "/SECTION:.SHAREDDATA,RWS")

struct CameraStruct 
{
        float Zoom;
        float RotY;
        float RotZ;
        float PosZ;
        float ClipX;
        float ClipY;
        float GlClip;
} Camera;


float *Camera_Zoom    = (float*) 0x00D27BFC;
float *Camera_RotY    = (float*) 0x00D27B88;
float *Camera_RotZ    = (float*) 0x087933D8;
float *Camera_PosZ    = (float*) 0x00D255AC;
float *Camera_ClipX   = (float*) 0x00D2C848;
float *Camera_ClipY   = (float*) 0x00D2C894;
float *Camera_GlClip  = (float*) 0x00D2570C;

int MouseX; 
int MouseY; 

bool InitCamera = true; 
bool MoveCamera = false;

BOOL KeyboardSetHook(BOOL set_or_remove);
BOOL MouseSetHook(BOOL set_or_remove);
LRESULT CALLBACK KeyboardProc(int nCode, WPARAM wParam, LPARAM lParam);
LRESULT CALLBACK MouseProc(int code, WPARAM wParam, LPARAM lParam);

float GetMemBuffer(DWORD *dwpAddress);
void UnProtect(DWORD *dwpAddress, float Buffer);

void CAMDefault(void *lParam);

#endif // __LALA_H_

The BOOL of StdAfx.h and the dll entry.
Code:
BOOL MouseSetHook(BOOL);
BOOL KeyboardSetHook(BOOL);


Just, i can't make it work correcty with the zoom out...

Brain - Client Addons Source v.1.0.0.2 - RaGEZONE Forums


I think it's the float <> double convertion of the ClipX, but, i get compiler warning if use double.

I will try to make it correctly,maybe it will works fine
 
Back
Top