Informação
SOURCE PARA EFFECT STATIC EM PET


PetEx.h
Código:
#pragma once

struct PETEX_EFFECT
{
	int Index;
	int ItemIndex;
	int EffectIndex;
	float ColorR;
	float ColorG;
	float ColorB;
	float ColorSize;
	float ColorMain;
	float ColorSide;
};

class cCPetEx
{
public:
	cCPetEx();
	virtual ~cCPetEx();
	void Init();
	void Load(PETEX_EFFECT* info);
	void SetInfo(PETEX_EFFECT info);
	PETEX_EFFECT* GetInfo(int index);
	PETEX_EFFECT* GetInfoByItem(int ItemIndex);
	bool CheckCustomPetByItem(int ItemType);
public:
	PETEX_EFFECT m_Effect[MAX_PETEX_EFFECT];
};

extern cCPetEx gPetEffect;

PetEx.cpp
Código:
#include  "stdafx.h"
#include "PetEx.h"

cCPetEx gPetEffect;
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

cCPetEx::cCPetEx() // OK
{
	this->Init();
}

cCPetEx::~cCPetEx() // OK
{

}

void cCPetEx::Init() // OK
{
	for (int n = 0; n < MAX_PETEX_EFFECT; n++)
	{
		this->m_Effect[n].Index = -1;
	}
}

void cCPetEx::Load(PETEX_EFFECT* info) // OK
{
	for (int n = 0; n < MAX_PETEX_EFFECT; n++)
	{
		this->SetInfo(info[n]);
	}
}

void cCPetEx::SetInfo(PETEX_EFFECT info) // OK
{
	if (info.Index < 0 || info.Index >= MAX_PETEX_EFFECT)
	{
		return;
	}

	this->m_Effect[info.Index] = info;
}

PETEX_EFFECT* cCPetEx::GetInfo(int index) // OK
{
	if (index < 0 || index >= MAX_PETEX_EFFECT)
	{
		return 0;
	}

	if (this->m_Effect[index].Index != index)
	{
		return 0;
	}

	return &this->m_Effect[index];
}

bool cCPetEx::CheckCustomPetByItem(int ItemType) // OK
{
	for (int i=0;i<MAX_PETEX_EFFECT; i++)
	{
		if (ItemType == this->m_Effect[i].ItemIndex)
		{
			return true;
		}
	}
	return false;
}
Pet.h -> agregar isto
Código:
//--- efectos
#define sub_9CFA0D				((int(*)()) 0x9CFA0D)
#define sub_5DBA10				((char(__cdecl*)(float a1, float a2, float a3)) 0x5DBA10)
#define pet_4C8640				((char(__thiscall*)(LPVOID This, char a2)) 0x4C8640)
#define pObjectMaxBug			((int(__cdecl*)(int a1, unsigned __int8 a2, int a3, int a4)) 0x5EBBB0)
//--
//adicionar esta función dentro de la clase
static char		CreateEffect(int a4, char a5);
Pet.cpp
colocar alfinal

Código:
//-----------
char CustomPet::CreateEffect(int a4, char a5)
{
	if(*(BYTE*)(a4 + 4))
	{
		char v8 = 0;

		if(a5)
		{
			v8 = 1;
		}
		else
		{
			float v5 = *(float*)(a4 + 256) * 0.009999999776482582;
			float v6 = *(float*)(a4 + 252) * 0.009999999776482582;
			v8 = sub_5DBA10(v6, v5, -20.0);
		}

		*(BYTE*)(a4 + 12) = v8;

		if(*(BYTE*)(a4 + 12))
		{
			DWORD dwItemNumber = *(DWORD*)(a4 + 48);
		
			for(int n = 0; n < MAX_PETEX_EFFECT; n++)
			{
				if(gPetEffect.CheckCustomPetByItem(dwItemNumber - 1171))
				{
					float ItemColor[3];

					ItemColor[0] = gPetEffect.m_Effect[n].ColorR;

					ItemColor[1] = gPetEffect.m_Effect[n].ColorG;

					ItemColor[2] = gPetEffect.m_Effect[n].ColorB;

					pPlayStaticEffect(gPetEffect.m_Effect[n].EffectIndex, (DWORD*)(a4 + 252), gPetEffect.m_Effect[n].ColorSize, ItemColor, a4, gPetEffect.m_Effect[n].ColorMain, (DWORD)gPetEffect.m_Effect[n].ColorSide);
				}
			}

			if(*(DWORD *)(*(DWORD*)(a4 + 472) + 48) != 1163 && *(DWORD*)(a4 + 48) != 7827)
			{
				return 1;
			}

			if(a5)
			{
				*(float*)(a4 + 96) = *(float*)(a4 + 96);
			}
			else if(pPlayerState == 4)
			{
				*(float*)(a4 + 96) = 1.2;
			}
			else if(dwItemNumber != 384 && dwItemNumber != 386 && dwItemNumber != 385 && dwItemNumber != 387)
			{
				*(float*)(a4 + 96) = 1.0;
			}	
			   
			int ItemGroup = (dwItemNumber - 1171) / 512;
			int ItemID = (dwItemNumber - 1171) % 512;
			if(gCustomPet2.CheckCustomPetByItem(ItemGroup, ItemID))
			{
				CUSTOM_PET_INFO* lpInfo = gCustomPet2.GetInfoByItem(ItemGroup, ItemID);

					*(float*)(a4 + 96) = 2.0;
			}

			int v9 = 0;

			if(pet_4C8640((LPVOID)(*(DWORD*)(a4 + 472) + 484), 18))
			{
				v9 = 10;
			}
			
			pObjectMaxBug(a4, 0, 0, v9);
	
			float v10 = (double)((signed int)sub_9CFA0D() % 30 + 70) * 0.009999999776482582;

			if(dwItemNumber == 7827)
			{
				float v11[3];

				v11[0] = v10 * 0.5;
				v11[1] = v10 * 0.800000011920929;
				v11[2] = v10 * 0.6000000238418579;

				pPlayStaticEffect(32002, (DWORD*)(a4 + 252), 1.0, v11, a4, 0.0, 0);
			}
		}
	}

	return 1;
}

//agregar en el load

	SetOp((LPVOID)0x0048E504, this->CreateEffect, ASM::CALL);
	SetOp((LPVOID)0x00503986, this->CreateEffect, ASM::CALL);
Créditos:
takumi12