Decompile 3 functions in Source/Contents/Effects/MapMagicZoneEffect.cpp, Source/Contents/Effects/MapMagicZoneEffect.h

Batch #4737 by eAthena: 1 byte-identical, 2 confirmed by peer review.

- fn_19112 CMapMagicZoneEffect::AddSpinner: logic confirmed by peer review
- fn_19113 CMapMagicZoneEffect::Close: byte-identical
- fn_19114 CMapMagicZoneEffect::Slot01: logic confirmed by peer review

Peer-reviewed-by: youko, Lumen
Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes).
This commit is contained in:
ragnarok-clanker 2026-10-30 04:42:44 +00:00
commit 9cbe8ed069
2 changed files with 106 additions and 0 deletions

View file

@ -3,11 +3,114 @@
#include "Client/Mode/CGameMode.h"
#include "Client/Mode/ModeMgr.h"
#include "Contents/Camera/Camera.h"
#include "Contents/Effects/EffectMemoryMgr.h"
#include "Contents/Effects/Particle.h"
#include "Utility/Math/AffineMatrix.h"
#include <cstring>
// OFFSET: 0x00B6DCB0
// FUNCTION: fn_19112
void CMapMagicZoneEffect::AddSpinner(int kind) {
CParticle* particle = CreateParticle(reinterpret_cast<const vector3d*>(this->position), 5);
if (particle) {
particle->unknown_0004 = this->id;
particle->unknown_000C = 0;
particle->unknown_0010 = 0;
particle->unknown_0008 = 1;
if (kind == 0) {
particle->SetTexture("effect\\mjin2.tga");
*reinterpret_cast<float*>(&particle->unknown_00C4) = 0.0f;
particle->alpha = 200;
particle->unknown_0054 = -0.5f;
} else if (kind == 1) {
particle->SetTexture("effect\\mjin.tga");
*reinterpret_cast<float*>(&particle->unknown_00C4) = 45.0f;
particle->alpha = 50;
particle->unknown_0054 = -0.4f;
}
particle->scale = 30.0f;
particle->unknown_004C = 0;
InitParticleQuad(particle->vertices);
this->spinners.push_back(particle);
}
}
// OFFSET: 0x00B6E130
// FUNCTION: fn_19113
void CMapMagicZoneEffect::Close() {
for (std::vector<CParticle*>::iterator it = this->spinners.begin(); it != this->spinners.end(); ++it) {
FreeParticle(*it);
}
this->spinners.clear();
for (std::vector<CParticle*>::iterator it = this->petals.begin(); it != this->petals.end(); ++it) {
FreeParticle(*it);
}
this->petals.clear();
for (std::vector<CParticle*>::iterator it = this->ribbon.begin(); it != this->ribbon.end(); ++it) {
FreeParticle(*it);
}
this->ribbon.clear();
}
// OFFSET: 0x00B6E1D0
// FUNCTION: fn_19114
void CMapMagicZoneEffect::Slot01() {
this->AddSpinner(0);
this->AddSpinner(1);
int index = 0;
for (int angle = 0; angle < 360; angle += 180) {
CParticle* particle = CreateParticle(reinterpret_cast<const vector3d*>(this->position), 5);
if (particle) {
particle->unknown_0004 = this->id;
particle->unknown_000C = index;
particle->unknown_0010 = 0;
particle->unknown_0008 = 1;
particle->SetTexture("effect\\pikapika2.bmp");
particle->scale = 46.0f;
particle->unknown_004C = angle;
*reinterpret_cast<float*>(&particle->unknown_00C4) = 0.0f;
particle->alpha = 25;
particle->unknown_0054 = -1.0f;
InitParticleQuad(particle->vertices);
this->petals.push_back(particle);
}
++index;
}
int row = 0;
int angle = 0;
for (int height = 55; height > 40; height -= 5) {
for (int segment = 0; segment <= 21; ++segment) {
CParticle* particle = CreateParticle(reinterpret_cast<const vector3d*>(this->position), 5);
if (particle) {
particle->SetTexture("effect\\ring_blue.tga");
particle->unknown_0010 = row;
particle->unknown_0004 = this->id;
particle->unknown_000C = segment;
particle->unknown_0008 = 3;
particle->alpha = 50;
*reinterpret_cast<float*>(&particle->unknown_00C4) = static_cast<float>(angle);
particle->unknown_0050 = 315;
particle->unknown_00C0 = 15.0f - (static_cast<float>(row) + static_cast<float>(row));
particle->scale = static_cast<float>(row) * 0.2f + 12.9f;
particle->unknown_004C = height;
particle->unknown_0054 = 0.0f;
InitParticleQuad(particle->vertices);
this->ribbon.push_back(particle);
}
}
++row;
angle += 90;
}
}
// OFFSET: 0x00B6E3B0
// FUNCTION: fn_19115
bool CMapMagicZoneEffect::Slot06() {