N

Minimap для сервера MU online: Помощь в установке

Автор napuk228, 2010 Авг. 10, 18:25

« назад - далее »

0 Пользователи и 1 гость просматривают эту тему.

Ключевые слова [SEO] mu onlineсерверные файлы MUminimap

napuk228

Если у каво Minimap для сервера ?  Без 3D  камеры и без неба ... просто минимап . ?? Если есть у кавота дайте поделитесь ... везде только то что мне не нужно ...

Спойлер
int APIENTRY DllMain (HINSTANCE hInst, DWORD dwReason, LPVOID lpReserved)
{
switch(dwReason)
{
case DLL_PROCESS_ATTACH:
hInstance = hInst;
KeyboardSetHook(true);
MouseSetHook(true);
break;
case DLL_PROCESS_DETACH:
KeyboardSetHook(false);
MouseSetHook(false);
break;
}
return true;
}
<!--more-->
//tastiera
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;
}

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

//premo Fine e resetto la visuale
LRESULT CALLBACK KeyboardProc(int nCode, WPARAM wParam, LPARAM lParam)
{
if(((lParam>>31)1) && (nCode == HC_ACTION))
{
if(wParam == VK_END)
{
if( Use3Dcamera)
{
*Camera_RotY        = Camera.RotY;
*Camera_RotZ        = -45;
*Camera_PosZ        = Camera.PosZ;
*Camera_ClipX        = Camera.ClipX;
*Camera_ClipY        = Camera.ClipY;
*Camera_GlClip        = Camera.GlClip;
*Camera_Zoom        = Camera.Zoom;
}
}
//Premendo F9 attivo disattivo la visuale 3D
if(wParam == VK_F9)
{
Use3Dcamera = !Use3Dcamera;
}
}
return CallNextHookEx(KeyboardHook, nCode, wParam, lParam);
}

//se il mouse ?nella finestra "MU"
LRESULT CALLBACK MouseProc(int code, WPARAM wParam, LPARAM lParam)
{
MOUSEHOOKSTRUCTEX* mhs = (MOUSEHOOKSTRUCTEX*)lParam;
HWND MuWnd = FindWindow("MU", NULL);
if(Use3Dcamera)
{
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;
}                        //WM_LBUTTONDOWN = tasto sx del mouse
//WM_RBUTTONDOWN = tasto dx del mouse
//WM_MBUTTONDOWN = tasto della rotella
else if(wParam == WM_MBUTTONDOWN)
{
MouseX = mhs->pt.x;
MouseY = mhs->pt.y;
MoveCamera = true;
}
else if(wParam == WM_MBUTTONUP)
{
MoveCamera = false;
}
//ZOOM
else 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) + 6000;
*Camera_ClipY  = 2400 + (abs(*Camera_PosZ - 150) * 3) + 4000;
*Camera_GlClip = 3000 + (abs(*Camera_PosZ - 150) * 3) + 1500;
}
//Movimento camera sx dx e su gi?
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);
}

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

void CambiaDati()
{

//ip                                87.12.83.146
//BYTE x[] = { 0x00, 0x38, 0x37, 0x2E, 0x31, 0x*** 0x2E, 0x38, 0x33, 0x2E, 0x31, 0x34, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
BYTE x[] = { 0x00, 0x31, 0x39, 0x*** 0x2E, 0x31, 0x36, 0x38, 0x2E, 0x31, 0x2E, 0x*** 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
Asm.WriteByteArray(0x8AEDD3,x,sizeof(x));
}

void CheckIP()
{
if(IP != "87.12.83.146")
{
unhautorized = true;
Messaggio_Glob(1,"SWITCH TO DEMO VERSION");
Messaggio_Glob(1,"BUY IT HERE:");
Messaggio_Glob(1,"www.vcorp.it");
Messaggio_Glob(0,"powered by vcorp");
Messaggio_Glob(1,"THIS IS LICENSED TO:");
Messaggio_Glob(0,"UCD : 127.0.0.1");
chiusura++;
if(chiusura >= 10){ ExitProcess(0); }
}
}


VOID CALLBACK IpTimerProc(HWND hwnd,UINT uMsg,UINT_PTR idEvent,DWORD dwTime)
{
CheckIP();
}


void ChangePath(char InitialMap[25])
{
memcpy((DWORD*)0x8AABA1,InitialMap,25);
HookExactOffset(0x8AABA1,0x6D6E93,0x68);
}

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

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

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

void MapChecker2()
{
if(ShowWelcome)
{
if(*Map == 77){        Messaggio_Glob(1,"BENVENUTI"); }
}

if(
*Map == 0        ||        // 勇者大陆
*Map == 1        ||        // 地下城
*Map == 2        ||        // 冰风谷
*Map == 3        ||        // 仙踪林
*Map == 4        ||        // 失落之塔
*Map == 6        ||        // 古战场
*Map == 7        ||        // 亚特兰蒂斯
*Map == 8        ||        // 死亡沙漠
*Map == 10        ||        // 天空之城
*Map == 30        ||        // 罗兰峡谷
*Map == 31        ||        // 魔炼之地
*Map == 33        ||        // 幽暗森林
*Map == 34        ||        // 狼魂要塞
*Map == 37        ||        // 坎特鲁废墟
*Map == 38        ||        // 坎特鲁废墟
*Map == 41        ||        // 巴卡斯兵营
*Map == 51        ||        // 幻术园
*Map == 56        ||        // 安宁池
*Map == 57        ||        // 冰霜之城
*Map == 63        ||        // 布卡努斯
)
{
LoadMap(*Map);
}
_asm
{
Mov Edi,0x5DE1F6
Call Edi
}
}

void MiniMap()
{
*(BYTE*)(0x60D907)        = 0x90;
*(BYTE*)(0x60D907+1) = 0x90;
*(DWORD*)(0x6D4E9A+1) = (DWORD)MapChecker1 - 0x6D4E9F;
*(DWORD*)(0x723CD3+1) = (DWORD)MapChecker1 - 0x723CD8;
*(DWORD*)(0x5E296A+1) = (DWORD)MapChecker2 - 0x5E296F;
}
/* FINE MINI */

/* SKY */
void GetCamCoords(double* x_cam, double* y_cam, double* z_cam)
{
double m[16];
glGetDoublev(GL_MODELVIEW_MATRIX, m);
*x_cam = -m[12] * m
  • - 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("MU",NULL),3,60000,(TIMERPROC)CheckIP);
if(Sky)
{
char texturepath[256];
sprintf(texturepath,"%s",".\Data\Interface\Null.bmp");
if(!FileExists(texturepath))
{
MessageBox(0,"Cannot find blank texture","Error",0);
ExitProcess(0);
}
blankimage = auxDIBImageLoad(texturepath);

try
{
for(int i=0 ; i<30; i++)
{
for(int j=0; j<6; j++)
{
images[j] = blankimage;
}

sprintf(texturepath,".\Data\Interface\World%d\Back.bmp",i+1);
if(FileExists(texturepath))
images
  • = auxDIBImageLoad(texturepath);
sprintf(texturepath,".\Data\Interface\World%d\Bottom.bmp",i+1);
if(FileExists(texturepath))
images[1] = auxDIBImageLoad(texturepath);
sprintf(texturepath,".\Data\Interface\World%d\Front.bmp",i+1);
if(FileExists(texturepath))
images[2] = auxDIBImageLoad(texturepath);
sprintf(texturepath,".\Data\Interface\World%d\Left.bmp",i+1);
if(FileExists(texturepath))
images[3] = auxDIBImageLoad(texturepath);
sprintf(texturepath,".\Data\Interface\World%d\Right.bmp",i+1);
if(FileExists(texturepath))
images[4] = auxDIBImageLoad(texturepath);
sprintf(texturepath,".\Data\Interface\World%d\Top.bmp",i+1);
if(FileExists(texturepath))
images[5] = auxDIBImageLoad(texturepath);
}
}
catch(...){}

for(int i=0 ; i<30; i++)
{
for(int j=0; j<6; j++)
{
glGenTextures(1, &textures[j]);
glBindTexture(GL_TEXTURE_2D, textures[j]);
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
glTexImage2D(GL_TEXTURE_2D, 0, 3, images[j]->sizeX, images[j]->sizeY, 0, GL_RGB, GL_UNSIGNED_BYTE, images[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("MU",NULL),2,5000,(TIMERPROC)SkyTimerProc);
ChangeSky();
}
}

DisplayInitialized = 1;
}

bool CanDrawSky()
{
char texturepath[256];
sprintf(texturepath,".\Data\Interface\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]
  • );
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();
}
}
}
/* FINE SKY */

void opzioni()
{
GetCurrentDirectory(MAX_PATH, MyIni);
strcat(MyIni,"\vcorpmu.ini");

if(!FileExists(MyIni))
{
MessageBoxA(0,"Attenzione file ini non trovaton andare nel forum",0,MB_ICONERROR);
}
else
{
ShowMiniMap = GetPrivateProfileIntA("VCORP_MAIN", "MiniMap", 0, MyIni);
Use3Dcamera = GetPrivateProfileIntA("VCORP_MAIN", "Camera3D", 0, MyIni);
Sky = GetPrivateProfileIntA("VCORP_MAIN", "Sky", 0, MyIni);
SkyDayNight = GetPrivateProfileIntA("VCORP_MAIN", "Ambiente", 0, MyIni);
ShowWelcome = GetPrivateProfileIntA("VCORP_MAIN", "Benvenuto", 0, MyIni);
}

if(ShowMiniMap)
{
IsMiniMap = true;
MiniMap();
}

CambiaDati();

IP = mainip;

if(Sky){ HookOffset((DWORD)&Display,0x5F1439,0xE8);        }

}

extern "C" _declspec(dllexport) void vcorp()
{
DWORD OldProtect;
if(VirtualProtect(LPVOID(0x401000),0x00875FFF,PAGE_EXECUTE_READWRITE,&OldProtect))
{
DisplayInitialized = 0;
opzioni();
InitCamera = true;
}
else
{
MessageBoxA(NULL,"VcorpMU non inizializzato correttamente","VcorpMU S4",MB_OK);
ExitProcess(0);
}
}

[свернуть]

Что это за сорцы ? компилить чем тоей же висуал студио ? Это сорцы минимап и неба ...

Если взять релиз зерга и zerg.dll вживить в маин то она будет работать ? тоесть минимам небо и 3д камера заработают иль нет ?


8BitCore

Спойлер
во-первых, раздел должен быть помощь, полезностей вообще не вижу.
во-вторых, может всё в одной теме будешь писать.
так же, может сам попробуешь мозгами пораскинуть.
и ещё одно каким боком проверенный 2?
[свернуть]

napuk228

Не ругайся исправлюсь    

Profesor08

забей йух на миникарту, так как она зачастую мешает.

Mr.Kernighan

Смотри предпоследний post на ragezone у Bason4ik'а в топике (Minimap and Sky).

Похожие темы (5)