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!

[Development] MuEmu draw imagem 1.05D

Newbie Spellweaver
Joined
Jul 5, 2014
Messages
7
Reaction score
0

hello, any member got fixed an image drawing in the muemu season 4? I already reviewed the offsets and they are correct but I can not draw a timebar, in the season 6 version it will go normally!

Interface.h

Code:
Code:
enum ObjectID
{
        eTIME,
};


struct InterfaceObject
{
    DWORD    ModelID;
    float    Width;
    float    Height;
    float    X;
    float    Y;
    float    MaxX;
    float    MaxY;
    DWORD    EventTick;
    bool    OnClick;
    bool    OnShow;
    BYTE    Attribute;
};


class Interface
{
public:


    void        Load();
    static void    Work();
    static void    LoadImages();
    static void LoadModels();
    void        BindObject(short ObjectID, DWORD ModelID, float Width, float Height, float X, float Y);
    bool        CheckWindow(int WindowID);
    void        DrawTime();
    int        DrawFormat(DWORD Color, int PosX, int PosY, int Width, int Align, LPCSTR Text, ...);
    void        DrawGUI(short ObjectID, float PosX, float PosY);


    InterfaceObject Data[MAX_OBJECT];
private:
    
};
extern Interface gInterface;


Interfcae.cpp

Code:
void Interface::Load()
{
       this->BindObject(eTIME, 0x787E, 131, 70, -10, 359); 
    this->Data[eTIME].OnShow = true;
    // ----
    SetOp((LPVOID)oDrawInterface_Call, this->Work, ASM::CALL);
    SetOp((LPVOID)oLoadSomeForm_Call, this->LoadImages, ASM::CALL);
    SetOp((LPVOID)0x005DBC22, this->LoadModels, ASM::CALL);
    
}


void Interface::Work()
{
    gInterface.DrawTime();
    ReconnectMainProc();
    pDrawInterface();
}


void Interface::LoadImages()
{


    pLoadImage("Custom\\Interface\\TimeBar.tga", 0x787E, 0x2601, 0x2901, 1, 0);
    // ----
    pLoadSomeForm();
}


void Interface::LoadModels()
{
    pInitModelData2();
}


void Interface::BindObject(short MonsterID, DWORD ModelID, float Width, float Height, float X, float Y)
{
    this->Data[MonsterID].EventTick    = 0;
    this->Data[MonsterID].OnClick    = false;
    this->Data[MonsterID].OnShow    = false;
    this->Data[MonsterID].ModelID    = ModelID;
    this->Data[MonsterID].Width        = Width;
    this->Data[MonsterID].Height    = Height;
    this->Data[MonsterID].X            = X;
    this->Data[MonsterID].Y            = Y;
    this->Data[MonsterID].MaxX        = X + Width;
    this->Data[MonsterID].MaxY        = Y + Height;
    this->Data[MonsterID].Attribute    = 0;
}


bool Interface::CheckWindow(int WindowID)
{
    return pCheckWindow(pWindowThis(), WindowID);
}


void Interface::DrawTime()
{
    if( !this->Data[eTIME].OnShow )
    {
        return;
    }
    // ----
    /*if( this->CheckWindow(ObjWindow::ChatWindow) || this->CheckWindow(ObjWindow::CashShop)
    || this->CheckWindow(ObjWindow::FullMap) || this->CheckWindow(ObjWindow::SkillTree)
    || this->CheckWindow(ObjWindow::MoveList) || gObjUser.m_MapNumber == 34 || gObjUser.m_MapNumber == 30 )*/
    if(this->CheckWindow(ObjWindow::CashShop)|| this->CheckWindow(ObjWindow::FullMap) || this->CheckWindow(ObjWindow::ChatWindow) || this->CheckWindow(ObjWindow::SkillTree)
        || this->CheckWindow(ObjWindow::MoveList) || gObjUser.m_MapNumber == 34 || gObjUser.m_MapNumber == 30 )
    {
        return;
    }
    // ----
    //this->DrawGUI(eTIME, 0, -3);




      this->DrawGUI(eTIME, this->Data[eTIME].X, this->Data[eTIME].Y);
    // -----
    time_t TimeServer, TimeLocal;
    struct tm * ServerT, * LocalT;
    time(&TimeServer);
    time(&TimeLocal);
    // ----
    ServerT = gmtime(&TimeServer);
    // ----
    char ServerTimeName[25] = "Server:";
    char ServerTime[30];


    sprintf(ServerTime, "%2d:%02d:%02d", (ServerT->tm_hour)%24, ServerT->tm_min, ServerT->tm_sec);
    // -----
    LocalT = localtime(&TimeLocal); 
    // -----
    char LocalTimeName[25] = "Local:";
    char LocalTime[30];
    sprintf(LocalTime, "%2d:%02d:%02d", LocalT->tm_hour, LocalT->tm_min, LocalT->tm_sec);
    // -----
    this->DrawFormat(eGold, 5, 391, 50, 1, ServerTimeName);
    this->DrawFormat(eWhite, 55, 391, 100, 1, ServerTime);
    // ----
    this->DrawFormat(eGold, 5, 413, 50, 1, LocalTimeName);
    this->DrawFormat(eWhite, 55, 413, 100, 1, LocalTime);
}


int Interface::DrawFormat(DWORD Color, int PosX, int PosY, int Width, int Align, LPCSTR Text, ...)
{
    char Buff[2048];
    int BuffLen    = sizeof(Buff)-1;
    ZeroMemory(Buff, BuffLen);
    
    va_list args;
    va_start(args, Text);
    int Len    = vsprintf_s(Buff, BuffLen, Text, args);
    va_end(args);
    
    int LineCount = 0;
    
    char * Line = strtok(Buff, "\n");
    
    while( Line != NULL )
    {
        pDrawColorText(Line, PosX, PosY, Width, 0, Color, 0, Align);
        PosY += 10;
        Line = strtok(NULL, "\n");
    }
    
    return PosY;
}


void Interface::DrawGUI(short ObjectID, float PosX, float PosY)
{
    if( this->Data[ObjectID].X == -1 || this->Data[ObjectID].Y == -1 )
    {
        this->Data[ObjectID].X        = PosX;
        this->Data[ObjectID].Y        = PosY;
        this->Data[ObjectID].MaxX    = PosX + this->Data[ObjectID].Width;
        this->Data[ObjectID].MaxY    = PosY + this->Data[ObjectID].Height;
    }


    pDrawGUI(this->Data[ObjectID].ModelID, PosX, PosY,this->Data[ObjectID].Width, this->Data[ObjectID].Height);
}


OffSets

Code:
#define pDrawInterface            ((void(__cdecl*)()) 0x00719FEB)
#define oDrawInterface_Call         0x00719F38
#define pLoadImage                ((int(__cdecl*)(char * Folder, int Code, int Arg3, int Arg4, int Arg5, int Arg6)) 0x006A92BE) //OK
#define pLoadSomeForm            ((void(__cdecl*)()) 0x006B55DE) //OK
#define oLoadSomeForm_Call        0x006B5280 //OK
#define pDrawGUI                             ((void(__cdecl*)(DWORD, float, float, float, float)) 0x006E26E3)
#define pWindowThis                ((LPVOID(*)()) 0x750101)
#define pCheckWindow            ((bool(__thiscall*)(LPVOID This, int Code)) 0x007499D7)
#define pInitModelData2            ((void(__cdecl*)()) 0x005D0B05)

Print no result TimeBar

boris160 - [Development] MuEmu draw imagem 1.05D - RaGEZONE Forums
 
Junior Spellweaver
Joined
Aug 27, 2008
Messages
183
Reaction score
133
Try this :) My Time Bar
If not work modify 417.0f modifier to 317.0f


Code:
if ( this->CheckWindow(ObjWindow::SkillTree)
        || this->CheckWindow(ObjWindow::MoveList) || this->CheckWindow(ObjWindow::ChatWindow))
    {
        return;
    }
    // ----
    this->DrawGUI(eTIME, 0.0f, 411.0f);
    // -----
    time_t TimeLocal;
    struct tm * LocalT;
    time(&TimeLocal);
    LocalT = localtime(&TimeLocal);
    char LocalTime[30];
    sprintf(LocalTime, "%2d:%02d:%02d", LocalT->tm_hour, LocalT->tm_min, LocalT->tm_sec);
    this->DrawFormat(eWhite, 25.0f, 417.0f, 100.0f, 1.0f, LocalTime);

Screen on 1.03.11 Eng main:
boris160 - [Development] MuEmu draw imagem 1.05D - RaGEZONE Forums
 
Last edited by a moderator:
Newbie Spellweaver
Joined
Jul 5, 2014
Messages
7
Reaction score
0
Try this :) My Time Bar
If not work modify 417.0f modifier to 317.0f


Code:
if ( this->CheckWindow(ObjWindow::SkillTree)
        || this->CheckWindow(ObjWindow::MoveList) || this->CheckWindow(ObjWindow::ChatWindow))
    {
        return;
    }
    // ----
    this->DrawGUI(eTIME, 0.0f, 411.0f);
    // -----
    time_t TimeLocal;
    struct tm * LocalT;
    time(&TimeLocal);
    LocalT = localtime(&TimeLocal);
    char LocalTime[30];
    sprintf(LocalTime, "%2d:%02d:%02d", LocalT->tm_hour, LocalT->tm_min, LocalT->tm_sec);
    this->DrawFormat(eWhite, 25.0f, 417.0f, 100.0f, 1.0f, LocalTime);

Screen on 1.03.11 Eng main:
boris160 - [Development] MuEmu draw imagem 1.05D - RaGEZONE Forums

without result, my friend, is there no wrong offset?
 
Back
Top