Noticias:

SMF - Just Installed!

Menú principal

Source WideScreen Season 6

Publicado por Dakosmu, Jun 24, 2023, 06:28 PM

Tema anterior - Siguiente tema

Dakosmu

Source WideScreen Season 6

Los visitantes no pueden visualizar imágenes en los mensajes, por favor Regístrate o Inicia Sesión



Crear Nuevo Filtro WideScreen

Los visitantes no pueden visualizar imágenes en los mensajes, por favor Regístrate o Inicia Sesión


Interface.cpp
//-- Wide
pLoadImage("Custom\\Interface\\Decor.tga", 87968, 0x2601, 0x2901, 1, 0);
pLoadImage("Custom\\Interface\\InterfaceBar.tga", 87969, 0x2601, 0x2901, 1, 0);
pLoadImage("Interface\\GFx\\skill_render.tga", 61546, GL_LINEAR, GL_CLAMP, 1, 0);
pLoadImage("Interface\\GFx\\item_pbtnbg.tga", 61547, GL_LINEAR, GL_CLAMP, 1, 0);
//pLoadImage("Custom\\Interface\\none.tga", 51522, GL_LINEAR, GL_CLAMP, 1, 0);
pLoadImage("Interface\\newui_number1.tga", 31337, 9729, 10496, 1, 0);
//LoadBitmapA("Interface\\GFx\\Legends\\Main_Skillbox.tga", 51500, GL_LINEAR, GL_CLAMP, 1, 0);

Interfaces6.cpp
LoadBitmapA("Custom\\Interface\\Decor.tga", 87968, 0x2601, 0x2901, 1, 0);
LoadBitmapA("Custom\\Interface\\InterfaceBar.tga", 87969, 0x2601, 0x2901, 1, 0);
LoadBitmapA("Interface\\GFx\\skill_render.tga", 61546, GL_LINEAR, GL_CLAMP, 1, 0);
LoadBitmapA("Interface\\GFx\\item_pbtnbg.tga", 61547, GL_LINEAR, GL_CLAMP, 1, 0);
//LoadBitmapA("Interface\\GFx\\Legends\\Main_Skillbox.tga", 51500, GL_LINEAR, GL_CLAMP, 1, 0);

Agregar Elementos Existentes
Los visitantes no pueden visualizar imágenes en los mensajes, por favor Regístrate o Inicia Sesión


You require the following to view this post content:
  • You require a post count of at least 1, you need another 1 posts.
[/hide] login=1 post=1]
Citarhttps://mega.nz/file/d3xBgZab#oM6204mY7hgh9pa5H_A-RKhVvj4e-ncKxwwRQr9piug"]WideScreen.cpp



Agregar[/hide][/hide] en main.cpp
Los visitantes no pueden visualizar imágenes en los mensajes, por favor Regístrate o Inicia Sesión

#include "WideScreen.h"

Buscar
Los visitantes no pueden visualizar imágenes en los mensajes, por favor Regístrate o Inicia Sesión


Buscar
gCustomMap.Load();
Agregar
Los visitantes no pueden visualizar imágenes en los mensajes, por favor Regístrate o Inicia Sesión

Agregar
gWideScreen.Init();

Agregar en Import.h

Los visitantes no pueden visualizar imágenes en los mensajes, por favor Regístrate o Inicia Sesión




//WideScreen
#define ItemAttributex(Type)                (ITEM_ATTRIBUTE*)(*(DWORD*)0x008128AC0 + 84 * Type)
#define JCBaulExtShow                ((void (__thiscall*)(int This)) 0x008567B0)
#define JCBaulExtMove                ((BYTE *(__thiscall*)(int This, int a2, int a3)) 0x008564F0)
#define JCStoreMove                    ((int(__thiscall*)(int This, int a2, int a3, int a4)) 0x00840D80)
#define JCChaosMove                    ((int(__thiscall*)(void *This, int a2, int a3, int a4)) 0x0082C340)
#define JCShopMove                    ((BYTE *(__thiscall*)(int This, int a2, int a3, int a4)) 0x00846B90)
#define JCOtherStoreMove            ((int (__thiscall*)(void *This, int a2, int a3, int a4)) 0x0084FA90)
#define JCBaulMove                    ((int (__thiscall*)(void *This, int a2, int a3, int a4)) 0x00857200)
#define JCInvExtMove                ((signed int (__thiscall*)(int This, int a2, int a3)) 0x007D4E70)
#define JCTradeMove                    ((int (__thiscall*)(void *This, int a2, int a3, int a4)) 0x00863F10)
#define JCLuckyMove                    ((int (__thiscall*)(void *This, int a2, int a3, int a4)) 0x007F0460)
#define sub_7D6270                    ((int(__thiscall*)(int This, int a5))0x007D6270)
#define JCBeginOpengl                ((void(__cdecl*)(GLint x, int a2, GLsizei width, GLsizei height)) 0x00636480)
#define ChangeButtonInfo ((int(__thiscall*)(char *This, int X, int Y, int Width, int Height)) 0x00779410)
#define Hero_Offset                                *(DWORD *)0x007BC4F04
#define uint32_t  __int32
#define SetCurrentAction ((void(*)(ObjectModel *, int, int))0x542310)
#define Hero ((ObjectCharacter*)0x7BC4F04)
#define CheckMouseIn ((bool(*)(int, int, int, int))0x790B10)
#define RenderImage2 ((void(__cdecl*)(int Texture, float x, float y, float Width, float Height, float u, float v, float uWidth, float vHeight, bool Scale, bool StartScale, float Alpha)) 0x00637C60)
#define RenderImage ((void(__cdecl*)(DWORD, float, float, float, float)) 0x00790B50)
#define oGuildMarkStruct        (int)0x81CB588
#define GuildMarkStruct(GuildMarkIndex)  (MARK_t*)(oGuildMarkStruct + sizeof(MARK_t) * GuildMarkIndex)
#define GuildMarkGetName(GuildMarkIndex) (char*)((BYTE)0x81CB595 + 88 * GuildMarkIndex)
#define GlobalText(iNumber)        (iGlobalText(GlobalLine, iNumber))
#define iGlobalText                ((char*(__thiscall*)(LPVOID This, int LineNumber)) 0x00402320)
#define GlobalLine                (LPVOID)0x008128ADC
#define g_isCharacterBuff                            ((bool(__thiscall*)(DWORD * thisa, int bufftype)) 0x004C8640)
#define MAIN_HDC (HDC)0xE8C580
#define pGetTextLine                ((char*(__thiscall*)(LPVOID This, int LineNumber)) 0x00402320)
#define MAIN_SCREEN_STATE 0x00E609E8
#define MAIN_RESOLUTION 0x00E8C240
#define MAIN_RESOLUTION_X 0x00E61E58
#define MAIN_RESOLUTION_Y 0x00E61E5C
#define pCursorX                *(int*)0x879340C
#define pCursorY                *(int*)0x8793410
#define pWinWidth                *(GLsizei*)0x0E61E58
#define pWinHeight                *(GLsizei*)0x0E61E5C
#define pWinWidthReal            *(float*)0xE7C3D4
#define pWinHeightReal            *(float*)0xE7C3D8
#define pWinFontHeight            *(int*)0x81C0380
#define pTextLineThis            ((LPVOID(*)()) 0x8128ADC)
#define pGetTextLine            ((LPCSTR(__thiscall*)(LPVOID This, int LineNumber)) 0x402320)
#define pDrawItemModel            ((int(__cdecl*)(float PosX, float PosY, float Width, float Height, int ItemID, int a6, int a7, float a8, char a9)) 0x5CF310)
#define pSetCursorFocus            *(DWORD*)0xE8CB3C
#define pAllowGUI                ((bool(__cdecl*)()) 0x007D4250)
#define oAllowGUI_Call1            0x007D378E
#define oAllowGUI_Call2            0x00811C42
#define pDrawBarForm            ((void(__cdecl*)(float PosX, float PosY, float Width, float Height, float Arg5, int Arg6)) 0x6378A0)
#define pGLSwitchBlend            ((void(__cdecl*)()) 0x636070)
#define pGLSwitch                ((void(__cdecl*)()) 0x635F50)
#define pCharacterBuf            ((int(__thiscall*)(void *This, int a2)) 0x0040FCA0)







WideScreen.cpp
#include "stdafx.h"

#include "Util.h"
#include "Console.h"
#include "Import.h"
#include "Object.h"
#include "WideScreen.h"

static bool minInitialized = false;
float g_fScreenRate_min = 0.0;

float g_fScreenRatex = 0.0;
float g_fScreenRatey = 0.0;

int difeX = 0;

WideScreen gWideScreen;

WideScreen::WideScreen()
{
}

WideScreen::~WideScreen()
{
}

float ConvertX2(float value) {
    return value * g_fScreenRate_min;
}

float ConvertXWide(float value) {
    if (*(DWORD*)(MAIN_SCREEN_STATE) != 5)
    {
        return value;
    }
    else {
        return ((*(DWORD*)MAIN_RESOLUTION_X - WideScreen::ConvertX(640 - value)) / g_fScreenRate_min) + 1;
    }
}

int ConvertXWide2(int value) {
    return ((*(DWORD*)MAIN_RESOLUTION_X - ConvertX2(640 - value)) / g_fScreenRate_min) + 1;
}

float GetDifferenceX() {
    if (*(DWORD*)(MAIN_SCREEN_STATE) != 5)
    {
        return 0.0;
    }
    else
    {
        return ((float)(*(DWORD*)MAIN_RESOLUTION_X - WideScreen::ConvertX(640)) / g_fScreenRate_min) / 2.f;
    }
}

int GetDifferenceX2() {
    return (int)(((float)(*(DWORD*)MAIN_RESOLUTION_X - ConvertX2(640)) / g_fScreenRate_min) / 2.f);
}

int GetBaseValue(int value) {
    return value * g_fScreenRate_min;
}

__declspec(naked) void SetInventoryPos() {
    static DWORD m_ReturnFunc = 0x00834430;

    _asm {
        MOV DWORD PTR SS : [EBP - 0x4] , ECX;
        MOV EAX, DWORD PTR SS : [EBP + 0x8] ;
        PUSH EAX;
        CALL[ConvertXWide2];
        MOV DWORD PTR SS : [EBP + 0x8] , EAX;
        MOV EDX, DWORD PTR SS : [EBP - 4] ;
        MOV DWORD PTR DS : [EDX + 0x24] , EAX;

        ADD ESP, 0x04;

        JMP[m_ReturnFunc];
    }
}

__declspec(naked) void SetCharacterPos() {
    static DWORD m_ReturnFunc = 0x0077ED80;

    _asm {
        MOV DWORD PTR SS : [EBP - 4] , ECX
        MOV ECX, DWORD PTR SS : [EBP + 8]
        PUSH ECX
        CALL[ConvertXWide2];
        MOV ECX, DWORD PTR SS : [EBP - 4] ;
        MOV DWORD PTR DS : [ECX + 0x10] , EAX;
        ADD ESP, 0x04;


        JMP[m_ReturnFunc];
    }
}

__declspec(naked) void SetProjection()
{
    static DWORD m_hookfunc = 0x00635B6C;

    static int sx = 0;

    _asm {
        MOV ECX, DWORD PTR SS : [EBP + 0xC] ;
        MOV EAX, DWORD PTR DS : [EDX]
            MOV sx, EAX;
    }

    if (*(DWORD*)(MAIN_SCREEN_STATE) != 5) {
        sx = sx * 640 / *(DWORD*)MAIN_RESOLUTION_X;
    }
    else {
        static float ratioX = (float)*(DWORD*)MAIN_RESOLUTION_X / 640.f;
        static float ratioY = (float)*(DWORD*)MAIN_RESOLUTION_Y / 480.f;

        if (ratioX > ratioY) {
            sx = sx * 480 / *(DWORD*)MAIN_RESOLUTION_Y;
        }
        else {
            sx = sx * 640 / *(DWORD*)MAIN_RESOLUTION_X;
        }
    }

    _asm
    {
        MOV EAX, sx;
        MOV ECX, DWORD PTR SS : [EBP + 0xC]
            MOV DWORD PTR DS : [ECX] , EAX

            JMP[m_hookfunc];
    }
}

__declspec(naked) void SetButtonsFrameMenu() {
    static int difX = 489 + difeX;
    static DWORD m_HookFunc = 0x0080F287;

    static DWORD m_OldEax;

    _asm
    {
        MOV ECX, difX;
        MOV m_OldEax, EAX;
        MOV DWORD PTR SS : [EBP - 0x10] , ECX;
        MOV DWORD PTR SS : [EBP - 0x4] , 0x1AD;
        MOV EAX, m_OldEax
            JMP[m_HookFunc];
    }
}


void WideScreen::Init()
{
    SetCompleteHook(0xE9, 0x006359B6, &this->CreateScreenVector);
    SetCompleteHook(0xE9, 0x00636420, &this->ConvertX);
    SetCompleteHook(0xE9, 0x00636450, &this->ConvertY);
    SetCompleteHook(0xE8, 0x004D2180, &this->OpenFile);
    SetCompleteHook(0xE9, 0x005C6E80, &this->GetScreenWidth);

    SetCompleteHook(0xE8, 0x0080F7FE, &this->RenderFrameMenu);
    SetCompleteHook(0xE8, 0x0080F845, &this->RenderLifeMana);
    //SetCompleteHook(0xE8, 0x0080F84D, &this->RenderGuageSD);
    //SetCompleteHook(0xE8, 0x0080F855, &this->RenderGuageAG);


    SetCompleteHook(0xE9, 0x00834424, &SetInventoryPos);
    SetCompleteHook(0xE9, 0x0077ED74, &SetCharacterPos);

    SetCompleteHook(0xE9, 0x00635B55, &SetProjection);

    SetCompleteHook(0xE9, 0x0080F280, &SetButtonsFrameMenu);
}

__declspec(naked) void WideScreen::CreateScreenVector() {
    static DWORD m_ReturnFunc = 0x006359C0;
    static DWORD m_HookFunc = 0x006359E8;

    if (*(DWORD*)(MAIN_SCREEN_STATE) != 5) {
        _asm {
            MOV EAX, DWORD PTR SS : [EBP + 0x8] ;
            IMUL EAX, DWORD PTR DS : [0xE61E58] ;

            JMP[m_ReturnFunc];
        }
    }
    else {
        _asm {
            MOV EAX, DWORD PTR SS : [EBP + 0x8] ;
            PUSH EAX;
            CALL[GetBaseValue];
            MOV DWORD PTR SS : [EBP + 0x8] , EAX;
            MOV EAX, DWORD PTR SS : [EBP + 0xC] ;
            PUSH EAX;
            CALL[GetBaseValue];
            MOV DWORD PTR SS : [EBP + 0xC] , EAX;
            ADD ESP, 0x08;
            JMP[m_HookFunc];
        }
    }
}

float WideScreen::ConvertX(float value)
{
    if (*(DWORD*)(MAIN_SCREEN_STATE) != 5)
    {
        return (float)((*(DWORD*)MAIN_RESOLUTION_X * value) / 640.0);
    }

    if (!minInitialized) {
        minInitialized = true;

        g_fScreenRate_min = min(*(float*)0xE7C3D4, *(float*)0xE7C3D8);

        *(float*)0xE7C3D4 = *(float*)0xE7C3D8 = min(*(float*)0xE7C3D4, *(float*)0xE7C3D8);

        //Set font
        ((void(__thiscall*)(LPVOID))0x41FF20)(pTextThis());

        ((void(__thiscall*)(LPVOID, int, HDC))0x41FE80)(pTextThis(), 0, MAIN_HDC);
    }

    return value * g_fScreenRate_min;
}

float WideScreen::ConvertY(float value)
{
    if (*(DWORD*)(MAIN_SCREEN_STATE) != 5)
    {
        return (float)((*(DWORD*)MAIN_RESOLUTION_Y * value) / 480.0);
    }

    if (!minInitialized) {
        minInitialized = true;

        g_fScreenRate_min = min(*(float*)0xE7C3D4, *(float*)0xE7C3D8);

        *(float*)0xE7C3D4 = *(float*)0xE7C3D8 = min(*(float*)0xE7C3D4, *(float*)0xE7C3D8);

        //Set font
        ((void(__thiscall*)(LPVOID))0x41FF20)(pTextThis());

        ((void(__thiscall*)(LPVOID, int, HDC))0x41FE80)(pTextThis(), 0, MAIN_HDC);
    }

    return value * g_fScreenRate_min;
}

void WideScreen::OpenFile()
{
    ((void(*)())0x4D0FC0)();

    g_fScreenRate_min = min(*(float*)0xE7C3D4, *(float*)0xE7C3D8);

    SetDword(0x004D06F4 + 6, *(DWORD*)MAIN_RESOLUTION_X);

    SetDword(0x004D071D + 6, *(DWORD*)MAIN_RESOLUTION_Y);

    difeX = GetDifferenceX2();
}

int WideScreen::GetScreenWidth()
{
    int Width = 0;

    if (((bool(__thiscall*)(LPVOID This, int Code)) 0x0085EC20)(((LPVOID(*)()) 0x861110)(), 13)
        && ((((bool(__thiscall*)(LPVOID This, int Code)) 0x0085EC20)(((LPVOID(*)()) 0x861110)(), 16))
            || (((bool(__thiscall*)(LPVOID This, int Code)) 0x0085EC20)(((LPVOID(*)()) 0x861110)(), 8))
            || (((bool(__thiscall*)(LPVOID This, int Code)) 0x0085EC20)(((LPVOID(*)()) 0x861110)(), 12))
            || (((bool(__thiscall*)(LPVOID This, int Code)) 0x0085EC20)(((LPVOID(*)()) 0x861110)(), 9))
            || (((bool(__thiscall*)(LPVOID This, int Code)) 0x0085EC20)(((LPVOID(*)()) 0x861110)(), 7))
            || (((bool(__thiscall*)(LPVOID This, int Code)) 0x0085EC20)(((LPVOID(*)()) 0x861110)(), 14))
            || (((bool(__thiscall*)(LPVOID This, int Code)) 0x0085EC20)(((LPVOID(*)()) 0x861110)(), 15))
            || (((bool(__thiscall*)(LPVOID This, int Code)) 0x0085EC20)(((LPVOID(*)()) 0x861110)(), 60))
            || (((bool(__thiscall*)(LPVOID This, int Code)) 0x0085EC20)(((LPVOID(*)()) 0x861110)(), 76))))
    {
        Width = ConvertXWide(260) - GetDifferenceX();
    }
    else
    {
        if (((bool(__thiscall*)(LPVOID This, int Code)) 0x0085EC20)(((LPVOID(*)()) 0x861110)(), 16)
            && ((((bool(__thiscall*)(LPVOID This, int Code)) 0x0085EC20)(((LPVOID(*)()) 0x861110)(), 4))
                || (((bool(__thiscall*)(LPVOID This, int Code)) 0x0085EC20)(((LPVOID(*)()) 0x861110)(), 69))))
        {
            Width = ConvertXWide(260) - GetDifferenceX();
        }
        else
        {
            if (((bool(__thiscall*)(LPVOID This, int Code)) 0x0085EC20)(((LPVOID(*)()) 0x861110)(), 16)
                && (((bool(__thiscall*)(LPVOID This, int Code)) 0x0085EC20)(((LPVOID(*)()) 0x861110)(), 11)))
            {
                Width = ConvertXWide(260) - GetDifferenceX();
            }
            else
            {
                if (((bool(__thiscall*)(LPVOID This, int Code)) 0x0085EC20)(((LPVOID(*)()) 0x861110)(), 27))
                {
                    Width = ConvertXWide(260) - GetDifferenceX();
                }
                else
                {
                    if (((bool(__thiscall*)(LPVOID This, int Code)) 0x0085EC20)(((LPVOID(*)()) 0x861110)(), 13)
                        || (((bool(__thiscall*)(LPVOID This, int Code)) 0x0085EC20)(((LPVOID(*)()) 0x861110)(), 16))
                        || (((bool(__thiscall*)(LPVOID This, int Code)) 0x0085EC20)(((LPVOID(*)()) 0x861110)(), 3))
                        || (((bool(__thiscall*)(LPVOID This, int Code)) 0x0085EC20)(((LPVOID(*)()) 0x861110)(), 21))
                        || (((bool(__thiscall*)(LPVOID This, int Code)) 0x0085EC20)(((LPVOID(*)()) 0x861110)(), 6))
                        || (((bool(__thiscall*)(LPVOID This, int Code)) 0x0085EC20)(((LPVOID(*)()) 0x861110)(), 22))
                        || (((bool(__thiscall*)(LPVOID This, int Code)) 0x0085EC20)(((LPVOID(*)()) 0x861110)(), 23))
                        || (((bool(__thiscall*)(LPVOID This, int Code)) 0x0085EC20)(((LPVOID(*)()) 0x861110)(), 24))
                        || (((bool(__thiscall*)(LPVOID This, int Code)) 0x0085EC20)(((LPVOID(*)()) 0x861110)(), 4))
                        || (((bool(__thiscall*)(LPVOID This, int Code)) 0x0085EC20)(((LPVOID(*)()) 0x861110)(), 18))
                        || (((bool(__thiscall*)(LPVOID This, int Code)) 0x0085EC20)(((LPVOID(*)()) 0x861110)(), 10))
                        || (((bool(__thiscall*)(LPVOID This, int Code)) 0x0085EC20)(((LPVOID(*)()) 0x861110)(), 5))
                        || (((bool(__thiscall*)(LPVOID This, int Code)) 0x0085EC20)(((LPVOID(*)()) 0x861110)(), 25))
                        || (((bool(__thiscall*)(LPVOID This, int Code)) 0x0085EC20)(((LPVOID(*)()) 0x861110)(), 26))
                        || (((bool(__thiscall*)(LPVOID This, int Code)) 0x0085EC20)(((LPVOID(*)()) 0x861110)(), 19))
                        || (((bool(__thiscall*)(LPVOID This, int Code)) 0x0085EC20)(((LPVOID(*)()) 0x861110)(), 20))
                        || (((bool(__thiscall*)(LPVOID This, int Code)) 0x0085EC20)(((LPVOID(*)()) 0x861110)(), 58))
                        || (((bool(__thiscall*)(LPVOID This, int Code)) 0x0085EC20)(((LPVOID(*)()) 0x861110)(), 59))
                        || (((bool(__thiscall*)(LPVOID This, int Code)) 0x0085EC20)(((LPVOID(*)()) 0x861110)(), 62))
                        || (((bool(__thiscall*)(LPVOID This, int Code)) 0x0085EC20)(((LPVOID(*)()) 0x861110)(), 73))
                        || (((bool(__thiscall*)(LPVOID This, int Code)) 0x0085EC20)(((LPVOID(*)()) 0x861110)(), 68))
                        || (((bool(__thiscall*)(LPVOID This, int Code)) 0x0085EC20)(((LPVOID(*)()) 0x861110)(), 69))
                        || (((bool(__thiscall*)(LPVOID This, int Code)) 0x0085EC20)(((LPVOID(*)()) 0x861110)(), 70))
                        || (((bool(__thiscall*)(LPVOID This, int Code)) 0x0085EC20)(((LPVOID(*)()) 0x861110)(), 66))
                        || (((bool(__thiscall*)(LPVOID This, int Code)) 0x0085EC20)(((LPVOID(*)()) 0x861110)(), 75))
                        || (((bool(__thiscall*)(LPVOID This, int Code)) 0x0085EC20)(((LPVOID(*)()) 0x861110)(), 74)))
                    {
                        Width = ConvertXWide(450) - GetDifferenceX();
                    }
                    else
                    {
                        if (((bool(__thiscall*)(LPVOID This, int Code)) 0x0085EC20)(((LPVOID(*)()) 0x861110)(), 79))
                        {
                            if (((bool(__thiscall*)(LPVOID This, int Code)) 0x0085EC20)(((LPVOID(*)()) 0x861110)(), 80)) {
                                Width = ConvertXWide(260) - GetDifferenceX();
                            }
                            else {
                                Width = ConvertXWide(450) - GetDifferenceX();
                            }
                        }
                        else
                        {
                            Width = ConvertXWide(640) - GetDifferenceX();
                        }
                    }
                }
            }
        }
    }

    if (((bool(__thiscall*)(LPVOID This, int Code)) 0x0085EC20)(((LPVOID(*)()) 0x861110)(), 77))
    {
        if (((int(__thiscall*)(LPVOID This, int)) 0x007D6270)(((LPVOID(__thiscall*)(LPVOID))0x861A60)(pWindowThis()), 0)) {
            Width = ConvertXWide(70) - GetDifferenceX();
        }
        else {
            Width = ConvertXWide(260) - GetDifferenceX();
        }
    }
    else
    {
        if (((bool(__thiscall*)(LPVOID This, int Code)) 0x0085EC20)(((LPVOID(*)()) 0x861110)(), 78)) {
            Width = ConvertXWide(70) - GetDifferenceX();
        }
    }

    return Width;
}

void WideScreen::RenderFrameMenu(DWORD* This)
{
    int difX = GetDifferenceX();

    RenderImage(31292, 0.0 + difX, 429, 256.0, 51.0);
    RenderImage(31293, 256.0 + difX, 429, 128.0, 51.0);
    RenderImage(31294, 384.0 + difX, 429, 256.0, 51.0);
}

void WideScreen::RenderLifeMana(DWORD* This)
{
    int difX = GetDifferenceX();
    uint32_t wLifeMax, wLife, wManaMax, wMana;

    if (((bool(*)(DWORD))0x5878E0)(Hero->Class) == 1)
    {
        wLifeMax = *(WORD*)0x87935F8;
        wLife = min(max(0, *(WORD*)(*(DWORD*)0x8128AC8 + 34)), wLifeMax);
        wManaMax = *(WORD*)0x87935FA;
        wMana = min(max(0, *(WORD*)(*(DWORD*)0x8128AC8 + 36)), wManaMax);
    }
    else
    {
        wLifeMax = *(WORD*)(*(DWORD*)0x8128AC8 + 38);
        wLife = min(max(0, *(WORD*)(*(DWORD*)0x8128AC8 + 34)), wLifeMax);
        wManaMax = *(WORD*)(*(DWORD*)0x8128AC8 + 40);
        wMana = min(max(0, *(WORD*)(*(DWORD*)0x8128AC8 + 36)), wManaMax);
    }

    if (wLifeMax > 0)
    {
        if (wLife > 0 && (wLife / (float)wLifeMax) < 0.2f)
        {
            ((void(*)(DWORD, ObjectModel*, DWORD))0x6D6C20)(34, 0, 0);
        }
    }

    float fLife = 0.f;
    float fMana = 0.f;

    if (wLifeMax > 0) {
        fLife = (wLifeMax - wLife) / (float)wLifeMax;
    }
    if (wManaMax > 0) {
        fMana = (wManaMax - wMana) / (float)wManaMax;
    }

    float width, height;
    float x, y;
    float fY, fH, fV;

    // life
    width = 45.f;
    x = 158 + difX;
    height = 39.f;
    y = 480.f - 48.f;

    fY = y + (fLife * height);
    fH = height - (fLife * height);
    fV = fLife;

    if (g_isCharacterBuff((DWORD*)(Hero_Offset + 1260), 55))
    {
        RenderImage2(31297, x, fY, width, fH, 0.f, fV * height / 64.f, width / 64.f, (1.0f - fV) * height / 64.f, true, true, 0.f);
    }
    else
    {
        RenderImage2(31298, x, fY, width, fH, 0.f, fV * height / 64.f, width / 64.f, (1.0f - fV) * height / 64.f, true, true, 0.f);
    }

    ((void(*)(float, float, int, float))0x791000)(x + 25, 480 - 18, wLife, 1.f);

    char strTipText[256];
    if (CheckMouseIn(x, y, width, height) == true)
    {
        sprintf(strTipText, GlobalText(358), wLife, wLifeMax);
        pDrawToolTip((int)x, (int)418, strTipText);
    }

    // mana
    width = 45.f;
    x = 256.f + 128.f + 53.f + difX;
    height = 39.f;
    y = 480.f - 48.f;

    fY = y + (fMana * height);
    fH = height - (fMana * height);
    fV = fMana;

    RenderImage2(31296, x, fY, width, fH, 0.f, fV * height / 64.f, width / 64.f, (1.0f - fV) * height / 64.f, true, true, 0.f);

    ((void(*)(float, float, int, float))0x791000)(x + 30, 480 - 18, wMana, 1.f);

    // mana
    if (CheckMouseIn(x, y, width, height) == true)
    {
        sprintf(strTipText, GlobalText(359), wMana, wManaMax);
        pDrawToolTip((int)x, (int)418, strTipText);
    }
}

void WideScreen::RenderGuageAG(DWORD* This)
{
    int difX = GetDifferenceX();
    float x, y, width, height;
    float fY, fH, fV;

    WORD dwMaxSkillMana, dwSkillMana;

    if (((bool(*)(DWORD))0x5878E0)(Hero->Class) == true)
    {

        dwMaxSkillMana = max(1, *(WORD*)0x87935FE);
        dwSkillMana = min(dwMaxSkillMana, *(WORD*)(*(DWORD*)0x8128AC8 + 64));
    }
    else
    {
        dwMaxSkillMana = max(1, *(WORD*)(*(DWORD*)0x8128AC8 + 66));
        dwSkillMana = min(dwMaxSkillMana, *(WORD*)(*(DWORD*)0x8128AC8 + 64));
    }

    float fSkillMana = 0.0f;

    if (dwMaxSkillMana > 0)
    {
        fSkillMana = (dwMaxSkillMana - dwSkillMana) / (float)dwMaxSkillMana;
    }

    width = 16.f, height = 39.f;
    x = 256 + 128 + 36; y = 480.f - 49.f;
    x += difX;
    fY = y + (fSkillMana * height);
    fH = height - (fSkillMana * height);
    fV = fSkillMana;

    RenderImage2(31299, x, fY, width, fH, 0.f, fV * height / 64.f, width / 16.f, (1.0f - fV) * height / 64.f, true, true, 0.0f);

    ((void(*)(float, float, int, float))0x791000)(x + 10, 480 - 18, (int)dwSkillMana, 1.f);

    if (CheckMouseIn(x, y, width, height) == true)
    {
        char strTipText[256];

        sprintf(strTipText, GlobalText(214), dwSkillMana, dwMaxSkillMana);
        pDrawToolTip((int)x - 20, (int)418, strTipText);
    }
}

void WideScreen::RenderGuageSD(DWORD* This)
{
    int difX = GetDifferenceX();

    float x, y, width, height;
    float fY, fH, fV;
    WORD wMaxShield, wShield;


    if (((bool(*)(DWORD))0x5878E0)(Hero->Class) == true)
    {
        wMaxShield = max(1, *(WORD*)0x87935FC);
        wShield = min(wMaxShield, *(WORD*)(*(DWORD*)0x8128AC8 + 42));
    }
    else
    {
        wMaxShield = max(1, *(WORD*)(*(DWORD*)0x8128AC8 + 44));
        wShield = min(wMaxShield, *(WORD*)(*(DWORD*)0x8128AC8 + 42));
    }

    float fShield = 0.0f;

    if (wMaxShield > 0)
    {
        fShield = (wMaxShield - wShield) / (float)wMaxShield;
    }

    width = 16.f, height = 39.f;
    x = 204; y = 480.f - 49.f;

    x += difX;

    fY = y + (fShield * height);
    fH = height - (fShield * height);
    fV = fShield;

    RenderImage2(31300, x, fY, width, fH, 0.f, fV * height / 64.f, width / 16.f, (1.0f - fV) * height / 64.f, 1, 1, 0.0f);

    ((void(*)(float, float, int, float))0x791000)(x + 15, 480 - 18, (int)wShield, 1.f);

    if (CheckMouseIn(x, y, width, height) == 1)
    {
        char strTipText[256];

        // 2037 " S D : %d / %d"
        sprintf(strTipText, GlobalText(2037), wShield, wMaxShield);
        pDrawToolTip((int)x - 20, (int)418, strTipText);
    }
}

WideScreen.h

#pragma once

class WideScreen {
public:
    WideScreen();
    ~WideScreen();

    void Init();

    static void CreateScreenVector();
    static float ConvertX(float value);
    static float ConvertY(float value);
    static void OpenFile();
    static int GetScreenWidth();
    static void RenderFrameMenu(DWORD* This);
    static void RenderLifeMana(DWORD* This);
    static void RenderGuageAG(DWORD* This);
    static void RenderGuageSD(DWORD* This);
};

extern WideScreen gWideScreen;



Creditos
Dakosmu Por la Guia

Bon Dia

lokones



🡱 🡳