diff --git a/Source/Contents/EffectResourceSwitcher.cpp b/Source/Contents/EffectResourceSwitcher.cpp index 3929701f..2726555c 100644 --- a/Source/Contents/EffectResourceSwitcher.cpp +++ b/Source/Contents/EffectResourceSwitcher.cpp @@ -1,6 +1,9 @@ #include "Contents/EffectResourceSwitcher.h" +#include "Contents/Actors/RenderObject.h" #include "Contents/Effects/Effect.h" +#include "Contents/Effects/EffectLists.h" #include "Contents/Effects/EffectPrimitiveState.h" +#include "Contents/World/World.h" #include #include @@ -10,6 +13,23 @@ template <> CEZ2STREffectMgr* Singleton::s_instance = nullptr; +// OFFSET: 0x005A2090 +// FUNCTION: fn_03082 +void EffectResourceSwitcher::RetireEffects() { + CRenderObject* actor = FindRenderObject(this->actor); + if (!actor) { + return; + } + + if (!this->sourceName.empty()) { + g_effectMgr->Retire(actor->render.accountId, CEZ2STREffectMgr::GetInstance()->EffectId(this->sourceName)); + } + + if (!this->targetName.empty()) { + g_effectMgr->Retire(actor->render.accountId, CEZ2STREffectMgr::GetInstance()->EffectId(this->targetName)); + } +} + // OFFSET: 0x005A2110 // FUNCTION: fn_03083 void CEffect::Slot10(int) { @@ -104,7 +124,7 @@ void CEffect::Slot14(int) { // OFFSET: 0x005A24D0 // FUNCTION: fn_03108 -void CEffect::Slot17(int) { +void CEffect::Slot17(float) { } // OFFSET: 0x005A24E0 diff --git a/Source/Contents/EffectResourceSwitcher.h b/Source/Contents/EffectResourceSwitcher.h index 4ea5cd1e..45da9c0c 100644 --- a/Source/Contents/EffectResourceSwitcher.h +++ b/Source/Contents/EffectResourceSwitcher.h @@ -33,6 +33,8 @@ public: /* 00F8 */ std::string targetName; void Slot16(int argument) override; + + void RetireEffects(); }; #if defined(_WIN32) && !defined(_WIN64) diff --git a/Source/Contents/Effects/Effect.h b/Source/Contents/Effects/Effect.h index 182bb758..1f5ed95b 100644 --- a/Source/Contents/Effects/Effect.h +++ b/Source/Contents/Effects/Effect.h @@ -36,7 +36,7 @@ public: virtual void Slot14(int argument); virtual void Slot15(int argument); virtual void Slot16(int) {} - virtual void Slot17(int argument); + virtual void Slot17(float argument); virtual void Slot18(int argument); virtual void Slot19(int argument); virtual void Slot20(int argument); diff --git a/Source/Contents/Skills/SkillInfo.cpp b/Source/Contents/Skills/SkillInfo.cpp index d2e3f6cc..26f29c38 100644 --- a/Source/Contents/Skills/SkillInfo.cpp +++ b/Source/Contents/Skills/SkillInfo.cpp @@ -1,10 +1,12 @@ #include "Client/Mode/ModeMgr.h" #include "Client/Mode/CGameMode.h" #include "Contents/Actors/GameActor.h" +#include "Contents/Configuration/ServiceOptions.h" #include "Contents/EffectResourceSwitcher.h" #include "Contents/Effects/EffectActor.h" #include "Contents/Effects/EffectLists.h" #include "Contents/Effects/EffectPrimitiveState.h" +#include "Contents/Effects/RagEffect.h" #include "Contents/MessageTable.h" #include "Contents/Skills/SkillId.h" #include "Contents/Skills/SkillInfo.h" @@ -15,6 +17,8 @@ #include "Script/LuaScript.h" +#include +#include #include class CEfstAction_ChangeSize : public CEfstAction { @@ -51,6 +55,7 @@ public: class CEfstAction_UNLIMIT : public CEfstAction { public: + void Slot00(int efstId, int value, int argument3, int argument4, CRenderObject* actor, bool flag) override; void Slot01(int efstId, int argument2, int argument3, int argument4, CRenderObject* actor) override; void Slot02(int efstId, int value, int argument3, int argument4, CRenderObject* actor) override; }; @@ -84,6 +89,7 @@ public: class CSkillAction_ABC_CHASING_BREAK : public CSkillAction { public: bool Slot07() override; + void Slot11(int level, CGameActor* source, CGameActor* target) override; void Slot16(int level, CGameActor* source, CGameActor* target) override; }; @@ -91,6 +97,7 @@ class CSkillAction_ABC_CHASING_SHOT : public CSkillAction { public: bool Slot07() override; void Slot08(int level, CGameActor* source) override; + void Slot11(int level, CGameActor* source, CGameActor* target) override; void Slot15(int level, CGameActor* source, CGameActor* target) override; void Slot16(int level, CGameActor* source, CGameActor* target) override; }; @@ -614,6 +621,19 @@ void CSkillAction_RA_UNLIMIT::Slot08(int level, CGameActor* source) { g_soundMgr->PlayWave("effect\\EF_BeginSpell.wav", 0.0f, 0.0f, 0.0f, 250, 40, 1.0f, 0); } +// OFFSET: 0x00775250 +// FUNCTION: fn_08337 +void CEfstAction_UNLIMIT::Slot00(int, int, int, int, CRenderObject* actor, bool) { + if (!actor) { + return; + } + + g_effectMgr->Spawn(actor->render.accountId, CEZ2STREffectMgr::GetInstance()->EffectId("unlimit_loop_bottom"), 0.0f, 0.0f, 0.0f, 0, -1, 0, 0); + if (!g_serviceOptions.Get(229)) { + g_effectMgr->Spawn(actor->render.accountId, CEZ2STREffectMgr::GetInstance()->EffectId("unlimit_loop"), 0.0f, 0.0f, 0.0f, 0, -1, 0, 0); + } +} + // OFFSET: 0x007756D0 // FUNCTION: fn_08339 void CEfstAction_UNLIMIT::Slot02(int efstId, int value, int argument3, int argument4, CRenderObject* actor) { @@ -914,6 +934,28 @@ void CSkillAction_ABC_CHASING_BREAK::Slot16(int level, CGameActor* source, CGame } } +// OFFSET: 0x00778150 +// FUNCTION: fn_08372 +void CSkillAction_ABC_CHASING_BREAK::Slot11(int level, CGameActor* source, CGameActor* target) { + if (!source || !target) { + return; + } + + if (CRagEffect* effect = static_cast(source)->LaunchEffect(2416, vector3d{0.0f, 0.0f, 0.0f}, 0.0f)) { + effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&target->render.position), 0, 0, 0, 0); + } + + for (int angle = 0; angle < 360; angle += 45) { + CEffect* effect = g_effectMgr->Spawn(target->render.accountId, CEZ2STREffectMgr::GetInstance()->EffectId("chasing_break"), 0.0f, 0.0f, 0.0f, 0, -1, 0, 0); + if (effect) { + effect->Slot17(static_cast(angle)); + effect->Slot16(std::max(0, std::rand() % 150)); + effect->Slot22(0.15f); + effect->Slot32(); + } + } +} + // OFFSET: 0x00778590 // FUNCTION: fn_08376 void CSkillAction_ABC_CHASING_SHOT::Slot08(int level, CGameActor* source) { @@ -927,6 +969,27 @@ void CSkillAction_ABC_CHASING_SHOT::Slot08(int level, CGameActor* source) { } } +// OFFSET: 0x00778830 +// FUNCTION: fn_08377 +void CSkillAction_ABC_CHASING_SHOT::Slot11(int level, CGameActor* source, CGameActor* target) { + if (!source || !target) { + return; + } + + if (CRagEffect* effect = static_cast(source)->LaunchEffect(2416, vector3d{0.0f, 0.0f, 0.0f}, 0.0f)) { + effect->SendMsg(nullptr, 14, 0, reinterpret_cast(&target->render.position), 0, 0, 0, 0); + } + + for (int angle = 0; angle < 360; angle += 45) { + CEffect* effect = g_effectMgr->Spawn(target->render.accountId, CEZ2STREffectMgr::GetInstance()->EffectId("chasing_shot_single"), 0.0f, 0.0f, 0.0f, 0, -1, 0, 0); + if (effect) { + effect->Slot17(static_cast(angle)); + effect->Slot22(0.15f); + effect->Slot32(); + } + } +} + // OFFSET: 0x00778AD0 // FUNCTION: fn_08378 void CSkillAction_ABC_CHASING_SHOT::Slot15(int level, CGameActor* source, CGameActor* target) {