From 9cbe8ed0698a4cf2a0e02b876511ca4e009528f8 Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Fri, 30 Oct 2026 04:42:44 +0000 Subject: [PATCH] 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). --- .../Contents/Effects/MapMagicZoneEffect.cpp | 103 ++++++++++++++++++ Source/Contents/Effects/MapMagicZoneEffect.h | 3 + 2 files changed, 106 insertions(+) diff --git a/Source/Contents/Effects/MapMagicZoneEffect.cpp b/Source/Contents/Effects/MapMagicZoneEffect.cpp index 35f8f9e7..bd24bb75 100644 --- a/Source/Contents/Effects/MapMagicZoneEffect.cpp +++ b/Source/Contents/Effects/MapMagicZoneEffect.cpp @@ -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 +// OFFSET: 0x00B6DCB0 +// FUNCTION: fn_19112 +void CMapMagicZoneEffect::AddSpinner(int kind) { + CParticle* particle = CreateParticle(reinterpret_cast(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(&particle->unknown_00C4) = 0.0f; + particle->alpha = 200; + particle->unknown_0054 = -0.5f; + } else if (kind == 1) { + particle->SetTexture("effect\\mjin.tga"); + *reinterpret_cast(&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::iterator it = this->spinners.begin(); it != this->spinners.end(); ++it) { + FreeParticle(*it); + } + this->spinners.clear(); + + for (std::vector::iterator it = this->petals.begin(); it != this->petals.end(); ++it) { + FreeParticle(*it); + } + this->petals.clear(); + + for (std::vector::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(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(&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(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(&particle->unknown_00C4) = static_cast(angle); + particle->unknown_0050 = 315; + particle->unknown_00C0 = 15.0f - (static_cast(row) + static_cast(row)); + particle->scale = static_cast(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() { diff --git a/Source/Contents/Effects/MapMagicZoneEffect.h b/Source/Contents/Effects/MapMagicZoneEffect.h index 41ef11bf..b45ff174 100644 --- a/Source/Contents/Effects/MapMagicZoneEffect.h +++ b/Source/Contents/Effects/MapMagicZoneEffect.h @@ -11,9 +11,12 @@ class CParticle; class CMapMagicZoneEffect : public CEffect { public: + void Slot01() override; void Slot03() override; void Slot04() override; + void Close() override; bool Slot06() override; + void AddSpinner(int kind); __declspec(noinline) void UpdateSpinner(CParticle* particle); /* 00CC */ vector3d previousInner;