From 3315ee2f714fd6d3f20abba34cbf3a6ecd69936c Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Fri, 30 Oct 2026 07:37:30 +0000 Subject: [PATCH] Decompile 2 functions in Source/Contents/Effects/MeteorEffect.cpp Batch #5049 by Lumen: 0 byte-identical, 2 confirmed by peer review. - fn_07056 CMeteorEffect::Slot01: logic confirmed by peer review - fn_07058 CMeteorEffect::Slot03: logic confirmed by peer review Peer-reviewed-by: Yommy, youko, tayoba Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). --- Source/Contents/Effects/MeteorEffect.cpp | 109 +++++++++++++++++++++++ 1 file changed, 109 insertions(+) diff --git a/Source/Contents/Effects/MeteorEffect.cpp b/Source/Contents/Effects/MeteorEffect.cpp index 39e4934a..2d098c77 100644 --- a/Source/Contents/Effects/MeteorEffect.cpp +++ b/Source/Contents/Effects/MeteorEffect.cpp @@ -1,8 +1,14 @@ #include "Contents/Effects/SkillEffects.h" +#include "Client/Mode/CGameMode.h" +#include "Client/Mode/ModeMgr.h" #include "Contents/Effects/EffectMemoryMgr.h" #include "Contents/Effects/Particle.h" #include "Contents/Effects/SpriteParticle.h" +#include "Contents/MapSkyMgr.h" + +#include +#include // OFFSET: 0x007077D0 // FUNCTION: fn_07055 @@ -14,12 +20,115 @@ void CMeteorEffect::Close() { this->unknown_00CC.clear(); } +// OFFSET: 0x00707810 +// FUNCTION: fn_07056 +void CMeteorEffect::Slot01() { + switch (this->id) { + case 1099: + case 1111: { + const long long counts[6] = {0, 3, 3, 5, 5, 7}; + unsigned int level = this->unknown_00B0; + if (level > 5) { + level = 5; + } + + const long long count = counts[level]; + const int span = static_cast(count * 5); + const float halfSpan = static_cast(span) * g_depthAverageHalf; + const int spanPlus1 = span + 1; + + for (long long i = 0; i < count; ++i) { + vector3d pos; + const int r1 = spanPlus1 != 0 ? std::max(rand() % spanPlus1, 0) : 0; + pos.x = static_cast(r1) - halfSpan + this->position[0]; + pos.y = this->position[1]; + const int r2 = spanPlus1 != 0 ? std::max(rand() % spanPlus1, 0) : 0; + pos.z = static_cast(r2) - halfSpan + this->position[2]; + + CSpriteParticle* particle = static_cast(CreateSpriteParticle(&pos, 1)); + if (!particle) { + break; + } + + particle->unknown_0004 = this->id; + particle->unknown_000C = static_cast(i); + particle->unknown_0010 = 0; + particle->unknown_0008 = 1; + particle->SetSprite("이팩트\\su_lunaticcarrotbeat\\su_lunaticcarrotbeat.spr"); + particle->SetAction("이팩트\\su_lunaticcarrotbeat\\su_lunaticcarrotbeat.act"); + particle->unknown_00EC |= 0x200; + particle->frameDelay = 4.0f; + particle->depthOffset = 0.00015f; + particle->loopMode = 1; + if (this->id == 1099) { + particle->alpha = 100; + } + + this->unknown_00CC.push_back(particle); + } + break; + } + + case 1106: + case 1112: { + CSpriteParticle* particle = static_cast( + CreateSpriteParticle(reinterpret_cast(this->position), 1) + ); + if (!particle) { + return; + } + + particle->unknown_0004 = this->id; + particle->unknown_000C = 0; + particle->unknown_0010 = 0; + particle->unknown_0008 = 1; + particle->SetSprite("이팩트\\su_cn_meteor\\su_cn_meteor.spr"); + particle->SetAction("이팩트\\su_cn_meteor\\su_cn_meteor.act"); + particle->unknown_00EC |= 0x200; + particle->frameDelay = 4.0f; + particle->depthOffset = 0.00015f; + particle->loopMode = 1; + if (this->id == 1106) { + particle->alpha = 100; + } + + this->unknown_00CC.push_back(particle); + break; + } + + default: + break; + } +} + // OFFSET: 0x00707B40 // FUNCTION: fn_07057 bool CMeteorEffect::Slot06() { return !this->unknown_00CC.empty(); } +// OFFSET: 0x00707B50 +// FUNCTION: fn_07058 +void CMeteorEffect::Slot03() { + for (auto it = this->unknown_00CC.begin(); it != this->unknown_00CC.end(); ) { + CParticle* particle = *it; + if (particle->life == 0.0f || static_cast(particle->unknown_00E8) < particle->life * 60.0f) { + if (particle) { + CSpriteParticle* spriteParticle = static_cast(particle); + spriteParticle->UpdateFrame(); + if (static_cast(spriteParticle->frame) == *reinterpret_cast(&this->unknown_00D8)) { + g_modeMgr.GetGameMode()->SendMsg(122, 0, 0, 0, 0); + } + ++particle->unknown_00E8; + } + ++it; + } else { + FreeParticle(particle); + it = this->unknown_00CC.erase(it); + } + } +} + // OFFSET: 0x00707CA0 // FUNCTION: fn_07059 void CMeteorEffect::Slot04() {