Incredible.. I make something like this too, but for 1.03K JPN main.exe and.. sincerely I make so many times this function, because don't work properly.. and you make this on only some minutes..
Here related to Pets work my decompilation (Old) from 1.03K Add pets Effects
Code:
CreateSpriteEx pCreateSpriteEx = (CreateSpriteEx)0x006BABF2;
CreateParticleEx pCreateParticleEx = (CreateParticleEx)0x0069BCD9;
Objsub_5AB975 gObjsub_5AB975 = (Objsub_5AB975)0x005AB975;
Objsub_604FCD gObjsub_604FCD = (Objsub_604FCD)0x00604FCD;
Objsub_5B81A9 gObjsub_5B81A9 = (Objsub_5B81A9)0x005B81A9;
Objsub_85151D gObjsub_85151D = (Objsub_85151D)0x0085151D;
char CreatePetEffect(int Arg1, char Arg2)
{
float v2; // ST14_4@3
float v3; // ST10_4@3
char v5; // [sp+17h] [bp-15h]@3
int v6; // [sp+18h] [bp-14h]@18
float v7; // [sp+1Ch] [bp-10h]@21
float v8; // [sp+20h] [bp-Ch]@21
float v9; // [sp+24h] [bp-8h]@21
float v10; // [sp+28h] [bp-4h]@20
vec3_t Color;
Vector(0.f, 0.f, 0.f, Color);
vec3_t Color2;
Vector(0.f, 0.f, 0.f, Color2);
vec3_t Color3;
Vector(0.f, 0.f, 0.f, Color3);
vec3_t Color4;
Vector(0.f, 0.f, 0.f, Color4);
vec3_t Color5;
Vector(0.f, 0.f, 0.f, Color5);
if (*(BYTE*)(Arg1 + 4))
{
if (Arg2)
{
v5 = 1;
}
else
{
v2 = *(float *)(Arg1 + 256) * 0.0099999998;
v3 = *(float *)(Arg1 + 252) * 0.0099999998;
v5 = gObjsub_5AB975(v3, v2, -20.0);
}
*(BYTE*)(Arg1 + 12) = v5;
if (*(BYTE*)(Arg1 + 12))
{
if (*(DWORD*)(*(DWORD*)(Arg1 + 472) + 48) != 826 && *(DWORD*)(Arg1 + 48) != 7490 && *(DWORD*)(Arg1 + 48) != ObjectId(13,106) && *(DWORD*)(Arg1 + 48) != ObjectId(13,123))
return 1;
if (Arg2)
{
*(DWORD*)(Arg1 + 96) = *(DWORD*)(Arg1 + 96);
}
else if (*(DWORD*)(Arg1 + 48) == ObjectId(13, 97))
{
*(DWORD*)(Arg1 + 96) = 1065353216;
}
else if (pPlayerState == 4)
{
*(DWORD*)(Arg1 + 96) = 1065353216;
}
else if (*(DWORD*)(Arg1 + 48) != eMauntType::BlackFenrir
&& *(DWORD*)(Arg1 + 48) != eMauntType::BlueFenrir
&& *(DWORD*)(Arg1 + 48) != eMauntType::RedFenrir
&& *(DWORD*)(Arg1 + 48) != eMauntType::GoldenFenrir
&& *(DWORD*)(Arg1 + 48) != eSpecialMauntType::DarkWolf
&& *(DWORD*)(Arg1 + 48) != eSpecialMauntType::FangSable
&& *(DWORD*)(Arg1 + 48) != eSpecialMauntType::MisticTiger
&& *(DWORD*)(Arg1 + 48) != eMauntType::OrangeFenrir
&& *(DWORD*)(Arg1 + 48) != ePetSystemType::Skeleton
&& *(DWORD*)(Arg1 + 48) != ePetSystemType::Unicorn)
{
*(DWORD*)(Arg1 + 96) = 1065353216;
}
v6 = 0;
if (gObjsub_604FCD((void*)(*(DWORD*)(Arg1 + 472) + 484), 18))
v6 = 10;
gObjsub_5B81A9(Arg1, 0, 0, v6);
v10 = (double)(gObjsub_85151D() % 30 + 70) * 0.0099999998;
// ----
if (*(DWORD*)(Arg1 + 48) == ObjectId(13, 0))
{
v7 = v10 * 0.5;
v8 = v10 * 0.80000001;
v9 = v10 * 0.60000002;
Vector(0.94, 0.812f, 0.5358f, Color);
pCreateSpriteEx(32002, Arg1 + 252, 1065353216, (int)&Color, Arg1, 0, 0);
}
// ----
else if (*(DWORD*)(Arg1 + 48) == ObjectId(13, 106))
{
Vector(0.5358f, 0.812f, 0.94f, Color);
pCreateParticleEx(32033, Arg1 + 252, Arg1 + 264, (int)Color, 11, 0.5f, Arg1);
Vector(0.94f, 0.834f, 0.553f, Color2);
pCreateParticleEx(32033, Arg1 + 252, Arg1 + 264, (int)Color2, 11, 0.4f, Arg1);
Vector(0.553f, 0.94f, 0.84f, Color3);
pCreateParticleEx(32033, Arg1 + 252, Arg1 + 264, (int)Color3, 11, 0.3f, Arg1);
Vector(0.235f, 0.125f, 0.85f, Color4);
pCreateParticleEx(32033, Arg1 + 252, Arg1 + 264, (int)Color4, 11, 0.2f, Arg1);
Vector(0.85689f, 0.23541f, 0.9635f, Color5);
pCreateParticleEx(32033, Arg1 + 252, Arg1 + 264, (int)Color5, 11, 0.1f, Arg1);
}
// ----
else if (*(DWORD*)(Arg1 + 48) == ObjectId(13, 123))
{
Vector(0.f, 1.f, 0.0167f, Color);
pCreateParticleEx(32269, Arg1 + 252, Arg1 + 264, (int)Color, 3, 0.5f, Arg1);
Vector(0.f, 1.f, 0.0178f, Color2);
pCreateParticleEx(32269, Arg1 + 252, Arg1 + 264, (int)Color2, 3, 0.6f, Arg1);
Vector(0.f, 1.f, 0.0187f, Color3);
pCreateParticleEx(32269, Arg1 + 252, Arg1 + 264, (int)Color3, 3, 0.7f, Arg1);
}
// ----
else if (*(DWORD*)(Arg1 + 48) == ObjectId(13, 110))
{
Vector(0.4095f, 0.7598f, 0.91f, Color);
pCreateParticleEx(32269, Arg1 + 252, Arg1 + 264, (int)&Color, 3, 0.5f, Arg1);
Vector(0.4025f, 0.8598f, 0.98f, Color2);
pCreateParticleEx(32033, Arg1 + 252, Arg1 + 264, (int)&Color2, 11, 0.5f, Arg1);
}
// ----
else if (*(DWORD*)(Arg1 + 48) == ObjectId(13, 109))
{
Vector(0.4095f, 0.7598f, 0.91f, Color);
pCreateParticleEx(32269, Arg1 + 252, Arg1 + 264, (int)&Color, 3, 0.5f, Arg1);
Vector(1.f, 1.f, 0.98f, Color2);
pCreateParticleEx(32033, Arg1 + 252, Arg1 + 264, (int)&Color2, 11, 0.5f, Arg1);
}
}
}
return 1;
}
PS 3: On Arg1 in really exists 1 struct... and Arg1 is in really a Pointer to this fuckin* struct -.-! but I don't like make structs on decompilation process anyways