From 2285a5fb67eec09d81bf246efab9a30653958cbb Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Fri, 30 Oct 2026 13:09:26 +0000 Subject: [PATCH] Decompile fn_03160 (CSkillAction_Direction::SpawnDirectionalEffect) Batch #5555 by Yommy: 0 byte-identical, 1 confirmed by peer review. - fn_03160 CSkillAction_Direction::SpawnDirectionalEffect: logic confirmed by peer review Peer-reviewed-by: ragnarok-clanker, willerthal Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). --- Source/Contents/Skills/SkillActionAlitea.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Source/Contents/Skills/SkillActionAlitea.cpp b/Source/Contents/Skills/SkillActionAlitea.cpp index b1b0c5588..d06be4529 100644 --- a/Source/Contents/Skills/SkillActionAlitea.cpp +++ b/Source/Contents/Skills/SkillActionAlitea.cpp @@ -460,6 +460,22 @@ void CSkillAction_ThunderingExpand::Slot17(CGameActor* source) { } // OFFSET: 0x005A5AC0 +// FUNCTION: fn_03160 +void CSkillAction_Direction::SpawnDirectionalEffect(CGameActor* source, CGameActor* target, std::string_view name) { + const float angle = ScreenAngle( + &source->render.position.x, &target->render.position.x, static_cast(g_modeMgr.GetGameMode())->camera->frame.view.values + ); + const int direction = this->GetDirection(angle); + if (!this->IsValidDirection(direction)) { + return; + } + + const bool flipped = direction == 1 || direction == 2; + if (CEffect* effect = g_effectMgr->Spawn(target->render.accountId, CEZ2STREffectMgr::GetInstance()->EffectId(name.data()), 0.0f, 0.0f, 0.0f, 0, -1, 0, 0)) { + effect->Slot26(flipped); + effect->Slot17(static_cast((static_cast(angle + (flipped ? -180.0f : 0.0f)) + 360) % 360)); + } +} // OFFSET: 0x005A5D20 // FUNCTION: fn_03161