#include "StdAfx.h"
void VisualState::Load()
{[INDENT]this -> Kill = TRUE; [/INDENT]
[INDENT]this -> aIndex = 0; [/INDENT]
[INDENT]this -> Life = 0;
this -> MaxLife = 0;
this -> Mana = 0;
this -> MaxMana = 0;
this -> Ag = 0;
this -> MaxAg = 0;
this -> Sd = 0;
this -> MaxSd = 0;
HookCall(0x5ED491, DrawHP);
HookCall(0x5ED4B8, DrawMP);
HookCall(0x5EB806, DrawAG);
HookCall(0x5EBB96, DrawSD);
HookCall(0x5EC5E8, DrawTabHP);
HookCall(0x5EC6B2, DrawTabMP);
HookCall(0x5EB863, DrawTabAG);
HookCall(0x5EBBF0, DrawTabSD);
HookCall(0x64992B, InfoHP);
HookCall(0x649F27, InfoMP);[/INDENT]
}
void VisualState::Index(PMSG_JOINRESULT * Data)
{[INDENT]this -> aIndex = MAKE_NUMBERW(Data -> NumberH, Data -> NumberL);
this -> Kill = FALSE;}void VisualState::RecvHP(PMSG_REFILL * Data);[/INDENT]
}
void VisualState::RecvHP(PMSG_REFILL* Data)
{[INDENT]if (Data -> IPos == 0xFF) [/INDENT]
[INDENT]{ [/INDENT]
[INDENT=2]this -> Life = Data -> Life; [/INDENT]
[INDENT=2]this -> Sd = Data -> Shield; [/INDENT]
[INDENT]}
[/INDENT]
[INDENT]else if (Data -> IPos == 0xFE) [/INDENT]
[INDENT]{ [/INDENT]
[INDENT=2]this -> MaxLife = Data -> Life; [/INDENT]
[INDENT=2]this -> MaxSd = Data -> Shield; [/INDENT]
[INDENT]}
[/INDENT]
[INDENT]if (this -> Life > this -> MaxLife) [/INDENT]
[INDENT]{ [/INDENT]
[INDENT=2]this -> Life = this -> MaxLife; [/INDENT]
[INDENT]}
[/INDENT]
[INDENT]if (this -> Kill == TRUE) [/INDENT]
[INDENT]{ [/INDENT]
[INDENT=2]this -> Life = 0; [/INDENT]
[INDENT=2]this -> Sd = 0; [/INDENT]
[INDENT]}[/INDENT]
}
void VisualState::RecvMP(PMSG_MANASEND * Data)
{[INDENT]if (Data -> IPos == 0xFF)
{ [/INDENT]
[INDENT=2]this -> Mana = Data -> Mana;
this -> Ag = Data -> BP; [/INDENT]
[INDENT]}
else if (Data -> IPos == 0xFE)
{ [/INDENT]
[INDENT=2]this -> MaxMana = Data -> Mana;
this -> MaxAg = Data -> BP; [/INDENT]
[INDENT]}
if (this -> Mana > this -> MaxMana)
{ [/INDENT]
[INDENT=2]this -> Mana = this -> MaxMana; [/INDENT]
[INDENT]}[/INDENT]
}
void VisualState::Respawn()
{[INDENT]this -> Kill = FALSE;
this -> Life = this -> MaxLife;
this -> Mana = this -> MaxMana;
this -> Ag = this -> MaxAg;
this -> Sd = this -> MaxSd;[/INDENT]
}
void VisualState::Killed(PMSG_DIEPLAYER * Data)
{[INDENT]short tIndex = MAKE_NUMBERW(Data -> NumberH, Data -> NumberL);
if (this -> aIndex == tIndex)
{ [/INDENT]
[INDENT=2]this -> Life = 0; this -> Sd = 0;
this -> Kill = TRUE; [/INDENT]
[INDENT]}[/INDENT]
}
void VisualState::DrawHP(float PosX, float PosY, int Value, float ScaleX, float ScaleY)
{[INDENT]DrawBar(PosX - 13.0 f, PosY - 15.0 f, Visual.Life, ScaleX, ScaleY);[/INDENT]
}
void VisualState::DrawMP(float PosX, float PosY, int Value, float ScaleX, float ScaleY)
{[INDENT]DrawBar(PosX - 13.0 f, PosY - 15.0 f, Visual.Mana, ScaleX, ScaleY);[/INDENT]
}
void VisualState::DrawAG(float PosX, float PosY, int Value, float ScaleX, float ScaleY)
{[INDENT]DrawBar(PosX - 10.0 f, PosY, Visual.Ag, ScaleX, ScaleY);[/INDENT]
}
void VisualState::DrawSD(float PosX, float PosY, int Value, float ScaleX, float ScaleY)
{[INDENT]DrawBar(PosX - 15.0 f, PosY, Visual.Sd, ScaleX, ScaleY);[/INDENT]
}
void VisualState::DrawTabHP(int PosX, int PosY, LPCSTR lpString)
{[INDENT]sprintf_s(Visual.Buffer[0], "Life: %d/%d", Visual.Life, Visual.MaxLife); [/INDENT]
[INDENT]DrawTab(PosX, PosY, Visual.Buffer[0]);[/INDENT]
}
void VisualState::DrawTabMP(int PosX, int PosY, LPCSTR lpString)
{[INDENT]sprintf_s(Visual.Buffer[1], "Mana: %d/%d", Visual.Mana, Visual.MaxMana); [/INDENT]
[INDENT]DrawTab(PosX, PosY, Visual.Buffer[1]);[/INDENT]
}
void VisualState::DrawTabAG(int PosX, int PosY, LPCSTR lpString)
{[INDENT]sprintf_s(Visual.Buffer[2], "AG: %d/%d", Visual.Ag, Visual.MaxAg); [/INDENT]
[INDENT]DrawTab(PosX, PosY, Visual.Buffer[2]);[/INDENT]
}
void VisualState::DrawTabSD(int PosX, int PosY, LPCSTR lpString)
{[INDENT]sprintf_s(Visual.Buffer[3], "SD: %d/%d", Visual.Sd, Visual.MaxSd); [/INDENT]
[INDENT]DrawTab(PosX, PosY, Visual.Buffer[3]);[/INDENT]
}
void VisualState::InfoHP(int a1, int a2, LPCSTR a3, int a4, char a5, int a6)
{[INDENT]sprintf_s(Visual.Buffer[4], "Life: %d/%d", Visual.Life, Visual.MaxLife); [/INDENT]
[INDENT]DrawInfo(a1, a2, Visual.Buffer[4], a4, a5, a6);[/INDENT]
}
void VisualState::InfoMP(int a1, int a2, LPCSTR a3, int a4, char a5, int a6)
{[INDENT]sprintf_s(Visual.Buffer[5], "Mana: %d/%d", Visual.Mana, Visual.MaxMana); [/INDENT]
[INDENT]DrawInfo(a1, a2, Visual.Buffer[5], a4, a5, a6);}VisualState Visual;[/INDENT]
}