re: [Development] Ultimate Source Code for Customs
ARIES: New float values for camera are only for fix the problem with black squares in game... for your problem with: Select Character Screen try to this:
.cpp file
Code:
int fixlogin = GetPrivateProfileIntA("Customs","FixLogin",0,"./Customs.ini");
if( fixlogin == 1 )
{
BYTE x4[] = { 0x8D, 0x73, 0x14 };
memcpy((int*)charselscreen, x4, sizeof(x4));
}
and this...
.h file
Code:
DWORD charselscreen = (DWORD)(0x64EB87); //1.07V+ Kor
Credits: Vcorp
re: [Development] Ultimate Source Code for Customs
Sorry, I don't explain myself well, there is not a problem whit Select Character Screen, the problem was connect into the game, and when character is inside the game, then, is discconected in 1 seg(s) But there was my mystake, i forgot to research for "HookSky" offset, now I can enter into the game, whitout discconect, but.. When I move the camera, this happened:
http://img838.imageshack.us/img838/3...0911240000.jpg
re: [Development] Ultimate Source Code for Customs
ah I see the problem, you are using the 3d camera source code for versions: 1.00, if what you want is for the camera to work properly you must use the code developed for the version: 1.03k
re: [Development] Ultimate Source Code for Customs
Yes, I have the code for 1.03k, and after this last code you post, i use that, but have the same problem, short view of map, and fog on the corners, I've tryed a lot of points to fix that, but at this time, rmst have more range view, and sky or not sky is the same, i don't know what have you change on rmst code, because rmst have more range of view in maps, but using the same source, your view is too short..
re: [Development] Ultimate Source Code for Customs
The problem is not the version the problem is the source, the camera is wrong for any main ._. i test the source and not works :) is just problem with cam3d, change for other
re: [Development] Ultimate Source Code for Customs
Good.. first of all I want to explain to everyone because no one can extend the range of vision of the map, the answer is very simple... and because no one has the correct offset for the value: Camera_GlClip... I'll leave here the source code for 3d camera (of Kalimdor Project V2) + camera to correct offsets: 1.03k (Jpn), one must make some Research's for your version of main.exe
Camera.cpp (of Kalimdor Prj V2)
Code:
#include "Stdafx.h"
#include "Camera.h"
extern "C" _declspec(dllexport) void Init()
{
DWORD OldProtect;
if(VirtualProtect(LPVOID(0x401000),0x00875FFF,PAGE_EXECUTE_READWRITE,&OldProtect))
{
KeyboardSetHook(true);
MouseSetHook(true);
}
else
{
MessageBoxA(NULL, "Cannot load Kalimdor.dll", "Error", MB_OK);
ExitProcess(0);
}
}
int UseCamera = GetPrivateProfileIntA("Addons","Camera",0,"./Addons.ini");
int APIENTRY DllMain (HINSTANCE hInst, DWORD dwReason, LPVOID lpReserved)
{
switch (dwReason)
{
case DLL_PROCESS_ATTACH:
{
hInstance = hInst;
}
break;
}
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)
{
if(UseCamera)
{
*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)
{
UseCamera = !UseCamera;
}
else
{
UseCamera = 0;
}
}
}
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(UseCamera)
{
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 = -45;
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;
}
if(*Camera_Zoom > 60)
*Camera_Zoom = 60;
}
else if(direction < 0)
{
if(*Camera_Zoom > 12)
{
*Camera_Zoom -= 2;
}
if(*Camera_Zoom < 12)
*Camera_Zoom = 12;
}
*Camera_ClipY = 2400 + (abs(*Camera_PosZ - 150) * 3) + 12144;
*Camera_ClipX = 1190 + (abs(*Camera_PosZ - 150) * 3) + 12144;
*Camera_GlClip = 3000 + (abs(*Camera_PosZ - 150) * 3) + 12144;
}
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_ClipY = 2400 + (abs(*Camera_PosZ - 150) * 3) + 12144;
*Camera_ClipX = 1190 + (abs(*Camera_PosZ - 150) * 3) + 12144;
*Camera_GlClip = 3000 + (abs(*Camera_PosZ - 150) * 3) + 12144;
}
}
}
}
return CallNextHookEx(MouseHook, code, wParam, lParam);
}
Camera.h (of Kalimdor Prj V2)
Code:
#pragma once
#include <cstdlib>
#include <iostream>
#include <math.h>
#include <stdio.h>
#include <windows.h>
#include "Stdafx.h"
#pragma data_seg(".SHAREDDATA")
static HHOOK KeyboardHook = NULL;
static HHOOK MouseHook = NULL;
#pragma data_seg()
#pragma comment(linker, "/SECTION:.SHAREDDATA,RWS")
static HINSTANCE hInstance;
bool MoveCamera = false;
bool InitCamera = true;
int MouseX, MouseY;
// Camera Offsets 1.03k JPN
float *Camera_Zoom = (float*) 0x006001E9;
float *Camera_RotY = (float*) 0x0088BC78;
float *Camera_RotZ = (float*) 0x0809F150;
float *Camera_PosZ = (float*) 0x0088ACFC;
float *Camera_ClipX = (float*) 0x0088BB18;
float *Camera_ClipY = (float*) 0x005AB4CD;
float *Camera_GlClip = (float*) 0x00600479;
struct CameraStruct {
float Zoom;
float RotY;
float RotZ;
float PosZ;
float ClipX;
float ClipY;
float GlClip;
} Camera;
LRESULT CALLBACK KeyboardProc(int, WPARAM, LPARAM);
LRESULT CALLBACK MouseProc(int, WPARAM, LPARAM);
BOOL MouseSetHook(BOOL);
BOOL KeyboardSetHook(BOOL);
PS: mark with color: Red, just what should be changed or have right to operate the increased range of vision of the map with the camera (on most maps do not at all).
1 Attachment(s)
re: [Development] Ultimate Source Code for Customs
Quote:
no one can extend the range of vision of the map
As long as you can't debug the main to find out the needed offsets/functions you're right. With a little research you can even draw objects/textures in the gamescene, modify lights of the scene and everything.
re: [Development] Ultimate Source Code for Customs
I think the problem is about other stuff, because ive researched all offsets needed, and I think all offsets are ok.
Look:
http://img85.imageshack.us/img85/6235/glclip.jpg
And the result:
http://img248.imageshack.us/img248/6350/glclip2.jpg
re: [Development] Ultimate Source Code for Customs
Sky Coords are bad... you must increase sky cube coords too.. for example: x_cam = 3000, y_cam = 3000... you must increase: 3000 by some coords more big's than: 3000... for example: 11000.
PS: For fog is more complicated.
re: [Development] Ultimate Source Code for Customs
Ok, now all is working fine, on 1.07V+.
Yesterday, when i've finished configs for better functions on this sources, i've researched all offsets for 1.05X+ (kor), but this main whit this same source, don't start...:$:
re: [Development] Ultimate Source Code for Customs
very nice, thanks for the share
re: [Development] Ultimate Source Code for Customs
Quote:
Originally Posted by
|ARIES|
Ok, now all is working fine, on 1.07V+.
Yesterday, when i've finished configs for better functions on this sources, i've researched all offsets for 1.05X+ (kor), but this main whit this same source, don't start...:$:
Could you share with us the Source Edited for main 1.07V+ (1.07.48) ??? Thanks man, will help alot
re: [Development] Ultimate Source Code for Customs
can you make the same for 1.02R+?
re: [Development] Ultimate Source Code for Customs
re: [Development] Ultimate Source Code for Customs
Mauro, how to deactivate Kalima and LorenDeep? because.. the camera don't work properly on that maps... also, in Kalima work fine, but have not water..