From faa8dbf9d88e5c228bf68a6adb4c752fd3856545 Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Fri, 30 Oct 2026 04:53:26 +0000 Subject: [PATCH] Decompile 4 functions in Source/Contents/Effects/RedLineEffect.cpp, Source/Contents/Effects/RedLineEffect.h Batch #4730 by eAthena: 3 byte-identical, 1 confirmed by peer review. - fn_19134 CRedLineEffect::CreateLines: logic confirmed by peer review - fn_19135 CRedLineEffect::Close: byte-identical - fn_19136 CRedLineEffect::Slot01: byte-identical - fn_19137 CRedLineEffect::Slot06: byte-identical Peer-reviewed-by: youko, Millenium Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). --- Source/Contents/Effects/RedLineEffect.cpp | 67 +++++++++++++++++++++++ Source/Contents/Effects/RedLineEffect.h | 5 ++ 2 files changed, 72 insertions(+) diff --git a/Source/Contents/Effects/RedLineEffect.cpp b/Source/Contents/Effects/RedLineEffect.cpp index bd1ffea8..e7f0694c 100644 --- a/Source/Contents/Effects/RedLineEffect.cpp +++ b/Source/Contents/Effects/RedLineEffect.cpp @@ -1,8 +1,75 @@ #include "Contents/Effects/RedLineEffect.h" +#include "Contents/Effects/EffectMemoryMgr.h" #include "Contents/Effects/Particle.h" #include "Utility/Math/AffineMatrix.h" +#include +#include + +// OFFSET: 0x00B71770 +// FUNCTION: fn_19134 +void CRedLineEffect::CreateLines(int layer) { + int row = 0; + for (int angle = 0; angle < 360; angle += 90) { + const int life = std::max(rand() % 40, 0) + 60; + const float scale = static_cast(std::max(rand() % 11, 0)) * 0.015f + 0.15f; + const short direction = static_cast(std::max(rand() % 360, 0)); + const float directionX = g_cosTable[direction] * 5.0f; + const float directionZ = g_sinTable[direction] * 5.0f; + + for (int segment = 0; segment <= 21; ++segment) { + CParticle* particle = CreateParticle(reinterpret_cast(this->position), 5); + if (particle) { + particle->SetTexture("effect\\ring_red.tga"); + particle->unknown_0010 = row; + particle->unknown_0004 = this->id; + particle->unknown_000C = segment; + particle->unknown_0008 = 3; + particle->unknown_0050 = 360; + *reinterpret_cast(&particle->unknown_00C4) = static_cast(angle); + particle->alpha = 150; + particle->unknown_00C0 = 120.0f; + particle->unknown_004C = 90; + particle->scale = scale; + particle->unknown_00D0 = directionX; + particle->unknown_00D8 = directionZ; + particle->unknown_00D4 = 0.0f; + particle->unknown_00E8 = life; + particle->unknown_0054 = static_cast(layer); + InitParticleQuad(particle->vertices); + this->lines.push_back(particle); + } + } + + ++row; + } +} + +// OFFSET: 0x00B71B80 +// FUNCTION: fn_19135 +void CRedLineEffect::Close() { + for (std::vector::iterator it = this->lines.begin(); it != this->lines.end(); ++it) { + FreeParticle(*it); + } + + this->lines.clear(); +} + +// OFFSET: 0x00B71BC0 +// FUNCTION: fn_19136 +void CRedLineEffect::Slot01() { + this->CreateLines(0); + this->CreateLines(1); + this->unknown_002C = 75; +} + +// OFFSET: 0x00B71BE0 +// FUNCTION: fn_19137 +bool CRedLineEffect::Slot06() { + return !this->IsFinished(); +} + // OFFSET: 0x00B71EA0 // FUNCTION: fn_19138 void CRedLineEffect::Slot03() { diff --git a/Source/Contents/Effects/RedLineEffect.h b/Source/Contents/Effects/RedLineEffect.h index dd24d606..f2e3982a 100644 --- a/Source/Contents/Effects/RedLineEffect.h +++ b/Source/Contents/Effects/RedLineEffect.h @@ -11,8 +11,13 @@ class CParticle; class CRedLineEffect : public CEffect { public: + void Slot01() override; void Slot03() override; void Slot04() override; + void Close() override; + bool Slot06() override; + + void CreateLines(int layer); /* 00CC */ vector3d previousInner; /* 00D8 */ vector3d previousOuter;