Code:
void GetBonePositionEx(cObject* obj, UINT Bone, Transform* Trans) // by ~FALLEN~ //
{
DWORD CShell = (DWORD)GetModuleHandleA(eCShell);
DWORD pLTModelOld = *(DWORD*)(CShell + aLTModel);
__asm
{
MOV ECX, pLTModelOld
MOV EDX, DWORD PTR DS : [ECX]
MOV EDX, DWORD PTR DS : [EDX + 0x3C]
PUSH 1
PUSH Trans
PUSH Bone
PUSH obj
CALL EDX
}
}
void GetNodePosition(cObject* obj, UINT Bone, D3DXVECTOR3 &Out)
{
Transform Trans;
GetBonePositionEx(obj, Bone, &Trans);
Out = Trans.Pos;
Out.y += 5;
}
void DrawBone(LPDIRECT3DDEVICE9 pDevice, cObject *Obj, UINT iStart, UINT iEnd, D3DCOLOR Color)
{
D3DXVECTOR3 StartPos, EndPos;
GetNodePosition(Obj, iStart, StartPos);
GetNodePosition(Obj, iEnd, EndPos);
if (Trans3DTo2D(pDevice, &StartPos) && Trans3DTo2D(pDevice, &EndPos))
DrawLine(pDevice, StartPos.x, StartPos.y, EndPos.x, EndPos.y, Color);
}
void DrawPlayer(LPDIRECT3DDEVICE9 pDevice, DWORD ESP_Color, CAICLEINT* pPlayer)
{
D3DXVECTOR3 tHead = GetBonePosition(pPlayer->Object, 6);
D3DXVECTOR3 tNeck = GetBonePosition(pPlayer->Object, 5);
if (!Trans3DTo2D(pDevice, &tHead) || !Trans3DTo2D(pDevice, &tNeck)) return;
D3DXVECTOR3 Box = tNeck - tHead; // Foot - Head
if (Box.y < 0) Box.y *= -1;
int HeadRadius = (int)Box.y * 1.5;
DrawBone(pDevice, pPlayer->Object, 6, 0, ESP_Color);
DrawBone(pDevice, pPlayer->Object, 5, 6, ESP_Color);
DrawBone(pDevice, pPlayer->Object, 4, 5, ESP_Color);
DrawBone(pDevice, pPlayer->Object, 3, 4, ESP_Color);
DrawBone(pDevice, pPlayer->Object, 2, 3, ESP_Color);
DrawBone(pDevice, pPlayer->Object, 1, 2, ESP_Color);
DrawBone(pDevice, pPlayer->Object, 21, 1, ESP_Color);
DrawBone(pDevice, pPlayer->Object, 22, 21, ESP_Color);
DrawBone(pDevice, pPlayer->Object, 23, 22, ESP_Color);
DrawBone(pDevice, pPlayer->Object, 24, 23, ESP_Color);
DrawBone(pDevice, pPlayer->Object, 25, 1, ESP_Color);
DrawBone(pDevice, pPlayer->Object, 26, 25, ESP_Color);
DrawBone(pDevice, pPlayer->Object, 27, 26, ESP_Color);
DrawBone(pDevice, pPlayer->Object, 28, 27, ESP_Color);
DrawBone(pDevice, pPlayer->Object, 14, 5, ESP_Color);
DrawBone(pDevice, pPlayer->Object, 15, 14, ESP_Color);
DrawBone(pDevice, pPlayer->Object, 16, 15, ESP_Color);
DrawBone(pDevice, pPlayer->Object, 17, 16, ESP_Color);
DrawBone(pDevice, pPlayer->Object, 18, 17, ESP_Color);
DrawBone(pDevice, pPlayer->Object, 19, 17, ESP_Color);
DrawBone(pDevice, pPlayer->Object, 20, 17, ESP_Color);
DrawBone(pDevice, pPlayer->Object, 7, 5, ESP_Color);
DrawBone(pDevice, pPlayer->Object, 8, 7, ESP_Color);
DrawBone(pDevice, pPlayer->Object, 9, 8, ESP_Color);
DrawBone(pDevice, pPlayer->Object, 10, 9, ESP_Color);
DrawBone(pDevice, pPlayer->Object, 11, 10, ESP_Color);
DrawBone(pDevice, pPlayer->Object, 12, 10, ESP_Color);
DrawBone(pDevice, pPlayer->Object, 13, 10, ESP_Color);
}