//SetOp((LPVOID)0x005B96E8, (LPVOID)this->DrawPartyHP, ASM::CALL);
SetOp((LPVOID)0x005B96E8, (LPVOID)this->DrawSome, ASM::CALL);
// ----------------------------------------------------------------------------------------------
void User::DrawPartyHP()
{
char LifeDisplay[20];
VAngle Angle;
int PosX, PosY, LifeProgress;
for( int PartySlot = 0; PartySlot < 10; PartySlot++ )
{
PartyList PartyMember = *(PartyList*)((char*)&pPartyListStruct + 10 * PartySlot);
lpViewObj lpPartyObj = &*(ObjectPreview*)pGetPreviewStruct(pPreviewThis(), PartyMember.ViewportID);
lpViewObj lpObj = gObjUser.lpViewTarget;
// ----
if( !lpObj || lpObj->m_Model.ObjectType != emMonster || !lpObj->m_Model.Unknown4 )
{
return;
}
// ----
float LifeBarWidth = 65.0f;
// ----
Angle.X = lpObj->m_Model.VecPosX;
Angle.Y = lpObj->m_Model.VecPosY;
Angle.Z = lpObj->m_Model.VecPosZ + lpObj->m_Model.Unknown216.Z + 100.0;
// ----
pGetPosFromAngle(&Angle, &PosX, &PosY);
PosX -= (int)floor(LifeBarWidth / (double)2.0);
// ----
if( gObjUser.m_TargetLifePercent <= 0.0f )
{
return;
}
// ----
float BarWidth = (64.5f / 100.0f) * gObjUser.m_TargetLifePercent;
pDrawText(pTextThis(), PosX-1, PosY - 9, " ", 67, 0, (LPINT)0, 0);
pDrawText(pTextThis(), PosX+0.5*(66.95-(4.35*float(strlen( lpObj->Name)))), PosY - 9, lpObj->Name, 0, 0, (LPINT)0, 0);
pDrawGUI(0x7B3F, (float)PosX - 1.2, (float)PosY - 1.5, 66.95, 6);
pDrawGUI(0x7B40, (float)PosX, (float)PosY, BarWidth, 3);
// ----
pGLSwitch();
}
pGLSwitch();
glColor3f(1.0, 1.0, 1.0);
}
// ----------------------------------------------------------------------------------------------
void User::DrawSome(){
VAngle Angle;
int PosX, PosY, LifeProgress;
// ----
{
for( int PartySlot = 0; PartySlot < 75; PartySlot++ )
{
lpViewObj lpObj = &*(ObjectPreview*)pGetPreviewStruct(pPreviewThis(), PartySlot);
DWORD CurrentTick = GetTickCount();
DWORD Delay = (CurrentTick - gObjUser.m_TargetUpdateTick);
// ----
if( !lpObj || lpObj->m_Model.ObjectType != emMonster || !lpObj->m_Model.Unknown4 )
{
continue;
}
// ----
PMSG_TARGETDATA_REQ pRequest;
pRequest.h.set((LPBYTE)&pRequest, 0xFB, 7, sizeof(pRequest));
pRequest.aIndex = lpObj->aIndex;
// ----
if( Delay >= 10 )
{
gProtocol.DataSend((LPBYTE)&pRequest, pRequest.h.size);
}
// ----
Angle.X = lpObj->m_Model.VecPosX;
Angle.Y = lpObj->m_Model.VecPosY;
Angle.Z = lpObj->m_Model.VecPosZ + lpObj->m_Model.Unknown216.Z + 100.0;
// ----
float BarWidth = (64.5f / 100.0f) *gObjUser.m_TargetLifePercent;
float LifeBarWidth = 65.0f;
// ----
pGetPosFromAngle(&Angle, &PosX, &PosY);
PosX -= (int)floor(LifeBarWidth / (double)2.0);
// ----
if(gObjUser.m_TargetLifePercent <= 0.1f)
{
continue;
}
// ----
pDrawColorText(lpObj->Name, PosX -1, PosY - 9, 67, 1, eWhite, 9, 3);
// ----
pDrawGUI(0x7B3F, (float)PosX - 1.2, (float)PosY - 1.5, 66.95, 6);
pDrawGUI(0x7B40, (float)PosX, (float)PosY, BarWidth, 3);
// ----
if( (int)(gObjUser.m_TargetLifePercent / 10) > 10 )
{
LifeProgress = 10;
}
else
{
LifeProgress = (int)(gObjUser.m_TargetLifePercent / 10);
}
// ----
pGLSwitch();
}
pGLSwitch();
glColor3f(1.0, 1.0, 1.0);
}
}