Re: Client 1.03P ENG Source(CustomHP-CustomMonster-CustomItems and more)
Quote:
Originally Posted by
afonsolage
By mob I mean players also :P. This fix is just to when you spread a area skill, like Evil Spirit, the HPBar dont show random mobs HP.
thx, but how disable hp bar for Players?
i try do this but can't checking who target mob or player....
Re: Client 1.03P ENG Source(CustomHP-CustomMonster-CustomItems and more)
Quote:
Originally Posted by
ATJIAHT
thx, but how disable hp bar for Players?
i try do this but can't checking who target mob or player....
You have to do it on server side. You need to add a if on GCDamageSend(), replace this:
Code:
pResult.Life = gTarg->Life;
pResult.MaxLife = gTarg->MaxLife + gTarg->AddLife;
to this:
Code:
if (gTarg->Type == OBJ_MONSTER)
{
pResult.Life = gTarg->Life;
pResult.MaxLife = gTarg->MaxLife;
}
Re: Client 1.03P ENG Source(CustomHP-CustomMonster-CustomItems and more)
edited, got it working =).
thanks for the help guys.
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
ATJIAHT
Whoa, that's a nice bug with life display XD. What are you trying to kill ? so I try it myself and let you know if same error happens here, on same mob.
Re: Client 1.03P ENG Source(CustomHP-CustomMonster-CustomItems and more)
i trying kill Player :D
but i need disable hp bar in PvP :)
i solved this. Hp Bar only for Monsters.
need replace
Quote:
if(gTarg->Type == OBJECT_USER)
{
DataSend(TargetIndex, (LPBYTE)&pResult, pResult.h.size);
}
for this
Quote:
if(gTarg->Type == OBJECT_USER)
{
lpGCDamageSend(aIndex, TargetIndex, AttackDamage, MSBFlag, MSBDamage, iShieldDamage);
}
and added in Prodef.h
Quote:
#define lpGCDamageSend ((void(*)(int aIndex, int TargetIndex, int AttackDamage, int MSBFlag, int MSBDamage, int iShieldDamage)) 0x00455CB0)
perhaps this is a bad solution but it works :blushing:
Re: Client 1.03P ENG Source(CustomHP-CustomMonster-CustomItems and more)
Quote:
Originally Posted by
afonsolage
More updates on this awesome topic :P:
http://img59.imageshack.us/img59/6383/q5j1.png
I'll try to add a Step-by-step of how to add this on HPBar. All those configurations relay on client side:
1 - On Interface.h, add this right bellow "#define MU_CDC_SETTEXTCOLOR 0x00420178"
Code:
#define MU_CDC_SETBACKGROUNDCOLOR 0x004201DA "typedef DWORD(__thiscall *pCDCSetTextColor)"
2 - Still on Interface.h, add this right bellow "typedef DWORD(__thiscall *pCDCSetTextColor)"
Code:
typedef DWORD(__thiscall *pCDCSetBackgroundColor)(LPVOID This, BYTE r, BYTE g, BYTE b, BYTE h);
3 - The last change on Interface.h is to add this right bellow "void MU_SetColor(BYTE r, BYTE g, BYTE b, BYTE h);"
Code:
void MU_SetBGColor(BYTE r, BYTE g, BYTE b, BYTE h);
4 - Now lets move to Interface.cpp and add this right bellow "pCDCSetTextColor MU_SetTextColor"
Code:
pCDCSetBackgroundColor MU_SetBackgroundColor = (pCDCSetBackgroundColor)MU_CDC_SETBACKGROUNDCOLOR;
5 - On Interface.cpp, add this function right bellow the function "MU_SetColor"
Code:
void MU_SetBGColor(BYTE r, BYTE g, BYTE b, BYTE h)
{
MU_SetBackgroundColor(CDC_This(), r, g, b, h);
}
6 - Ok, so lets finally add the code which prints those values. On mob_hp_bar.cpp, change the CMob_HPBar::Draw() to this:
Code:
void CMob_HPBar::Draw()
{
if (this->MaxHP == 0) return;
float pHP = (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, 150));
MU_SetColor(0xFF, 0xFF, 0xFF, 255);
MU_SetBGColor(0, 0, 0, 0);
char msg[100];
sprintf(msg, "%d / %d", (int)this->HP, (int)this->MaxHP);
MU_OutText(300, 24, msg);
}
else
{
this->isDraw = false;
}
}
So, thats it. Maybe you need to play with X and Y coords on MU_OutText if you have changed your HPBar position.
Lets keep this work guys!
EDIT:
Also if you want to HPBar to be shown only when there is a Mob selected (with mouse over it), then change the if on cDrawInterface() function at file interface.cpp to this:
Code:
if (Mob_HP_Bar.isDraw && (*(LPBYTE)0x8C8674) != 0xFF)
Error "chain" in this part:
Quote:
pCDCSetBackgroundColor MU_SetBackgroundColor = (pCDCSetBackgroundColor)MU_CDC_SETBACKGROUNDCOLOR;
How to fix it? I did everything
Re: Client 1.03P ENG Source(CustomHP-CustomMonster-CustomItems and more)
Quote:
Originally Posted by
Mila
Error "chain" in this part:
How to fix it? I did everything
delete in Interface.h
Quote:
#define MU_CDC_SETBACKGROUNDCOLOR 0x004201DA "typedef DWORD(__thiscall *pCDCSetTextColor)"
Re: Client 1.03P ENG Source(CustomHP-CustomMonster-CustomItems and more)
Quote:
Originally Posted by
afonsolage
You have to do it on server side. You need to add a if on GCDamageSend(), replace this:
Code:
pResult.Life = gTarg->Life;
pResult.MaxLife = gTarg->MaxLife;
to this:
Code:
if (lpTarget->Type == OBJ_MONSTER)
{
pResult.Life = gTarg->Life;
pResult.MaxLife = gTarg->MaxLife;
}
Trying to add this, got 3 errors, solved 1 by changing OBJ_MONSTER to OBJECT_MONSTER
2 errors still there, first:
Code:
error C2065: 'lpTarget' : identificador no declarado File: \User.cpp Line:804 Column:1
second:
Code:
error C2227: el operando izquierdo de '->Type' debe señalar al tipo class/struct/union/generic File: \User.cpp Line:804 Column:1
Any clues? My guess, you missed to post the declaration of "lpTarget"...or maybe it's called something else :|
The second error I don't see a cause for this :|. Maybe I skipped something xD.
Quote:
Originally Posted by
ATJIAHT
i trying kill Player :D
but i need disable hp bar in PvP :)
The fix we're talking about right above, is about this, did you try to make it work ??...
Re: Client 1.03P ENG Source(CustomHP-CustomMonster-CustomItems and more)
Quote:
Originally Posted by
ATJIAHT
delete in Interface.h
I tried but now not show the HP bar...
I use 1.03O Main, perhaps offsets errors...
Re: Client 1.03P ENG Source(CustomHP-CustomMonster-CustomItems and more)
Quote:
Originally Posted by
ianvalls90
Trying to add this, got 3 errors, solved 1 by changing OBJ_MONSTER to OBJECT_MONSTER
2 errors still there, first:
Code:
error C2065: 'lpTarget' : identificador no declarado File: \User.cpp Line:804 Column:1
second:
Code:
error C2227: el operando izquierdo de '->Type' debe señalar al tipo class/struct/union/generic File: \User.cpp Line:804 Column:1
Any clues? My guess, you missed to post the declaration of "lpTarget"...or maybe it's called something else :|
The second error I don't see a cause for this :|. Maybe I skipped something xD.
The fix we're talking about right above, is about this, did you try to make it work ??...
change lpTarget to gTarg.... but it don't work for me.
my solution here
Quote:
Originally Posted by
Mila
I tried but now not show the HP bar...
I use 1.03O Main, perhaps offsets errors...
checking all step by step.
offset
Quote:
#define MU_CDC_SETBACKGROUNDCOLOR 0x004201DA
is fine i use 1.03O eng too.
Re: Client 1.03P ENG Source(CustomHP-CustomMonster-CustomItems and more)
Quote:
Originally Posted by
ATJIAHT
i trying kill Player :D
but i need disable hp bar in PvP :)
i solved this. Hp Bar only for Monsters.
need replace
for this
and added in Prodef.h
perhaps this is a bad solution but it works :blushing:
Gonna test this now, but the Prodef.h part I have it added already, exactly the same...o.O
Re: Client 1.03P ENG Source(CustomHP-CustomMonster-CustomItems and more)
guys, I'm trying to adapt that system in server AI julia however is giving an error when the dll copilar see log below:
Quote:
1>ClCompile:
1> User.cpp
1>User.cpp(541): warning C4244: '=' : conversion from 'DWORD' to 'unsigned short', possible loss of data
1>User.cpp(801): warning C4244: '=' : conversion from 'float' to 'int', possible loss of data
1>User.cpp(802): warning C4244: '=' : conversion from 'float' to 'int', possible loss of data
1>User.cpp(804): error C2065: 'OBJ_USER' : undeclared identifier
1>User.cpp(809): error C2065: 'OBJ_USER' : undeclared identifier
I'm no expert on the subject, I'm just venturing to add that to the info and your help, if someone can guide me in this as adapitar soucer AI julia will be grateful because I really want to learn about these things mecher
Re: Client 1.03P ENG Source(CustomHP-CustomMonster-CustomItems and more)
Lets go:
@ianvalls90
Sorry, I've renamed that variable and forgot about that. The correct would be:
Code:
if (gTarg->Type == OBJ_MONSTER)
{
pResult.Life = gTarg->Life;
pResult.MaxLife = gTarg->MaxLife + gTarg->AddLife;
}
I've edited the post.
@Mila,
What you mean with "Chain" error? Can you post the full error description?
@ATJIAHT
This seems to be a conversion error, or a float overflow. You changed the client side Hp and MaxHp variables to float, like I posted here?
Quote:
Originally Posted by
walter29
guys, I'm trying to adapt that system in server AI julia however is giving an error when the dll copilar see log below:
I'm no expert on the subject, I'm just venturing to add that to the info and your help, if someone can guide me in this as adapitar soucer AI julia will be grateful because I really want to learn about these things mecher
Change OBJ_USER to OBJECT_USER
Re: Client 1.03P ENG Source(CustomHP-CustomMonster-CustomItems and more)
Quote:
Originally Posted by
ATJIAHT
Check my post for fix this...
http://forum.ragezone.com/f508/clien...ml#post7814898
Quote:
Originally Posted by
afonsolage
Lets go:
@Mila,
What you mean with "Chain" error? Can you post the full error description?
I solver delete this line:
Quote:
#define MU_CDC_SETBACKGROUNDCOLOR 0x004201DA "typedef DWORD(__thiscall *pCDCSetTextColor)"
But this line not work (fails to show hp bar)
Quote:
if (Mob_HP_Bar.isDraw && (*(LPBYTE)0x8C8674) != 0xFF)