1 Attachment(s)
Re: Client 1.03P ENG Source(CustomHP-CustomMonster-CustomItems and more)
I was able to fix the HPBar problem by chaging Life and MaxLife from int to float, since GS uses it as float:
GS - User.CPP
Code:
//Custom HPBar mod:
struct PMSG_ATTACKRESULT
{
PBMSG_HEAD h; // C1:DC
BYTE NumberH; // 3
BYTE NumberL; // 4
BYTE DamageH; // 5
BYTE DamageL; // 6
BYTE DamageType; // 7
BYTE btShieldDamageH; // 8
BYTE btShieldDamageL; // 9
float Life; //A
float MaxLife; //E
};
Main.dll - mob_hp_bar.cpp
Code:
void CMob_HPBar::Draw()
{
if (this->MaxHP == 0) return;
int pHP = (int)((this->HP * 100) / this->MaxHP);
if (pHP)
{
MU_DrawGUI(NEWUI_BAR_SWITCH01, (MAX_WIDTH / 2) - 80, 20, 160, 18);
MU_DrawColorButton(NEWUI_BAR_SWITCH02, (MAX_WIDTH / 2) - 75, 25, (150 * pHP) / 100, 8, 0, 0, MU_CreateColor(255, 0, 0, 130));
}
else
{
this->isDraw = false;
}
}
void CMob_HPBar::SetupMob(float Life, float MaxLife, WORD index)
{
if (Life > MaxLife)
{
this->isDraw = false; //something is wrong ^.^
}
this->HP = Life;
this->MaxHP = MaxLife;
this->aIndex = index;
this->isDraw = TRUE;
}
Main.dll - mob_hp_bar.h
Code:
class CMob_HPBar
{
private:
float HP;
float MaxHP;
public:
BOOL isDraw;
WORD aIndex;
CMob_HPBar();
virtual ~CMob_HPBar();
void SetupMob(float Life, float MaxLife, WORD index);
void Draw();
};
I've added the PMSG_ATTACKRESULT on Protocol.cpp, to a better reading:
Code:
#include "StdAfx.h"
#include "Protocol.h"
#include "game_char.h"
#include "mob_hp_bar.h"
#include "mu_utils.h"
pMU_ProtocolCoreEx MU_ProtocolCoreEx;
BYTE PROTOCOLCORE_COPY_LEN = 7;
struct PBMSG_HEAD // Packet - Byte Type
{
public:
void set ( LPBYTE lpBuf, BYTE head, BYTE size) // line : 18
{
lpBuf[0] = 0xC1;
lpBuf[1] = size;
lpBuf[2] = head;
}; // line : 22
void setE ( LPBYTE lpBuf, BYTE head, BYTE size) // line : 25
{
lpBuf[0] = 0xC3;
lpBuf[1] = size;
lpBuf[2] = head;
}; // line : 29
BYTE c;
BYTE size;
BYTE headcode;
};
struct PMSG_ATTACKRESULT
{
PBMSG_HEAD h; // C1:DC
BYTE NumberH; // 3
BYTE NumberL; // 4
BYTE DamageH; // 5
BYTE DamageL; // 6
BYTE DamageType; // 7
BYTE btShieldDamageH; // 8
BYTE btShieldDamageL; // 9
float Life; //A
float MaxLife; //E
};
int __cdecl cMU_ProtocolCore(int index, PBYTE lpMsg, int len, int flags)
{
switch (index)
{
case MU_DAMAGE: //Damage
{
PMSG_ATTACKRESULT * lpAttack = (PMSG_ATTACKRESULT *) lpMsg;
WORD tIndex = ((lpAttack->NumberH << 8) + lpAttack->NumberL) & 0x7FFF;
if (tIndex == *GameIndex) {break;}
if (lpMsg[1] > 10)
{
float Life, MaxLife;
memcpy(&Life, &lpAttack->Life, sizeof(float));
memcpy(&MaxLife, &lpAttack->MaxLife, sizeof(float));
Mob_HP_Bar.SetupMob(Life, MaxLife, tIndex);
break;
}
break;
}
case 0x14: //Destroy viewport chars
{
for (unsigned int i=0; i<lpMsg[3]; ++i)
{
WORD tIndex = (lpMsg[4 + (i*2)] << 8) + lpMsg[5 + (i*2)];
if (tIndex == Mob_HP_Bar.aIndex)
{
Mob_HP_Bar.isDraw = false;
break;
}
}
break;
}
case 0x17: //Killed object
{
WORD tIndex = (lpMsg[3] << 8) + lpMsg[4];
if ((tIndex == Mob_HP_Bar.aIndex) || (tIndex == *GameIndex))
{
Mob_HP_Bar.isDraw = false;
}
break;
}
case 0x1C: //Teleport
{
if (lpMsg[5] == 1)
{
Mob_HP_Bar.isDraw = false;
}
break;
}
case 0xF3:
{
switch(lpMsg[3])
{
case 0x03: //Character selected (join map)
{
Mob_HP_Bar.isDraw = false;
break;
}
case 0x04: //Respawn
{
Mob_HP_Bar.isDraw = false;
break;
}
}
break;
}
}
return MU_ProtocolCoreEx(index, lpMsg, len, flags);
}
void InitProtocol()
{
MU_ProtocolCoreEx = (pMU_ProtocolCoreEx)HookFunction((LPVOID)MU_PROTOCOL_CORE, cMU_ProtocolCore, PROTOCOLCORE_COPY_LEN);
}
Attachment 137506
EDIT:
I've noticed also there is no Damage Info on client side, this is because the hooked GCDamageSend function uses JNP protocol for attack (0xDC) but our client is ENG (0x11), so we need to change it:
Just change this on user.cpp (Server side)
Code:
PHeadSetB((LPBYTE)&pResult, 0x11, sizeof(pResult));
And just change it on Protocol.h (Client side)
Code:
#define MU_DAMAGE 0x11
http://img534.imageshack.us/img534/2404/l49k.png
Now my request:
1 - Some one knows the offsets for current selected monsters? Then we can improve the HPMobar to show only selected mobs.
2 - How to get rid of this fog on Cash Shop?
http://i.imgur.com/ii1lQ4y.png
Re: Client 1.03P ENG Source(CustomHP-CustomMonster-CustomItems and more)
Re: Client 1.03P ENG Source(CustomHP-CustomMonster-CustomItems and more)
Quote:
Originally Posted by
afonsolage
I was able to fix the HPBar problem by chaging Life and MaxLife from int to float, since GS uses it as float:
GS - User.CPP
Code:
//Custom HPBar mod:
struct PMSG_ATTACKRESULT
{
PBMSG_HEAD h; // C1:DC
BYTE NumberH; // 3
BYTE NumberL; // 4
BYTE DamageH; // 5
BYTE DamageL; // 6
BYTE DamageType; // 7
BYTE btShieldDamageH; // 8
BYTE btShieldDamageL; // 9
float Life; //A
float MaxLife; //E
};
Main.dll - mob_hp_bar.cpp
Code:
void CMob_HPBar::Draw()
{
if (this->MaxHP == 0) return;
int pHP = (int)((this->HP * 100) / this->MaxHP);
if (pHP)
{
MU_DrawGUI(NEWUI_BAR_SWITCH01, (MAX_WIDTH / 2) - 80, 20, 160, 18);
MU_DrawColorButton(NEWUI_BAR_SWITCH02, (MAX_WIDTH / 2) - 75, 25, (150 * pHP) / 100, 8, 0, 0, MU_CreateColor(255, 0, 0, 130));
}
else
{
this->isDraw = false;
}
}
void CMob_HPBar::SetupMob(float Life, float MaxLife, WORD index)
{
if (Life > MaxLife)
{
this->isDraw = false; //something is wrong ^.^
}
this->HP = Life;
this->MaxHP = MaxLife;
this->aIndex = index;
this->isDraw = TRUE;
}
Main.dll - mob_hp_bar.h
Code:
class CMob_HPBar
{
private:
float HP;
float MaxHP;
public:
BOOL isDraw;
WORD aIndex;
CMob_HPBar();
virtual ~CMob_HPBar();
void SetupMob(float Life, float MaxLife, WORD index);
void Draw();
};
I've added the PMSG_ATTACKRESULT on Protocol.cpp, to a better reading:
Code:
#include "StdAfx.h"
#include "Protocol.h"
#include "game_char.h"
#include "mob_hp_bar.h"
#include "mu_utils.h"
pMU_ProtocolCoreEx MU_ProtocolCoreEx;
BYTE PROTOCOLCORE_COPY_LEN = 7;
struct PBMSG_HEAD // Packet - Byte Type
{
public:
void set ( LPBYTE lpBuf, BYTE head, BYTE size) // line : 18
{
lpBuf[0] = 0xC1;
lpBuf[1] = size;
lpBuf[2] = head;
}; // line : 22
void setE ( LPBYTE lpBuf, BYTE head, BYTE size) // line : 25
{
lpBuf[0] = 0xC3;
lpBuf[1] = size;
lpBuf[2] = head;
}; // line : 29
BYTE c;
BYTE size;
BYTE headcode;
};
struct PMSG_ATTACKRESULT
{
PBMSG_HEAD h; // C1:DC
BYTE NumberH; // 3
BYTE NumberL; // 4
BYTE DamageH; // 5
BYTE DamageL; // 6
BYTE DamageType; // 7
BYTE btShieldDamageH; // 8
BYTE btShieldDamageL; // 9
float Life; //A
float MaxLife; //E
};
int __cdecl cMU_ProtocolCore(int index, PBYTE lpMsg, int len, int flags)
{
switch (index)
{
case MU_DAMAGE: //Damage
{
PMSG_ATTACKRESULT * lpAttack = (PMSG_ATTACKRESULT *) lpMsg;
WORD tIndex = ((lpAttack->NumberH << 8) + lpAttack->NumberL) & 0x7FFF;
if (tIndex == *GameIndex) {break;}
if (lpMsg[1] > 10)
{
float Life, MaxLife;
memcpy(&Life, &lpAttack->Life, sizeof(float));
memcpy(&MaxLife, &lpAttack->MaxLife, sizeof(float));
Mob_HP_Bar.SetupMob(Life, MaxLife, tIndex);
break;
}
break;
}
case 0x14: //Destroy viewport chars
{
for (unsigned int i=0; i<lpMsg[3]; ++i)
{
WORD tIndex = (lpMsg[4 + (i*2)] << 8) + lpMsg[5 + (i*2)];
if (tIndex == Mob_HP_Bar.aIndex)
{
Mob_HP_Bar.isDraw = false;
break;
}
}
break;
}
case 0x17: //Killed object
{
WORD tIndex = (lpMsg[3] << 8) + lpMsg[4];
if ((tIndex == Mob_HP_Bar.aIndex) || (tIndex == *GameIndex))
{
Mob_HP_Bar.isDraw = false;
}
break;
}
case 0x1C: //Teleport
{
if (lpMsg[5] == 1)
{
Mob_HP_Bar.isDraw = false;
}
break;
}
case 0xF3:
{
switch(lpMsg[3])
{
case 0x03: //Character selected (join map)
{
Mob_HP_Bar.isDraw = false;
break;
}
case 0x04: //Respawn
{
Mob_HP_Bar.isDraw = false;
break;
}
}
break;
}
}
return MU_ProtocolCoreEx(index, lpMsg, len, flags);
}
void InitProtocol()
{
MU_ProtocolCoreEx = (pMU_ProtocolCoreEx)HookFunction((LPVOID)MU_PROTOCOL_CORE, cMU_ProtocolCore, PROTOCOLCORE_COPY_LEN);
}
Attachment 137506
EDIT:
I've noticed also there is no Damage Info on client side, this is because the GCDamageSend function was hooked and after it, it just finish, didnt continue what GCDamageSend should do.
Dont know if there is a solution for this, but i've done as follows:
Declare the original GCDamageSend function on Prodef.h:
Code:
#define lpGCDamageSend ((void(*)(int aIndex, int TargetIndex, int AttackDamage, int MSBFlag, int MSBDamage, int iShieldDamage)) 0x00455CB0)
And just call this function at the end of our new function - User.cpp
Code:
lpGCDamageSend(aIndex, TargetIndex, AttackDamage, MSBFlag, MSBDamage, iShieldDamage);
http://img534.imageshack.us/img534/2404/l49k.png
Now my request:
1 - Some one knows the offsets for current selected monsters? Then we can improve the HPMobar to show only selected mobs.
2 - How to get rid of this fog on Cash Shop?
http://i.imgur.com/ii1lQ4y.png
WOOOOW, Work 10000% Very Thanks :D
It has a Changing the place where the bar is?
Re: Client 1.03P ENG Source(CustomHP-CustomMonster-CustomItems and more)
Quote:
Originally Posted by
VeltonD
WOOOOW, Work 10000% Very Thanks :D
It has a Changing the place where the bar is?
I was making some tests but I tough it was back on right place :P:. Isn't?
Re: Client 1.03P ENG Source(CustomHP-CustomMonster-CustomItems and more)
Alfonso, could you share a full way to add this to julia's source? Added as in first post, and modded like you said, but still getting lots of errors when compiling :|.
Maybe, just maybe, you can enlighten me and help me add this mod ^^; driving me nuts :|
Re: Client 1.03P ENG Source(CustomHP-CustomMonster-CustomItems and more)
Quote:
Originally Posted by
afonsolage
I was able to fix the HPBar problem by chaging Life and MaxLife from int to float, since GS uses it as float:
GS - User.CPP
Code:
//Custom HPBar mod:
struct PMSG_ATTACKRESULT
{
PBMSG_HEAD h; // C1:DC
BYTE NumberH; // 3
BYTE NumberL; // 4
BYTE DamageH; // 5
BYTE DamageL; // 6
BYTE DamageType; // 7
BYTE btShieldDamageH; // 8
BYTE btShieldDamageL; // 9
float Life; //A
float MaxLife; //E
};
Main.dll - mob_hp_bar.cpp
Code:
void CMob_HPBar::Draw()
{
if (this->MaxHP == 0) return;
int pHP = (int)((this->HP * 100) / this->MaxHP);
if (pHP)
{
MU_DrawGUI(NEWUI_BAR_SWITCH01, (MAX_WIDTH / 2) - 80, 20, 160, 18);
MU_DrawColorButton(NEWUI_BAR_SWITCH02, (MAX_WIDTH / 2) - 75, 25, (150 * pHP) / 100, 8, 0, 0, MU_CreateColor(255, 0, 0, 130));
}
else
{
this->isDraw = false;
}
}
void CMob_HPBar::SetupMob(float Life, float MaxLife, WORD index)
{
if (Life > MaxLife)
{
this->isDraw = false; //something is wrong ^.^
}
this->HP = Life;
this->MaxHP = MaxLife;
this->aIndex = index;
this->isDraw = TRUE;
}
Main.dll - mob_hp_bar.h
Code:
class CMob_HPBar
{
private:
float HP;
float MaxHP;
public:
BOOL isDraw;
WORD aIndex;
CMob_HPBar();
virtual ~CMob_HPBar();
void SetupMob(float Life, float MaxLife, WORD index);
void Draw();
};
I've added the PMSG_ATTACKRESULT on Protocol.cpp, to a better reading:
Code:
#include "StdAfx.h"
#include "Protocol.h"
#include "game_char.h"
#include "mob_hp_bar.h"
#include "mu_utils.h"
pMU_ProtocolCoreEx MU_ProtocolCoreEx;
BYTE PROTOCOLCORE_COPY_LEN = 7;
struct PBMSG_HEAD // Packet - Byte Type
{
public:
void set ( LPBYTE lpBuf, BYTE head, BYTE size) // line : 18
{
lpBuf[0] = 0xC1;
lpBuf[1] = size;
lpBuf[2] = head;
}; // line : 22
void setE ( LPBYTE lpBuf, BYTE head, BYTE size) // line : 25
{
lpBuf[0] = 0xC3;
lpBuf[1] = size;
lpBuf[2] = head;
}; // line : 29
BYTE c;
BYTE size;
BYTE headcode;
};
struct PMSG_ATTACKRESULT
{
PBMSG_HEAD h; // C1:DC
BYTE NumberH; // 3
BYTE NumberL; // 4
BYTE DamageH; // 5
BYTE DamageL; // 6
BYTE DamageType; // 7
BYTE btShieldDamageH; // 8
BYTE btShieldDamageL; // 9
float Life; //A
float MaxLife; //E
};
int __cdecl cMU_ProtocolCore(int index, PBYTE lpMsg, int len, int flags)
{
switch (index)
{
case MU_DAMAGE: //Damage
{
PMSG_ATTACKRESULT * lpAttack = (PMSG_ATTACKRESULT *) lpMsg;
WORD tIndex = ((lpAttack->NumberH << 8) + lpAttack->NumberL) & 0x7FFF;
if (tIndex == *GameIndex) {break;}
if (lpMsg[1] > 10)
{
float Life, MaxLife;
memcpy(&Life, &lpAttack->Life, sizeof(float));
memcpy(&MaxLife, &lpAttack->MaxLife, sizeof(float));
Mob_HP_Bar.SetupMob(Life, MaxLife, tIndex);
break;
}
break;
}
case 0x14: //Destroy viewport chars
{
for (unsigned int i=0; i<lpMsg[3]; ++i)
{
WORD tIndex = (lpMsg[4 + (i*2)] << 8) + lpMsg[5 + (i*2)];
if (tIndex == Mob_HP_Bar.aIndex)
{
Mob_HP_Bar.isDraw = false;
break;
}
}
break;
}
case 0x17: //Killed object
{
WORD tIndex = (lpMsg[3] << 8) + lpMsg[4];
if ((tIndex == Mob_HP_Bar.aIndex) || (tIndex == *GameIndex))
{
Mob_HP_Bar.isDraw = false;
}
break;
}
case 0x1C: //Teleport
{
if (lpMsg[5] == 1)
{
Mob_HP_Bar.isDraw = false;
}
break;
}
case 0xF3:
{
switch(lpMsg[3])
{
case 0x03: //Character selected (join map)
{
Mob_HP_Bar.isDraw = false;
break;
}
case 0x04: //Respawn
{
Mob_HP_Bar.isDraw = false;
break;
}
}
break;
}
}
return MU_ProtocolCoreEx(index, lpMsg, len, flags);
}
void InitProtocol()
{
MU_ProtocolCoreEx = (pMU_ProtocolCoreEx)HookFunction((LPVOID)MU_PROTOCOL_CORE, cMU_ProtocolCore, PROTOCOLCORE_COPY_LEN);
}
Attachment 137506
EDIT:
I've noticed also there is no Damage Info on client side, this is because the GCDamageSend function was hooked and after it, it just finish, didnt continue what GCDamageSend should do.
Dont know if there is a solution for this, but i've done as follows:
Declare the original GCDamageSend function on Prodef.h:
Code:
#define lpGCDamageSend ((void(*)(int aIndex, int TargetIndex, int AttackDamage, int MSBFlag, int MSBDamage, int iShieldDamage)) 0x00455CB0)
And just call this function at the end of our new function - User.cpp
Code:
lpGCDamageSend(aIndex, TargetIndex, AttackDamage, MSBFlag, MSBDamage, iShieldDamage);
http://img534.imageshack.us/img534/2404/l49k.png
Now my request:
1 - Some one knows the offsets for current selected monsters? Then we can improve the HPMobar to show only selected mobs.
2 - How to get rid of this fog on Cash Shop?
http://i.imgur.com/ii1lQ4y.png
Great, shows the damage, but the hp bar is still seen bad ..
Re: Client 1.03P ENG Source(CustomHP-CustomMonster-CustomItems and more)
For me now works everything great, but it will be nice to recode hp bar as it is in ex702, that over each monster will show hp bar. But I have no idea how to do it cause I dont have enough knowledge for client-side coding.
Re: Client 1.03P ENG Source(CustomHP-CustomMonster-CustomItems and more)
Quote:
Originally Posted by
jacubb
For me now works everything great, but it will be nice to recode hp bar as it is in ex702, that over each monster will show hp bar. But I have no idea how to do it cause I dont have enough knowledge for client-side coding.
I second this + Is it possible for someone, to ADD or create something similar like the Autoclicker(AutoHelper) from season 6 episode 3 client, to Julia Files, season 4 files main 1.3.11 ??? Is this possible?
Re: Client 1.03P ENG Source(CustomHP-CustomMonster-CustomItems and more)
Quote:
Originally Posted by
Offspring
I second this + Is it possible for someone, to ADD or create something similar like the Autoclicker(AutoHelper) from season 6 episode 3 client, to Julia Files, season 4 files main 1.3.11 ??? Is this possible?
Yes, its possible, but I think no one here is trying to do it, because this needs a lot of work. And the new MuHelper make the servers even more Easy, so a server hard with MuHelper isnt very hard, because you can hunt anything AFK, which makes players stop hunting and itens prices get low.
I have a Ex702 server from IGCN and it's very nice, but I cant make a very hard server, because this i'll open another S4.6.
Of course, this is MY OPINION and how I see MuHelper.
Quote:
Originally Posted by
ianvalls90
Alfonso, could you share a full way to add this to julia's source? Added as in first post, and modded like you said, but still getting lots of errors when compiling :|.
Maybe, just maybe, you can enlighten me and help me add this mod ^^; driving me nuts :|
What erros do you got? On Main.dll or on WzAg.dll?
Re: Client 1.03P ENG Source(CustomHP-CustomMonster-CustomItems and more)
Quote:
Originally Posted by
afonsolage
Yes, its possible, but I think no one here is trying to do it, because this needs a lot of work. And the new MuHelper make the servers even more Easy, so a server hard with MuHelper isnt very hard, because you can hunt anything AFK, which makes players stop hunting and itens prices get low.
I have a Ex702 server from IGCN and it's very nice, but I cant make a very hard server, because this i'll open another S4.6.
Of course, this is MY OPINION and how I see MuHelper.
What erros do you got? On Main.dll or on WzAg.dll?
not 100% sure now, im not at home...but got a few errors on user.cpp while compiling WzAg.dll :/
Re: Client 1.03P ENG Source(CustomHP-CustomMonster-CustomItems and more)
Quote:
Originally Posted by
ianvalls90
not 100% sure now, im not at home...but got a few errors on user.cpp while compiling WzAg.dll :/
Add all them here: Pastebin.com - #1 paste tool since 2002!. Then I may check for you.
Re: Client 1.03P ENG Source(CustomHP-CustomMonster-CustomItems and more)
Quote:
Originally Posted by
afonsolage
Im not at home untill tuesday afternoon (gmt-3).....as soon as Im there, I'll check the errors and paste there.
Re: Client 1.03P ENG Source(CustomHP-CustomMonster-CustomItems and more)
Another lilitle change:
Instead of do it like I refer here:
Quote:
Declare the original GCDamageSend function on Prodef.h:
Code:
#define lpGCDamageSend ((void(*)(int aIndex, int TargetIndex, int AttackDamage, int MSBFlag, int MSBDamage, int iShieldDamage)) 0x00455CB0)
And just call this function at the end of our new function - User.cpp
Code:
lpGCDamageSend(aIndex, TargetIndex, AttackDamage, MSBFlag, MSBDamage, iShieldDamage);
Just change this on user.cpp (Server side)
Code:
PHeadSetB((LPBYTE)&pResult, 0x11, sizeof(pResult));
And just change it on Protocol.h (Client side)
Code:
#define MU_DAMAGE 0x11
This change is because i've notice the client is ENG but this solution (0xDC) is the JNP protocol for Attack, since we use ENG protocol we need to change it to 0x11...
And there is no need to call GCDamageSend again at the end of user.cpp hook because the hooked function do every thing that original GCDamageSend does.
Well, I'll update my frist post with those infos :P:
EDIT:
Also I let for guys who are developing on this version a tip that may help a lot (for those who dont know ofc). It's a Console to have a better output and debugging more easy:
http://img833.imageshack.us/img833/7963/xzt.png
To use it, just add those two files in your project:
Console.h:
Code:
#ifndef CONSOLE_H
#define CONSOLE_H
#pragma once
class Console
{
public:
void Init();
void Log(char* format, ...);
};
extern Console console;
#endif
Console.cpp
Code:
#include "stdafx.h"
#include "Console.h"
Console console;
void Console::Init()
{
AllocConsole();
SetConsoleTitle("Main - Debug Console");
console.Log("Debug Console started.");
}
void Console::Log(char* format, ...)
{
char message[1024];
SYSTEMTIME t;
GetLocalTime(&t);
DWORD dwBytesWritten;
HANDLE Handle = GetStdHandle(STD_OUTPUT_HANDLE);
va_list pArguments;
va_start(pArguments, format);
vsprintf_s(message, format, pArguments);
//CheckProcent(Message); // "%" Bug Fix
va_end(pArguments);
char currdate[11] = {0};
char outputmsg[2048];
sprintf_s(currdate, "(%02d:%02d:%02d)", t.wHour, t.wMinute, t.wSecond);
sprintf_s(outputmsg,"%s %s\n", currdate,message);
WriteFile(Handle, outputmsg, strlen(outputmsg), &dwBytesWritten, NULL);
SetConsoleTextAttribute(Handle, FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE);
}
Now lets init the console on Main.cpp, add the following include:
Code:
#ifdef NDEBUG
#include "Console.h"
#endif
And call the init function on Main.cpp init():
Code:
#ifdef NDEBUG
console.Init();
#endif
So, if you need to add something on console, just call the Log function, like this example which prints the frist three bytes from received packets on Protocol.cpp (cMu_ProtocolCore):
Code:
#ifdef NDEBUG
console.Log("Received protocol: %02X %02X %02X", lpMsg[0], lpMsg[1], lpMsg[2]);
#endif
Also note i'm using compiler directives ifdef to check if we are on debug mode, so when I need to ship this DLL, just set DEBUG off and the console will not be compiled and not shown.
I got the IA Julia console code and made it fit on this DLL, so give the credits to IA Julia's Console developer :P:
Re: Client 1.03P ENG Source(CustomHP-CustomMonster-CustomItems and more)
also in PROTOCOLCORE_COPY_LEN we are using 7 but it is the same at JPN and in ENG should be 10 (i think) im workin in gs .90 source i added hp bar and works 100% in JPN main 1.03k but not work in ENG.
Code:
#ifdef __1_03_11JPN
BYTE PROTOCOLCORE_COPY_LEN = 7;
#endif
#ifdef __1_03_28ENG
BYTE PROTOCOLCORE_COPY_LEN = 10;
#endif
Re: Client 1.03P ENG Source(CustomHP-CustomMonster-CustomItems and more)
Quote:
Originally Posted by
ashlay
also in PROTOCOLCORE_COPY_LEN we are using 7 but it is the same at JPN and in ENG should be 10 (i think) im workin in gs .90 source i added hp bar and works 100% in JPN main 1.03k but not work in ENG.
Code:
#ifdef __1_03_11JPN
BYTE PROTOCOLCORE_COPY_LEN = 7;
#endif
#ifdef __1_03_28ENG
BYTE PROTOCOLCORE_COPY_LEN = 10;
#endif
the main.exe version: 1.03.28 ENG is more advanced that: 1.03.11 JPN, both are: Season 4.6, but.. this ENG Protocol main is more new that: 1.03.11, is different in some parts of code too. maybe: PROTOCOLCORE_COPY_LEN for the case of a: main.exe 1.03P isn't: 10, maybe is other number. I think