• 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.

3D+Mini-Maps+Sky DLL by Nemesis BETA 0.1

Joined
Oct 29, 2007
Messages
1,292
Reaction score
1,314
Hello Today I come to let the source code for 3D camera + mini-maps + sky, where i was working this last time... (that is nothing but a compilation of other sources) + Offsets for main.exe v1.07P+

Nemesis.cpp

Code:
[COLOR="Blue"]#include <cstdlib>
#include <iostream>
#include "Stdafx.h"
#include "Nemesis.h"
#include "Sky.h"

extern "C" _declspec(dllexport) void Init()
{
    DWORD OldProtect;
    if(VirtualProtect(LPVOID(0x401000),4310016,PAGE_EXECUTE_READWRITE,&OldProtect))
    {    
        KeyboardSetHook(true);
        MouseSetHook(true);
    } 
    else {
    MessageBoxA(NULL,"Cannot load Nemesis.dll","Mu Online",MB_OK);
    }
}

int APIENTRY DllMain (HINSTANCE hInst, DWORD dwReason, LPVOID lpReserved){
    switch(dwReason){    
        case DLL_PROCESS_DETACH:
            KeyboardSetHook(false);
            MouseSetHook(false);
            break;    
    }
    return true;
}

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 {
        return UnhookWindowsHookEx(KeyboardHook);
        KeyboardHook = NULL;
    }
    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 { return UnhookWindowsHookEx(MouseHook); }
    return TRUE;
}

LRESULT CALLBACK KeyboardProc(int nCode, WPARAM wParam, LPARAM lParam){    
    if(((lParam>>31)&1) && (nCode == HC_ACTION)){
        if(wParam == VK_END){
            *Camera_RotY = -48.5;
            *Camera_RotZ = -45;
            *Camera_PosZ = 150;
            *Camera_ClipX = 1190;
            *Camera_ClipY = 2400;
            *Camera_GlClip = 3000;
            *Camera_Zoom = 35;
        }

        if(wParam == VK_HOME){
            if(!InitCamera)
            { InitCamera = true;
            } else {
            InitCamera = false;
            }
        }

    }    
    return CallNextHookEx(KeyboardHook, nCode, wParam, lParam);
}

LRESULT CALLBACK MouseProc(int code, WPARAM wParam, LPARAM lParam){
    MOUSEHOOKSTRUCTEX* mhs = (MOUSEHOOKSTRUCTEX*)lParam;
    HWND MuWnd = FindWindow(TEXT("MU"), NULL);
    if(GetForegroundWindow() == MuWnd){
        if(InitCamera == true){
            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;
        }

    if(InitCamera == true) {
        
        if(wParam == WM_MBUTTONDOWN){
            MoveCamera = true;
        }

        if(wParam == WM_MBUTTONUP){
            MoveCamera = false;
        }

        if(wParam == WM_MOUSEWHEEL){
            int direction = mhs->mouseData;
            if(direction > 0){
                if(*Camera_Zoom < 60){ *Camera_Zoom += 2; }
            }
            else if(direction < 0){
                if(*Camera_Zoom > 12){ *Camera_Zoom -= 2; }
            }
            *Camera_ClipX  = 1190 + (abs(*Camera_PosZ - 150) * 3) + 3000;
            *Camera_ClipY  = 2400 + (abs(*Camera_PosZ - 150) * 3) + 3000;
            *Camera_GlClip = 3000 + (abs(*Camera_PosZ - 150) * 3) + 1500;
        }
        else if(wParam == WM_MBUTTONDOWN){
            MouseX = mhs->pt.x;
            MouseY = mhs->pt.y;
        }

        else if(wParam == WM_MOUSEMOVE){
            
            if(MoveCamera){
                if(MouseX < mhs->pt.x){
                    *Camera_RotZ += 8;
                    if (*Camera_RotZ > 315) *Camera_RotZ = -45;
                }
                else if(MouseX > mhs->pt.x){
                    *Camera_RotZ -= 8;
                    if (*Camera_RotZ < -405) *Camera_RotZ = -45;
                }

                if(MouseY < mhs->pt.y){
                    if(*Camera_RotY < -45){    
                        *Camera_PosZ -= 44;
                        *Camera_RotY += (float)2.42;
                    }
                }
                else if(MouseY > mhs->pt.y){
                    if(*Camera_RotY > -90){
                        *Camera_PosZ += 44;
                        *Camera_RotY -= (float)2.42;
                    }
                }

                MouseX = mhs->pt.x;
                MouseY = mhs->pt.y;


                *Camera_ClipX = 1190 + (abs(*Camera_PosZ - 150) * 3) + 6000;
                *Camera_ClipY = 2400 + (abs(*Camera_PosZ - 150) * 3) + 4000;
                *Camera_GlClip = 3000 + (abs(*Camera_PosZ - 150) * 3) + 1500;
            }

            }
        }
    }
    return CallNextHookEx(MouseHook, code, wParam, lParam);
}

struct FRGB
{
	float r, g, b;
};
AUX_RGBImageRec* blankimage;
AUX_RGBImageRec* images[32][6];
unsigned int textures[32][6];
int skycolordirection;
int DisplayInitialized, MiniMapInitialized;
FRGB skycolor;
typedef int(*TSkyHook)();
TSkyHook SkyHook = (TSkyHook) 0x4A8F9E; 
typedef int(*TBlend) (int);
TBlend Blend = (TBlend) 0x626570;
int *MainState = (int*)0x915D44;
int *Map = (int*)0x61E97D; //Mini-Map Main 1.07P+ Research by Nemesis 
typedef int(*TUnBlend) ();
TUnBlend UnBlend = (TUnBlend) 0x6264F1;

	int Sky = GetPrivateProfileIntA("Nemesis", "Sky", 0, ".\\Nemesis.ini");
	int SkyDayNight = GetPrivateProfileIntA("Nemesis", "SkyTimer", 0, ".\\Nemesis.ini");

bool FileExists(char * name)
{
	if(CreateFile(name,0,0,0,OPEN_EXISTING,0,0) == INVALID_HANDLE_VALUE)
		return false;
	return true;
}

void GetCamCoords(double* x_cam, double* y_cam, double* z_cam)
{
        double m[16];
        glGetDoublev(GL_MODELVIEW_MATRIX, m);
        *x_cam = -m[12] * m[0] - m[13] * m[1] - m[14] * m[2];
        *y_cam = -m[12] * m[4] - m[13] * m[5] - m[14] * m[6];
        *z_cam = -m[12] * m[8] - m[13] * m[9] - m[14] * m[10];
}

void ChangeSky()
{
        SYSTEMTIME sm; 
        GetLocalTime(&sm);
        int hourstate = sm.wHour % 2;
        float minutestate = (float)sm.wMinute / 60.0f;
        if(hourstate == 0)
        {
                skycolor.r = minutestate;
                skycolor.g = minutestate;
                skycolor.b = minutestate;
        }
        else
        {
                skycolor.r = 1.0f - minutestate;
                skycolor.g = 1.0f - minutestate;
                skycolor.b = 1.0f - minutestate;
        }
}

void CALLBACK SkyTimerProc(HWND hwnd,UINT uMsg,UINT_PTR idEvent,DWORD dwTime)
{
        ChangeSky();        
}

void InitDisplay()
{
        SetTimer(FindWindow(TEXT("MU"), NULL),3,60000,(TIMERPROC)
			int(Sky));
			{
                char texturepath[256];
                sprintf_s(texturepath,"%s",".\\Data\\Sky\\Null.bmp");
                if(!FileExists(texturepath))
                {
					MessageBox(0,"Cannot find Null.bmp","Error",0);
					ExitProcess(0);
                }
                blankimage = auxDIBImageLoad(texturepath);

                try
                {
                        for(int i=0 ; i<30; i++)
                        {
                                for(int j=0; j<6; j++)
                                {
                                        images[i][j] = blankimage;
                                }
                
                                sprintf_s(texturepath,".\\Data\\Sky\\World%d\\Back.bmp",i+1);
                                if(FileExists(texturepath))
                                        images[i][0] = auxDIBImageLoad(texturepath);
                                sprintf_s(texturepath,".\\Data\\Sky\\World%d\\Bottom.bmp",i+1);
                                if(FileExists(texturepath))
                                        images[i][1] = auxDIBImageLoad(texturepath);
                                sprintf_s(texturepath,".\\Data\\Sky\\World%d\\Front.bmp",i+1);
                                if(FileExists(texturepath))
                                        images[i][2] = auxDIBImageLoad(texturepath);
                                sprintf_s(texturepath,".\\Data\\Sky\\World%d\\Left.bmp",i+1);
                                if(FileExists(texturepath))
                                        images[i][3] = auxDIBImageLoad(texturepath);
                                sprintf_s(texturepath,".\\Data\\Sky\\World%d\\Right.bmp",i+1);
                                if(FileExists(texturepath))
                                        images[i][4] = auxDIBImageLoad(texturepath);
                                sprintf_s(texturepath,".\\Data\\Sky\\World%d\\Top.bmp",i+1);
                                if(FileExists(texturepath))
                                        images[i][5] = auxDIBImageLoad(texturepath);
                        }
                }
                catch(...){}

                for(int i=0 ; i<30; i++)
                {
                        for(int j=0; j<6; j++)
                        {
                                glGenTextures(1, &textures[i][j]);
                                glBindTexture(GL_TEXTURE_2D, textures[i][j]);
                                glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
                                glTexImage2D(GL_TEXTURE_2D, 0, 3, images[i][j]->sizeX, images[i][j]->sizeY, 0, GL_RGB, GL_UNSIGNED_BYTE, images[i][j]->data);        
                                glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
                                glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
                        }
                }

                skycolor.r = 1.0f;
                skycolor.g = 1.0f;
                skycolor.b = 1.0f;

                if(SkyDayNight)
                {
                        skycolordirection = 1;
                        SetTimer(FindWindow(TEXT("MU"), NULL),2,5000,(TIMERPROC)SkyTimerProc);
                        ChangeSky();
                }
        }

        DisplayInitialized = 1;
}


bool CanDrawSky()
{
        char texturepath[256];
        sprintf_s(texturepath,".\\Data\\Sky\\World%d\\Top.bmp",*Map+1);
                if(FileExists(texturepath))
                        return true;
        return false;
}

void Display()
{
        SkyHook();

        *MainState = 5;
        if(*MainState == 5/* && !unhautorized*/)
        {
                if(!DisplayInitialized)
                        InitDisplay();

                if(Sky && CanDrawSky())
                {
                        double x_cam, y_cam, z_cam;
                        GetCamCoords(&x_cam,&y_cam,&z_cam);

                        Blend(1);
                        glColor3d(skycolor.r,skycolor.g,skycolor.b);

                        glBindTexture(GL_TEXTURE_2D, textures[*Map][5]);
                        glBegin(GL_QUADS); 
                                //TOP
                                glTexCoord2f(1.0f, 0.0f); glVertex3d(x_cam-3000, y_cam+3000, 1500); 
                                glTexCoord2f(0.0f, 0.0f); glVertex3d(x_cam+3000, y_cam+3000, 1500);
                                glTexCoord2f(0.0f, 1.0f); glVertex3d(x_cam+3000, y_cam-3000, 1500);
                                glTexCoord2f(1.0f, 1.0f); glVertex3d(x_cam-3000, y_cam-3000, 1500);
                        glEnd();

                        glBindTexture(GL_TEXTURE_2D, textures[*Map][1]);
                        glBegin(GL_QUADS); 
                                //BOTTOM
                                glTexCoord2f(1.0f, 1.0f); glVertex3d(x_cam-3000, y_cam+3000, 0); 
                                glTexCoord2f(0.0f, 1.0f); glVertex3d(x_cam+3000, y_cam+3000, 0);
                                glTexCoord2f(0.0f, 0.0f); glVertex3d(x_cam+3000, y_cam-3000, 0);
                                glTexCoord2f(1.0f, 0.0f); glVertex3d(x_cam-3000, y_cam-3000, 0);
                        glEnd();

                        glBindTexture(GL_TEXTURE_2D, textures[*Map][2]);
                        glBegin(GL_QUADS); 
                                //FRONT
                                glTexCoord2f(1.0f, 1.0f); glVertex3d(x_cam-3000, y_cam+3000, 1500); 
                                glTexCoord2f(0.0f, 1.0f); glVertex3d(x_cam+3000, y_cam+3000, 1500);
                                glTexCoord2f(0.0f, 0.0f); glVertex3d(x_cam+3000, y_cam+3000, 0);
                                glTexCoord2f(1.0f, 0.0f); glVertex3d(x_cam-3000, y_cam+3000, 0);
                        glEnd();

                        glBindTexture(GL_TEXTURE_2D, textures[*Map][0]);
                        glBegin(GL_QUADS);
                                //BACK
                                glTexCoord2f(0.0f, 1.0f); glVertex3d(x_cam-3000, y_cam-3000, 1500); 
                                glTexCoord2f(1.0f, 1.0f); glVertex3d(x_cam+3000, y_cam-3000, 1500);
                                glTexCoord2f(1.0f, 0.0f); glVertex3d(x_cam+3000, y_cam-3000, 0);
                                glTexCoord2f(0.0f, 0.0f); glVertex3d(x_cam-3000, y_cam-3000, 0);
                        glEnd();

                        glBindTexture(GL_TEXTURE_2D, textures[*Map][3]);
                        glBegin(GL_QUADS);
                                //LEFT
                                glTexCoord2f(1.0f, 1.0f); glVertex3d(x_cam-3000, y_cam-3000, 1500); 
                                glTexCoord2f(0.0f, 1.0f); glVertex3d(x_cam-3000, y_cam+3000, 1500);
                                glTexCoord2f(0.0f, 0.0f); glVertex3d(x_cam-3000, y_cam+3000, 0);
                                glTexCoord2f(1.0f, 0.0f); glVertex3d(x_cam-3000, y_cam-3000, 0);
                        glEnd();

                        glBindTexture(GL_TEXTURE_2D, textures[*Map][4]);
                        glBegin(GL_QUADS);
                                //RIGHT
                                glTexCoord2f(0.0f, 1.0f); glVertex3d(x_cam+3000, y_cam-3000, 1500); 
                                glTexCoord2f(1.0f, 1.0f); glVertex3d(x_cam+3000, y_cam+3000, 1500);
                                glTexCoord2f(1.0f, 0.0f); glVertex3d(x_cam+3000, y_cam+3000, 0);
                                glTexCoord2f(0.0f, 0.0f); glVertex3d(x_cam+3000, y_cam-3000, 0);
                        glEnd();

                        UnBlend();
                }
        }
}

void HookExactOffset(DWORD my, DWORD tohook, BYTE type)
{
	*(BYTE*)tohook = type;
	*(DWORD*)(tohook+1) = my;
}

void HookThis(DWORD dwMyFuncOffset,DWORD dwJmpOffset)
{
	*(DWORD*)(dwJmpOffset+1)=dwMyFuncOffset-(dwJmpOffset+5);
}

void ChangePath(const char* Map, ...)
{
	memcpy((DWORD*)0x931AF0,Map,17);
	HookExactOffset(0x931AF0,0x00711AD5,0x68);
}

void LoadImageJgpForMap(char* ImagePatch, DWORD PrintCode)
{
	_asm
	{
		Mov Edi, 0x006F329E
		Push 0x1
		Push 0x2900
		Push 0x2601
		Push 0x7B69
		Push 0x931AF0
		Call Edi
		Add Esp,0x14
	}
}

int LoadMap(int Map)
{
	char FullMapName[200];
	sprintf_s(FullMapName,"World%d\\Map1.jpg",Map+1);
	ChangePath(FullMapName);
	LoadImageJgpForMap(FullMapName, 0x7B69);
	return Map;
}

bool MapChecker1(int Map)
{
	if( Map == 0 || Map == 1 || Map == 2 || Map == 3 || Map == 4 || Map == 7 || Map == 8 ||
		Map == 10 || Map == 24 || Map == 30 || Map == 33 || Map == 34 || Map == 37 || Map == 38 ||
		Map == 41 || Map == 51 || Map == 56 || Map == 57 || Map == 63)
	{
		return 1;
	}
	return 0;
}

char FullMapName[200];

void MapChecker2(int Map)
{
	if( Map == 0 || Map == 1 || Map == 2 || Map == 3 || Map == 4 || Map == 7 || Map == 8 ||
		Map == 10 || Map == 24 || Map == 30 || Map == 33 || Map == 34 || Map == 37 || Map == 38 ||
		Map == 41 || Map == 51 || Map == 56 || Map == 57 || Map == 63)
	{
		LoadMap(Map);
		
		_asm
		{ 
			MOV EDI, 0x007B61D6
			CALL EDI
			MOV ECX,EAX
			MOV EDI, 0x007B6564
			CALL EDI
			MOV ECX,EAX
			MOV EDI, 0x0070FBCE
			CALL EDI
		}
		Sleep(100);
	}
	else if( Map == 77 || Map == 78)
	{
		*(BYTE*)(0x0070FB69) = 0x75;
	}
	else
	{
		*(BYTE*)(0x0070FB69) = 0x75;
	}
}

void MiniLoad()
{
	int Map;
	char FullMapName[200];

	Map = *(unsigned char*)0x0091A3E4;

	if( Map == 0 || Map == 1 || Map == 2 || Map == 3 || Map == 4 || Map == 7 || Map == 8 ||
		Map == 10 || Map == 24 || Map == 30 || Map == 33 || Map == 34 || Map == 37 || Map == 38 ||
		Map == 41 || Map == 51 || Map == 56 || Map == 57 || Map == 63)
	{
		sprintf_s(FullMapName,"World%d\\Map1.jpg",Map+1);
		*(BYTE*)(0x00707647) = 0xEB;
		memcpy((DWORD*)0x91CD90,FullMapName,17);
	}
	else if( Map == 77 || Map == 78)
	{
		*(BYTE*)(0x0070FB69) = 0x75;
	}
	else
	{
		*(BYTE*)(0x0070FB69) = 0x75;
	}
}

void MiniMap()
{
	
	*(BYTE*)(0x007680DD) = 0x90;
	*(BYTE*)(0x007680DD+1) = 0x90;

	HookThis((DWORD)&MapChecker1, 0x0070FB5A);
	HookThis((DWORD)&MapChecker2, 0x0061E97D);
}[/COLOR]



PS: That person and / or people who want to contribute to this source, are free to set about it, because the truth I'm new to all this Programming Language C++, so it is acceptable that mistakes are...

Credits: FOR ALL MU ONLINE COMMUNITY

DLL Compiled 3D Camera + Mini-Maps + Sky:

Special Credits to: Sobieh, ZergNM, Leo123, vcorp,MyGSFun, Mulegend, chris05, SirMaster (Old ASM Programmer & A Good Friend)
 
Last edited:
Joined
Oct 29, 2007
Messages
1,292
Reaction score
1,314
drakelv Sorry, I fix it right now ^^, but I let the credits are for any Mu Online community because there are many people who helped me with this.. that are not vcorp.

PS: drakelv: Not if you looked good ... but this is not the same vcorp source code, and that the wording of 3D camera are made ​​by: Sobieh, zergNM & Leo123.

PS: drakelv: If you have time .. and not too much trouble for you .. could you help me test this source code? (Do not want to bother, so if you say you do not have time to understand saber).
 
Last edited:
Experienced Elementalist
Joined
Nov 4, 2007
Messages
200
Reaction score
5
All the codes is mess up.
Its good all offsets to be defined in .h file.
And can you upload your main?
 
Joined
Oct 29, 2007
Messages
1,292
Reaction score
1,314
Download any main.exe v1.07P+ - 1.07.42 Cracked or crack it you! is easy.. :):

PS: For all those people who do not want to do a research to find all other modifiable offsets this main.exe (modifiable say referring to the routine).. Here I give the load limits Items, texture, Proc Glow's and other things..

Link:

PS 2: I'm not a Mu Coder, but I am not a Noob.
 
Last edited:
Junior Spellweaver
Joined
Oct 21, 2008
Messages
188
Reaction score
17
Credits: vcorp. not all mu online community

shenanigans
vcorp just toke leo idea and write it in 1 dll
leo123 made the first mini map
subish (not sure the name) made the first 3D cam

tnx nemesis for shearing the offsets :D

edit:
just for know what this number means in this line - 4310016 ?
if(VirtualProtect(LPVOID(0x401000),4310016,PAGE_EXECUTE_READWRITE,&OldProtect))
tnx for the answer
 
Last edited:
Custom Title Activated
Loyal Member
Joined
Dec 5, 2009
Messages
2,657
Reaction score
1,178
credit for offsets going to chris05 (he gave u 1 week ago in other topic for main 1.07p)

nemesis.cpp nemesis.h ? haha xD
 
Last edited:
Joined
Oct 29, 2007
Messages
1,292
Reaction score
1,314
And add it to chris05 in the credits, so I recommend that you upgrade your browser my friend and you start to read before rebut a topic... :):

PS: if I do not think I've made ​​some small modifications, but are important in order to compile the source code... then please look at this and compare.

A line of source of 3d cam (only) posted by saintus:

Code:
HWND MuWnd = FindWindow("MU", NULL);

My modification of error of compilation:

Code:
HWND MuWnd = FindWindow(TEXT("MU"), NULL);

and so as that there are many more things in the file: Nemesis.cpp :cool:
 
Last edited:
Joined
Oct 29, 2007
Messages
1,292
Reaction score
1,314
Sky's is in the past, look, what i have done - ^_^

SmallHabit: Can you help me improve this source code, adding things like increased range of camera 3D vision, style mini-map radar (as ariethmu), smoke effect (no fog), smooth texture, and other things you have demonstrated expertise. :?:
 
Experienced Elementalist
Joined
Oct 19, 2010
Messages
231
Reaction score
531
mauro07 you will never be a good coder, if all time will ask for a help... If you have some problems on coding something - ask google.
 
Joined
Oct 29, 2007
Messages
1,292
Reaction score
1,314
As I can do to find the offsets for the sky in other versions of main.exe?, ie what kind of search should be done when you are trying to establish a relationship between 2 main? that as: Strings ... can not find the same offsets in other main, and not Float. as Hex .. either, as no text. Then someone explain in detail how it is done to find these offsets (step by step)
 
IGCN Co-Founder
Joined
Jun 26, 2006
Messages
303
Reaction score
487
shenanigans
vcorp just toke leo idea and write it in 1 dll
leo123 made the first mini map
subish (not sure the name) made the first 3D cam

tnx nemesis for shearing the offsets :D

edit:
just for know what this number means in this line - 4310016 ?
if(VirtualProtect(LPVOID(0x401000),4310016,PAGE_EXECUTE_READWRITE,&OldProtect))
tnx for the answer

first minimap was done by sobieh xD, and vcorp continued this development all the time (most succesfuly) and the source is his, dont matter that he uses same idea for 3d and shits.

and 4310016 means end offset for virtualprotect in main.exe
 
Joined
Oct 29, 2007
Messages
1,292
Reaction score
1,314
So we have to do is to get the full source code for the sky, and you will make us the great favor of teaching us how to find the offsets for the functions of sky in any version of main.exe? (as 1.05X+ -> 1.05.50 for example)... but you can also teach us how to find the offset of MiniMap for any version of main.exe be doing us a favor..


PS: We need to talk with people like: zemmatana or vcorp, to help achieve the full source code: sky and 3d camera + Increase range view.

PS 2: 3d camera (with: increase range view & regression effect) + sky (skybox in all maps including: atlans & elbeland) + smoke effect (to cover the edge of the sky, when it runs to the effect of walking behind the character) + smooth textures (for better graphic definition of the overall game + camera zoom function) + mini-maps (functional in all maps, and changed the button to show/hide it: 'Shift')
 
Last edited:
Joined
Oct 29, 2007
Messages
1,292
Reaction score
1,314
aHelper: If you know how to do to increase the range of 3D visualization of the camera, please could help me make this source?, I have some good theories on how it could be, I understand that this type of modification involves the values: ClipY, ClipX , Clipz, GlClip, and Zoom... but do not really know how, could you please help me, of course thank you very much.

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

extern "C" _declspec(dllexport) void Init()
{
    DWORD OldProtect;
    if(VirtualProtect(LPVOID(0x401000),4310016,PAGE_EXECUTE_READWRITE,&OldProtect))
    {    
        KeyboardSetHook(true);
        MouseSetHook(true);
    } 
    else {
    MessageBoxA(NULL,"Cannot load 3DCamera.dll","Mu Online",MB_OK);
    }
}

int APIENTRY DllMain (HINSTANCE hInst, DWORD dwReason, LPVOID lpReserved){
    switch(dwReason){    
        case DLL_PROCESS_DETACH:
            KeyboardSetHook(false);
            MouseSetHook(false);
            break;    
    }
    return true;
}

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 {
        return UnhookWindowsHookEx(KeyboardHook);
        KeyboardHook = NULL;
    }
    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 { return UnhookWindowsHookEx(MouseHook); }
    return TRUE;
}

LRESULT CALLBACK KeyboardProc(int nCode, WPARAM wParam, LPARAM lParam){    
    if(((lParam>>31)&1) && (nCode == HC_ACTION)){
        if(wParam == VK_END){
            *Camera_RotY = -48.5;
            *Camera_RotZ = -45;
            *Camera_PosZ = 150;
            *Camera_ClipX = 1190;
            *Camera_ClipY = 2400;
            *Camera_GlClip = 3000;
            *Camera_Zoom = 35;
        }

        if(wParam == VK_HOME){
            if(!InitCamera)
            { InitCamera = true;
            } else {
            InitCamera = false;
            }
        }

    }    
    return CallNextHookEx(KeyboardHook, nCode, wParam, lParam);
}

LRESULT CALLBACK MouseProc(int code, WPARAM wParam, LPARAM lParam){
    MOUSEHOOKSTRUCTEX* mhs = (MOUSEHOOKSTRUCTEX*)lParam;
    HWND MuWnd = FindWindow(TEXT("MU"), NULL);
    if(GetForegroundWindow() == MuWnd){
        if(InitCamera == true){
            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;
        }

    if(InitCamera == true) {
        
        if(wParam == WM_MBUTTONDOWN){
            MoveCamera = true;
        }

        if(wParam == WM_MBUTTONUP){
            MoveCamera = false;
        }

        if(wParam == WM_MOUSEWHEEL){
            int direction = mhs->mouseData;
            if(direction > 0){
                if(*Camera_Zoom < 60){ *Camera_Zoom += 2; }
            }
            else if(direction < 0){
                if(*Camera_Zoom > 12){ *Camera_Zoom -= 2; }
            }
            *Camera_ClipX  = 1190 + (abs(*Camera_PosZ - 150) * 3) + 3000;
            *Camera_ClipY  = 2400 + (abs(*Camera_PosZ - 150) * 3) + 3000;
            *Camera_GlClip = 3000 + (abs(*Camera_PosZ - 150) * 3) + 1500;
        }
        else if(wParam == WM_MBUTTONDOWN){
            MouseX = mhs->pt.x;
            MouseY = mhs->pt.y;
        }

        else if(wParam == WM_MOUSEMOVE){
            
            if(MoveCamera){
                if(MouseX < mhs->pt.x){
                    *Camera_RotZ += 8;
                    if (*Camera_RotZ > 315) *Camera_RotZ = -45;
                }
                else if(MouseX > mhs->pt.x){
                    *Camera_RotZ -= 8;
                    if (*Camera_RotZ < -405) *Camera_RotZ = -45;
                }

                if(MouseY < mhs->pt.y){
                    if(*Camera_RotY < -45){    
                        *Camera_PosZ -= 44;
                        *Camera_RotY += (float)2.42;
                    }
                }
                else if(MouseY > mhs->pt.y){
                    if(*Camera_RotY > -90){
                        *Camera_PosZ += 44;
                        *Camera_RotY -= (float)2.42;
                    }
                }

                MouseX = mhs->pt.x;
                MouseY = mhs->pt.y;


                [COLOR="Red"]*Camera_ClipX = 1190 + (abs(*Camera_PosZ - 150) * 3) + 6000;
                *Camera_ClipY = 2400 + (abs(*Camera_PosZ - 150) * 3) + 4000;
                *Camera_GlClip = 3000 + (abs(*Camera_PosZ - 150) * 3) + 1500;[/COLOR]
            }

            }
        }
    }
    return CallNextHookEx(MouseHook, code, wParam, lParam);
}
 
Last edited:
Custom Title Activated
Loyal Member
Joined
Dec 5, 2009
Messages
2,657
Reaction score
1,178
if i know ? : O where is ur pro skills

u can't understand few line of code ?

told u it can be done in 5 second in few changes

do 1 time something by ur self & u will be more happy :d

Kiosani - 3D+Mini-Maps+Sky DLL by Nemesis BETA 0.1 - RaGEZONE Forums

Kiosani - 3D+Mini-Maps+Sky DLL by Nemesis BETA 0.1 - RaGEZONE Forums
 
Last edited:
Joined
Oct 29, 2007
Messages
1,292
Reaction score
1,314
You can teach me to make that modification in the source code of 3d camera, I'm using?


PS: You can lower the density to the blue haze that made ​​Lorencia, and change the color from blue to white? and Show me please a picture. Because my idea is to combine the sky with the white fog (but less densely so I would not completely hide the images of the sky). as it did for the ariethmu sobieh for some time back and as this picture clearly shows:
Kiosani - 3D+Mini-Maps+Sky DLL by Nemesis BETA 0.1 - RaGEZONE Forums
 
Last edited:
Custom Title Activated
Loyal Member
Joined
Dec 5, 2009
Messages
2,657
Reaction score
1,178
You can teach me to make that modification in the source code of 3d camera, I'm using?


PS: You can lower the density to the blue haze that made ​​Lorencia, and change the color from blue to white? and Show me please a picture.

if u have no idea how to increase range view in mouse control

then make additional keys without limit

for example

if (wParam == VK_F7)
*Camera_Zoom += 2;

if (wParam == VK_F8)
*Camera_Zoom -= 2;

PS: You can lower the density to the blue haze that made ​​Lorencia, and change the color from blue to white? and Show me please a picture.

sobieh and amelek have more mods than u ever seen in net
(not all was released on priv servers)

anyway everything is possible but u have alot to learn
if u can't even understand few lines of 3d cam code


Kiosani - 3D+Mini-Maps+Sky DLL by Nemesis BETA 0.1 - RaGEZONE Forums
 
Last edited by a moderator:
Back
Top