From a119f8fae938c593b79befd13d301f50963315f0 Mon Sep 17 00:00:00 2001 From: Ovahlord Date: Sat, 11 Apr 2020 10:27:10 +0200 Subject: [PATCH] Core/Spells: fixed displaying Swift Flight Form's speed bonus values --- .../world/4.3.4/2020_04_11_00_world.sql | 3 ++ src/server/scripts/Spells/spell_druid.cpp | 29 +++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 sql/updates/world/4.3.4/2020_04_11_00_world.sql diff --git a/sql/updates/world/4.3.4/2020_04_11_00_world.sql b/sql/updates/world/4.3.4/2020_04_11_00_world.sql new file mode 100644 index 0000000000..12d90fd3c7 --- /dev/null +++ b/sql/updates/world/4.3.4/2020_04_11_00_world.sql @@ -0,0 +1,3 @@ +DELETE FROM `spell_script_names` WHERE `ScriptName`= 'spell_dru_swift_flight_form'; +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(40120, 'spell_dru_swift_flight_form'); diff --git a/src/server/scripts/Spells/spell_druid.cpp b/src/server/scripts/Spells/spell_druid.cpp index 07c7b9ff2d..7b1af5c7f2 100644 --- a/src/server/scripts/Spells/spell_druid.cpp +++ b/src/server/scripts/Spells/spell_druid.cpp @@ -1045,6 +1045,34 @@ class spell_dru_flight_form : public SpellScript } }; +// 40120 - Swift Flight Form (Passive) +class spell_dru_swift_flight_form : public AuraScript +{ + PrepareAuraScript(spell_dru_swift_flight_form); + + bool Load() override + { + return GetCaster()->GetTypeId() == TYPEID_PLAYER; + } + + void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) + { + if (Player* caster = GetCaster()->ToPlayer()) + { + // the following values are sniffed but it is not clear how these values are actually being calculated since shapeshift auras usually don't do that. + if (caster->GetSkillValue(SKILL_RIDING) >= 375) + amount = 240; + else + amount = 239; + } + } + + void Register() override + { + DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_dru_swift_flight_form::CalculateAmount, EFFECT_0, SPELL_AURA_MOD_SHAPESHIFT); + } +}; + // 5217 - Tiger's Fury class spell_dru_tiger_s_fury : public SpellScript { @@ -2058,6 +2086,7 @@ void AddSC_druid_spell_scripts() RegisterAuraScript(spell_dru_solar_beam); RegisterSpellAndAuraScriptPair(spell_dru_survival_instincts, spell_dru_survival_instincts_AuraScript); RegisterAuraScript(spell_dru_swift_flight_passive); + RegisterAuraScript(spell_dru_swift_flight_form); RegisterSpellScript(spell_dru_flight_form); RegisterSpellScript(spell_dru_tiger_s_fury); RegisterAuraScript(spell_dru_tree_of_life);