From 6baf498a17aa2a193e5e2c5fea672c47c65b5b16 Mon Sep 17 00:00:00 2001 From: Ragelezz <69433539+Ragelezz@users.noreply.github.com> Date: Fri, 22 Oct 2021 14:40:57 +0300 Subject: [PATCH] fix(Core/Spells): Silithyst (#8656) --- .../rev_1634764926168630600.sql | 4 +++ src/server/game/Spells/SpellMgr.cpp | 7 ++++ src/server/scripts/Spells/spell_generic.cpp | 34 +++++++++++++++++++ 3 files changed, 45 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1634764926168630600.sql diff --git a/data/sql/updates/pending_db_world/rev_1634764926168630600.sql b/data/sql/updates/pending_db_world/rev_1634764926168630600.sql new file mode 100644 index 000000000..60adb6d94 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1634764926168630600.sql @@ -0,0 +1,4 @@ +INSERT INTO `version_db_world` (`sql_rev`) VALUES ('1634764926168630600'); + +DELETE FROM `spell_script_names` WHERE `spell_id`=29519 AND `ScriptName`='spell_silithyst'; +INSERT INTO `spell_script_names` VALUES (29519,'spell_silithyst'); diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index 516769cf3..cfb6bf3aa 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -7373,6 +7373,13 @@ void SpellMgr::LoadDbcDataCorrections() spellInfo->RangeIndex = 5; // 40yd }); + // 29519 - Silithyst + ApplySpellFix({ 29519 }, [](SpellEntry* spellInfo) + { + spellInfo->EffectApplyAuraName[0] = SPELL_AURA_MOD_DECREASE_SPEED; + spellInfo->EffectBasePoints[EFFECT_0] = -25; + }); + // Ulduar: Kologarn Focused Eyebeam Summon Trigger ApplySpellFix({ 63342 }, [](SpellEntry* spellInfo) { diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index 6a3fb2c6b..e4a499cdb 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -5447,8 +5447,42 @@ public: } }; +// 29519 - Silithyst +class spell_silithyst : public SpellScriptLoader +{ +public: + spell_silithyst() : SpellScriptLoader("spell_silithyst") {} + + class spell_silithyst_AuraScript : public AuraScript + { + PrepareAuraScript(spell_silithyst_AuraScript); + + void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + GetCaster()->SetPvP(true); + } + + void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + GetCaster()->SummonGameObject(181597, GetCaster()->GetPositionX(), GetCaster()->GetPositionY(), GetCaster()->GetPositionZ(), 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 10 * IN_MILLISECONDS * MINUTE); + } + + void Register() override + { + AfterEffectApply += AuraEffectApplyFn(spell_silithyst_AuraScript::OnApply, EFFECT_0, SPELL_AURA_MOD_DECREASE_SPEED, AURA_EFFECT_HANDLE_REAL); + AfterEffectRemove += AuraEffectRemoveFn(spell_silithyst_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_MOD_DECREASE_SPEED, AURA_EFFECT_HANDLE_REAL); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_silithyst_AuraScript(); + } +}; + void AddSC_generic_spell_scripts() { + new spell_silithyst(); new spell_gen_5000_gold(); new spell_gen_model_visible(); new spell_the_flag_of_ownership();