#define CPhysicsCloth_Create ((int(__thiscall*)(int This, int a2, int a3, float a4, float a5, float a6, int a7, int a8, float a9, float a10, int a11, int a12, int a13)) 0x0051D460)
#define CPhysicsCloth_AddCollisionSphere ((int(__thiscall*)(int This, float a1, float a2, float a3, float a4, int a5)) 0x0051EEF0)
#define EnableAlphaBlend ((void(__cdecl*)()) 0x00636070)
#define BindTexture ((bool(__cdecl*)(int a1)) 0x00635CF0)
DWORD CapeEffectPointer;
DWORD CapeEffectBuff;
DWORD CapeThis;
DWORD Capea2;
float Render(float a1, float a2)
{
float v5;
float v2 = a2 * 0.01745f;
float v6 = (float)((int)(v2 * 1000.0f / a1 + timeGetTime()) % (int)(6283.185546875f / a1))* 0.001f * a1;
if (v6 >= 3.14f)
v5 = cosf(v6);
else
v5 = -cosf(v6);
return (float)((v5 + 1.0f) * 0.5f);
}
RenderCape(int This, int a2, float a3, float a4, float a5)
{
float v6; // ST18_4@3
float green; // ST04_4@3
float v11; // [sp+1Ch] [bp-4h]@2
v11 = 1.0;
if ( a3 > 0.0 )
{
v6 = a5 - a4;
green = -a3;
v11 = Render(green, 0.0) * v6 + a4;
}
if ( This == a2 )
{
EnableAlphaBlend();
BindTexture(This = a2);
glColor3f(v11, v11, v11);
}
}
void BindTextureRender(int a1)
{
if ( a1 )
{
RenderCape(a1, 30679, 3.0, 0.4, 1.0);//darklordwing4de_render.jpg
RenderCape(a1, 30680, 3.0, 0.4, 1.0);//darklordwing4dd_render.jpg
RenderCape(a1, 30682, 3.0, 0.5, 1.0);//ragefighterwing4db_render.jpg
RenderCape(a1, 32692, 3.0, 0.1, 1.0);//Item802_wing_R.jpg
}
BindTexture(a1);
}
void CPhysicsCloth_Render(int This, int a2)
{
*(DWORD *)(This + 16) = a2;
}
__declspec(naked) void CapeB()
{
static DWORD Address1 = 0x00574915;
static DWORD Address2 = 0x00574A6A;
_asm{
mov CapeEffectBuff, ecx
MOV EAX,DWORD PTR SS:[EBP+0x8]
MOVSX ECX,WORD PTR DS:[EAX+0x208]
mov CapeEffectPointer,ecx
//mov ecx, CapeEffectBuff
MOV ECX,DWORD PTR SS:[EBP-0x2DC]
MOV CapeThis, ECX
MOV EDX,DWORD PTR SS:[EBP+0xC]
MOV Capea2, EDX
mov ecx, CapeEffectBuff
}
if(CapeEffectPointer == ITEM2(12,40))//Cape of Emperor
{
CPhysicsCloth_Create(CapeThis + 192, Capea2, 19, 0.0, 8.0, 10.0, 10, 10, 180.0, 180.0, 30552, 30552, 5125);
CPhysicsCloth_AddCollisionSphere(CapeThis + 192, -10.0, -10.0, -10.0, 25.0, 17);
CPhysicsCloth_AddCollisionSphere(CapeThis + 192, 10.0, -10.0, -10.0, 25.0, 17);
CPhysicsCloth_AddCollisionSphere(CapeThis + 192, -10.0, -10.0, 20.0, 27.0, 17);
CPhysicsCloth_AddCollisionSphere(CapeThis + 192, 10.0, -10.0, 20.0, 27.0, 17);
}
if(CapeEffectPointer == ITEM2(12,49))//Cloak of Warrior
{
CPhysicsCloth_Create(CapeThis + 192, Capea2, 19, 0.0, 15.0, 5.0, 10, 10, 150.0, 130.0, 32480, 32480, 5125);
CPhysicsCloth_AddCollisionSphere(CapeThis + 192, -10.0, -10.0, -10.0, 35.0, 17);
CPhysicsCloth_AddCollisionSphere(CapeThis + 192, 10.0, -10.0, -10.0, 35.0, 17);
CPhysicsCloth_AddCollisionSphere(CapeThis + 192, -10.0, -10.0, 20.0, 37.0, 17);
CPhysicsCloth_AddCollisionSphere(CapeThis + 192, 10.0, -10.0, 20.0, 37.0, 17);
}
if(CapeEffectPointer == ITEM2(12,50))//Lord of the Cape
{
CPhysicsCloth_Create(CapeThis + 192, Capea2, 19, 0.0, 15.0, 5.0, 10, 10, 180.0, 170.0, 32482, 32482, 5125);
CPhysicsCloth_AddCollisionSphere(CapeThis + 192, -10.0, -10.0, -10.0, 35.0, 17);
CPhysicsCloth_AddCollisionSphere(CapeThis + 192, 10.0, -10.0, -10.0, 35.0, 17);
CPhysicsCloth_AddCollisionSphere(CapeThis + 192, -10.0, -10.0, 20.0, 37.0, 17);
CPhysicsCloth_AddCollisionSphere(CapeThis + 192, 10.0, -10.0, 20.0, 37.0, 17);
CPhysicsCloth_Create(CapeThis + 384, Capea2, 19, 25.0, 15.0, 2.0, 2, 5, 12.0, 180.0, 32481, 32481, 36864);
CPhysicsCloth_AddCollisionSphere(CapeThis + 384, 0.0, -15.0, -20.0, 35.0, 2);
CPhysicsCloth_AddCollisionSphere(CapeThis + 384, 0.0, 0.0, 0.0, 45.0, 17);
CPhysicsCloth_Create(CapeThis + 480, Capea2, 19, -25.0, 15.0, 2.0, 2, 5, 12.0, 180.0, 32481, 32481, 53248);
CPhysicsCloth_AddCollisionSphere(CapeThis + 480, 0.0, -15.0, -20.0, 35.0, 2);
CPhysicsCloth_AddCollisionSphere(CapeThis + 480, 0.0, 0.0, 0.0, 50.0, 17);
}
if(CapeEffectPointer == ITEM2(12,224))//Cloak of Death
{
CPhysicsCloth_Create(CapeThis + 192, Capea2, 19, 0.0, 15.0, 5.0, 10, 10, 180.0, 170.0, 30876, 30876, 5125);//deathha.tga
CPhysicsCloth_AddCollisionSphere(CapeThis + 192, -10.0, -10.0, -10.0, 35.0, 17);
CPhysicsCloth_AddCollisionSphere(CapeThis + 192, 10.0, -10.0, -10.0, 35.0, 17);
CPhysicsCloth_AddCollisionSphere(CapeThis + 192, -10.0, -10.0, 20.0, 37.0, 17);
CPhysicsCloth_AddCollisionSphere(CapeThis + 192, 10.0, -10.0, 20.0, 37.0, 17);
CPhysicsCloth_Create(CapeThis + 384, Capea2, 19, 30.0, 15.0, 10.0, 2, 5, 12.0, 200.0, 30877, 30877, 4096);//deathjung.tga
CPhysicsCloth_AddCollisionSphere(CapeThis + 384, 0.0, -15.0, -20.0, 30.0, 2);
CPhysicsCloth_AddCollisionSphere(CapeThis + 384, 0.0, 0.0, 0.0, 35.0, 17);
CPhysicsCloth_Create(CapeThis + 480, Capea2, 19, -30.0, 20.0, 10.0, 2, 5, 12.0, 200.0, 30877, 30877, 4096);//deathjung.tga
CPhysicsCloth_AddCollisionSphere(CapeThis + 480, 0.0, -15.0, -20.0, 30.0, 2);
CPhysicsCloth_AddCollisionSphere(CapeThis + 480, 0.0, 0.0, 0.0, 35.0, 17);
}
if(CapeEffectPointer == ITEM2(12,227))//Wings Devil & Angel
{
CPhysicsCloth_Create(CapeThis + 192, Capea2, 19, 0.0, 20.0, -10.0, 10, 10, 100.0, 150.0, 30889, 30889, 5125);//admangto.tga
CPhysicsCloth_AddCollisionSphere(CapeThis + 192, 0.0, -10.0, -40.0, 37.0, 17);
}
if(CapeEffectPointer == ITEM2(12,192))//Control Cloak
{
CPhysicsCloth_Create(CapeThis + 192, Capea2, 19, 0.0, 25.0, -10.0, 10, 10, 130.0, 160.0, 30886, 30886, 4101);//darklordwing4de.tga
CPhysicsCloth_Render(CapeThis + 192, 30679);
CPhysicsCloth_AddCollisionSphere(CapeThis + 192, -10.0, 5.0, -25.0, 25.0, 17);
CPhysicsCloth_AddCollisionSphere(CapeThis + 192, 10.0, 5.0, -25.0, 25.0, 17);
CPhysicsCloth_AddCollisionSphere(CapeThis + 192, -10.0, -5.0, -35.0, 28.0, 17);
CPhysicsCloth_AddCollisionSphere(CapeThis + 192, 10.0, -5.0, -35.0, 28.0, 17);
CPhysicsCloth_Create(CapeThis + 384, Capea2, 19, 45.0, 34.0, -10.0, 2, 5, 12.0, 140.0, 30885, 30885, 4096);//darklordwing4dd.tga
CPhysicsCloth_Render(CapeThis + 384, 30680);
CPhysicsCloth_AddCollisionSphere(CapeThis + 384, 0.0, -15.0, 10.0, 35.0, 10);
CPhysicsCloth_AddCollisionSphere(CapeThis + 384, 20.0, 5.0, 10.0, 35.0, 17);
CPhysicsCloth_Create(CapeThis + 480, Capea2, 19, -45.0, 30.0, -10.0, 2, 5, 12.0, 140.0, 30885, 30885, 4096);//darklordwing4dd.tga
CPhysicsCloth_Render(CapeThis + 480, 30680);
CPhysicsCloth_AddCollisionSphere(CapeThis + 480, 0.0, -15.0, 10.0, 35.0, 3);
CPhysicsCloth_AddCollisionSphere(CapeThis + 480, -20.0, 5.0, 10.0, 35.0, 17);
}
if(CapeEffectPointer == ITEM2(12,193))//Referre Cloak
{
CPhysicsCloth_Create(CapeThis + 192, Capea2, 19, 0.0, 28.0, 0.0, 10, 10, 180.0, 150.0, 30888, 30888, 5125);//ragefighterwing4db.tga
CPhysicsCloth_Render(CapeThis + 192, 30682);
CPhysicsCloth_AddCollisionSphere(CapeThis + 192, -10.0, -10.0, -10.0, 30.0, 17);
CPhysicsCloth_AddCollisionSphere(CapeThis + 192, 10.0, -10.0, -10.0, 35.0, 17);
CPhysicsCloth_AddCollisionSphere(CapeThis + 192, -10.0, -10.0, 20.0, 37.0, 17);
CPhysicsCloth_AddCollisionSphere(CapeThis + 192, 10.0, -10.0, 20.0, 37.0, 17);
}
/*
if(CapeEffectPointer == ITEM2(12,234))//TEST Wings Of Power
{
CPhysicsCloth_Create(CapeThis + 384, Capea2, 19, -32.0, 24.0, 0.0, 10, 10, 65.0, 125.0, 33041, 33041, 5124);
CPhysicsCloth_AddCollisionSphere(CapeThis + 384, 0.0, -15.0, -20.0, 30.0, 2);
CPhysicsCloth_AddCollisionSphere(CapeThis + 384, 0.0, 0.0, 0.0, 35.0, 17);
CPhysicsCloth_Create(CapeThis + 480, Capea2, 19, 32.0, 24.0, 0.0, 10, 10, 65.0, 125.0, 33042, 33042, 5124);
CPhysicsCloth_AddCollisionSphere(CapeThis + 480, 0.0, -15.0, -20.0, 30.0, 2);
CPhysicsCloth_AddCollisionSphere(CapeThis + 480, 0.0, 0.0, 0.0, 35.0, 17);
}
*/
//
_asm{Jmp Address2}
}
SetCompleteHook(0xE8, 0x0051EC9D, &BindTextureRender);
SetCompleteHook(0xE9, 0x005748FF, &CapeB);