| Gallery 1 | |
|
|
|
HEYYY, BREATHING THE AIR AGIAN, A BEAUTIFUL DAY HUH ?.. SHARING A NEW USELESS THING THAT NOBODY ASKED FORE.
THERE ARE THOUSANDS OF SHAPES AND PATTERNS YOU CAN DO.
PLEASE NOTE THAT USING THAT WAY, YOU WILL HAVE TO DEAL WITH FUNC_37 OF CIPARTICLEOBJECT, IAM NOT REALLY SURE WHATS ITS DOING COULD BE RELATED CURRENT NAV CELL.
YOU WILL HAVE TO CHECK IF THE OBJECT YOU RETURNING 0 FOR WAS THE ACTUAL FIREWORK YOU JUST CREATED
Code:
#if CONFIG_FIREWORKS_SCROLLS
vftableHook(0xDE1FE4, 37, addr_from_this(&CIParticleObj::Func_37_IMPL));
#endif
int CIParticleObj::Func_37_IMPL(int a2) {
return 0;
}
class CIParticleObj : public CICharactor {
GFX_DECLARE_DYNAMIC_EXISTING(CIParticleObj, 0xEEF6D0)
public:
int Func_37_IMPL(int a2);
};
SOURCES:
Code:
//
// Created by maximus on 1/27/2024.
//
#ifndef SRO_DEVKIT_FIREWORKS_H
#define SRO_DEVKIT_FIREWORKS_H
#include "BSLib/_internal/custom_stl.h"
#include "ICUser.h"
class Fireworks {
};
class CFireworks {
private:
static CFireworks* instance;
CFireworks();
CFireworks(const CFireworks&);
CFireworks& operator=(const CFireworks&);
public:
static CFireworks& getInstance();
public:
void DrawSmileyFaceIcon(int size, CICUser* pUser);
void DrawStarIcon(int size, CICUser* pUser);
void DrawLine(int size, CICUser* pUser);
void DrawHumanoidSilhouette(int size, CICUser* pUser);
void DrawWifiIcon(int size, int rings, float harmonyFactor, CICUser* pUser);
void DrawCircularGrid(int size, int circles, int divisions, CICUser* pUser);
void DrawRipple(int size, int circles, CICUser* pUser);
void DrawTwistedSpirals(int size, float twistiness, CICUser* pUser);
void DrawGeometricPattern(int size, int sides, CICUser* pUser);
void DrawConcentricCircles(int size, int circles, CICUser* pUser);
void DrawWave(int size, CICUser* pUser);
void DrawAbstractFlower(int size, int petals, CICUser* pUser);
void DrawSwirl(int size, int arms, CICUser* pUser);
void DrawSpirograph(int size, int circles, CICUser* pUser);
void DrawButterfly(int size, CICUser* pUser);
void DrawSpiral(int size, float tightness, CICUser* pUser);
void DrawRoseCurve(int size, CICUser* pUser);
void DrawHeart(int size, CICUser* pUser);
void Draw(int x, int z, CICUser* pUser);
public:
};
#endif//SRO_DEVKIT_FIREWORKS_H
Code:
//
// Created by maximus on 1/27/2024.
//
#include "Fireworks.h"
#include "CIParticleObj.h"
#include "EntityManagerClient.h"
#include <cmath>
CFireworks *CFireworks::instance = NULL;
CFireworks::CFireworks() {
}
CFireworks &CFireworks::getInstance() {
if (instance == NULL) {
instance = new CFireworks;
}
return *instance;
}
void CFireworks::Draw(int x, int z, CICUser* pUser) {
SObjectData *pObjectData;
pObjectData = new SObjectData();
pObjectData->nItemId = 69;
pObjectData->pHandler = pUser;
pUser->location.x += x;
pUser->location.z += z;
g_pGfxEttManager->CreateTemporaryObject(GFX_RUNTIME_CLASS(CIParticleObj), pObjectData);
pUser->location.x -= x;
pUser->location.z -= z;
delete[] pObjectData;
}
void CFireworks::DrawHeart(int size, CICUser* pUser) {
for (int angle = 0; angle <= 360; angle += 5) {
float radian = angle * 3.14159265358979323846 / 180.0;
float x = size * 16 * pow(sin(radian), 3) - 80;
float z = size * (13 * cos(radian) - 5 * cos(2 * radian) - 2 * cos(3 * radian) - cos(4 * radian));
Draw(x, z, pUser);
}
}
void CFireworks::DrawRoseCurve(int size, CICUser* pUser) {
for (int angle = 0; angle <= 360; angle += 5) {
float radian = angle * 3.14159265358979323846 / 180.0;
float x = size * cos(6 * radian) * cos(radian);
float z = size * cos(6 * radian) * sin(radian);
Draw(x, z, pUser);
}
}
void CFireworks::DrawSpiral(int size, float tightness, CICUser* pUser) {
for (float angle = 0.0; angle <= 10 * 3.14159265358979323846; angle += 0.1) {
float radius = size * exp(tightness * angle);
float x = radius * cos(angle);
float z = radius * sin(angle);
Draw(x, z, pUser);
}
}
void CFireworks::DrawButterfly(int size, CICUser* pUser) {
for (int angle = 0; angle <= 360; angle += 5) {
float radian = angle * 3.14159265358979323846 / 180.0;
float x = size * 8 * sin(radian) * (sin(radian) + sin(2 * radian));
float z = size * 8 * cos(radian) * (sin(radian) + sin(2 * radian));
Draw(x, z, pUser);
}
}
void CFireworks::DrawSpirograph(int size, int circles, CICUser* pUser) {
for (int angle = 0; angle <= 360; angle += 5) {
float radian = angle * 3.14159265358979323846 / 180.0;
float x = size * 8 * sin(2 * radian) * cos(circles * radian);
float z = size * 8 * sin(2 * radian) * sin(circles * radian);
Draw(x, z, pUser);
}
}
void CFireworks::DrawSwirl(int size, int arms, CICUser* pUser) {
for (int angle = 0; angle <= 360; angle += 5) {
float radian = angle * 3.14159265358979323846 / 180.0;
float x = size * 8 * sin(arms * radian) * cos(radian);
float z = size * 8 * sin(arms * radian) * sin(radian);
Draw(x, z, pUser);
}
}
void CFireworks::DrawAbstractFlower(int size, int petals, CICUser* pUser) {
for (int angle = 0; angle <= 360; angle += 5) {
float radian = angle * 3.14159265358979323846 / 180.0;
float x = size * 8 * sin(petals * radian) * cos(radian);
float z = size * 8 * sin(petals * radian) * sin(radian);
Draw(x, z, pUser);
}
}
void CFireworks::DrawWave(int size, CICUser* pUser) {
for (int angle = 0; angle <= 360; angle += 5) {
float radian = angle * 3.14159265358979323846 / 180.0;
float x = size * 8 * sin(radian);
float z = size * 8 * sin(2 * radian);
Draw(x, z, pUser);
}
}
void CFireworks::DrawConcentricCircles(int size, int circles, CICUser* pUser) {
for (int circle = 0; circle < circles; ++circle) {
float radius = size * 8 * circle / circles;
for (int angle = 0; angle <= 360; angle += 5) {
float radian = angle * 3.14159265358979323846 / 180.0;
float x = radius * cos(radian);
float z = radius * sin(radian);
Draw(x, z, pUser);
}
}
}
void CFireworks::DrawGeometricPattern(int size, int sides, CICUser* pUser) {
for (int angle = 0; angle <= 360; angle += 360 / sides) {
float radian = angle * 3.14159265358979323846 / 180.0;
float x = size * 8 * cos(radian);
float z = size * 8 * sin(radian);
Draw(x, z, pUser);
}
}
void CFireworks::DrawTwistedSpirals(int size, float twistiness, CICUser* pUser) {
for (int angle = 0; angle <= 360; angle += 5) {
float radian = angle * 3.14159265358979323846 / 180.0;
float x = size * 8 * sin(twistiness * radian) * cos(radian);
float z = size * 8 * sin(twistiness * radian) * sin(radian);
Draw(x, z, pUser);
}
}
void CFireworks::DrawRipple(int size, int circles, CICUser* pUser) {
for (int circle = 0; circle < circles; ++circle) {
float radius = size * 8 * circle / circles;
for (int angle = 0; angle <= 360; angle += 5) {
float radian = angle * 3.14159265358979323846 / 180.0;
float x = radius * cos(radian);
float z = radius * sin(radian);
Draw(x, z, pUser);
}
}
}
void CFireworks::DrawCircularGrid(int size, int circles, int divisions, CICUser* pUser) {
for (int circle = 0; circle < circles; ++circle) {
float radius = size * 8 * circle / circles;
for (int angle = 0; angle <= 360; angle += 360 / divisions) {
float radian = angle * 3.14159265358979323846 / 180.0;
float x = radius * cos(radian);
float z = radius * sin(radian);
Draw(x, z, pUser);
}
}
}
void CFireworks::DrawWifiIcon(int size, int rings, float harmonyFactor, CICUser* pUser) {
for (int ring = 0; ring < rings; ++ring) {
float radius = size * 8 * ring / rings;
for (int angle = 0; angle <= 360; angle += 10) {
float radian = angle * 3.14159265358979323846 / 180.0;
float x = radius * cos(harmonyFactor * radian);
float z = radius * sin(harmonyFactor * radian);
Draw(x, z, pUser);
}
}
}
void CFireworks::DrawHumanoidSilhouette(int size, CICUser* pUser) {
for (int angle = 0; angle <= 360; angle += 5) {
float radian = angle * 3.14159265358979323846 / 180.0;
float x = size * 8 * sin(radian) * cos(radian);
float z = size * 8 * (cos(radian) + 1) * sin(radian);
Draw(x, z, pUser);
}
}
void CFireworks::DrawLine(int size, CICUser* pUser) {
for (int y = -size * 8; y <= size * 8; y += 10) {
float x = 0.0;
float z = y;
Draw(x, z, pUser);
}
}
void CFireworks::DrawStarIcon(int size, CICUser* pUser) {
for (int angle = 0; angle <= 360; angle += 36) {
float radian = angle * 3.14159265358979323846 / 180.0;
float x = size * 8 * cos(radian);
float z = size * 8 * sin(radian);
Draw(x, z, pUser);
}
}
void CFireworks::DrawSmileyFaceIcon(int size, CICUser* pUser) {
for (int angle = 0; angle <= 360; angle += 10) {
float radian = angle * 3.14159265358979323846 / 180.0;
float x = size * 8 * cos(radian);
float z = size * 8 * sin(radian);
Draw(x, z, pUser);
}
// Draw the left eye
float eyeSize = size / 8;
float eyeX = -size / 3;
float eyeY = size / 4;
float eyeZ = size / 2 + 15;
Draw(eyeX - 8, eyeZ, pUser);
// Draw the right eye
eyeX = size / 3;
Draw(eyeX + 8, eyeZ, pUser);
// Draw the mouth
float mouthSize = size / 4;
float mouthY = -size / 4;
for (int angle = -180; angle <= 0; angle += 10) {
float radian = angle * 3.14159265358979323846 / 180.0;
float x = size * 8 * 0.7 * cos(radian);
float z = size * 8 * 0.3 * sin(radian);
Draw(x, z - 18, pUser);
}
}
Code:
CIObject *CEntityManagerClient::CreateTemporaryObject(const CGfxRuntimeClass &pType, SObjectData *pObjectData) {
return reinterpret_cast<CIObject * (__thiscall *)(CEntityManagerClient* , const CGfxRuntimeClass &pType, SObjectData*)>(0x00BA36D0)(this, pType, pObjectData);
}
Code:
#pragma once
#include "GFXMainFrame/EntityManager.h"
#include "ICUser.h"
struct SObjectData{
int nItemId;
CICUser* pHandler;
};
#pragma pack(push, 1)
class CEntityManagerClient : public CEntityManager
{
public:
char pad_0030[0xC]; //0x0030
bool m_blTempObjectsEnabled; //0x003C
public:
CIObject* CreateTemporaryObject(const CGfxRuntimeClass &pType, SObjectData* pObjectData);
};
#pragma pack(pop)
#define g_pGfxEttManager (*(CEntityManagerClient**)0x0110F7D8)
#define g_nLatestCreatedId (*reinterpret_cast<int*>(0x0110F864))
Code:
void CNetProcessIn::OnShowFireworks(CMsgStreamBuffer &msg) {
DWORD dwUniqueId = msg.Read<DWORD>();
BYTE btType = msg.Read<BYTE>();
CICUser *pUser = (CICUser *) GetCharacterObjectByID_MAYBE(dwUniqueId);
if (!pUser) {
msg.FlushRemaining();
return;
}
CFireworks &fireworks = CFireworks::getInstance();
switch (btType) {
case 0:
fireworks.DrawSpiral(5, 0.07, pUser);
break;
case 1:
fireworks.DrawHeart(2, pUser);
break;
case 2:
fireworks.DrawButterfly(10, pUser);
break;
case 3:
fireworks.DrawSpirograph(5, 5, pUser);
break;
case 4:
fireworks.DrawSwirl(7, 5, pUser);
break;
case 5:
fireworks.DrawAbstractFlower(10, 3, pUser);
break;
case 6:
fireworks.DrawWave(7, pUser);
break;
case 7:
fireworks.DrawConcentricCircles(10, 5, pUser);
break;
case 8:
fireworks.DrawGeometricPattern(5, 8, pUser);
break;
case 9:
fireworks.DrawTwistedSpirals(8, 1.5, pUser);
break;
case 10:
fireworks.DrawRipple(10, 8, pUser);
break;
case 11:
fireworks.DrawCircularGrid(10, 6, 12, pUser);
break;
case 12:
fireworks.DrawWifiIcon(10, 6, 0.5, pUser);
break;
case 13:
fireworks.DrawHumanoidSilhouette(5, pUser);
break;
case 14:
fireworks.DrawLine(10, pUser);
break;
case 15:
fireworks.DrawSmileyFaceIcon(10, pUser);
break;
}
}
REMEMBER THAT CREATETEMPORARYOBJECT FUNCTION RETURNS POINTER TO THE CREATED OBJECT.
CIPARTICLEOBJECT -> [0x790] HOW MANY MILLISECONDS TO KEEP THE FIREWORKS RUNNING FOR
CIPARTICLEOBJECT -> [0x794] HOW MANY MILLISECONDS BETWEEN EACH EXPLOSION






