From 41993b8a37df9b6c296a3c753311d71f92d847d5 Mon Sep 17 00:00:00 2001 From: killerwife Date: Sat, 7 Oct 2023 19:38:53 +0200 Subject: [PATCH] Spell/Druid: Implement almost all missing glyphs for druid --- sql/base/dbc/cmangos_fixes/Spell.sql | 9 +++++ sql/scriptdev2/spell.sql | 6 +++ .../Scripts/Scripting/ClassScripts/Druid.cpp | 40 ++++++++++++++++++- 3 files changed, 53 insertions(+), 2 deletions(-) diff --git a/sql/base/dbc/cmangos_fixes/Spell.sql b/sql/base/dbc/cmangos_fixes/Spell.sql index bf93626d137..48f513a9109 100644 --- a/sql/base/dbc/cmangos_fixes/Spell.sql +++ b/sql/base/dbc/cmangos_fixes/Spell.sql @@ -3471,6 +3471,15 @@ UPDATE spell_template SET EffectTriggerSpell1=69961 WHERE Id IN(58642); UPDATE spell_template SET EffectSpellClassMask1_1=0x08000000 WHERE Id IN(58620); -- glyph of death's embrace - wrong mask UPDATE spell_template SET EffectSpellClassMask1_1=0x00002000 WHERE Id IN(58620); +-- Druid glyphs +-- Glyph of Hurricane should not increase damage done by insect swarm +UPDATE spell_template SET Effect1=0 WHERE Id=54831; +-- Glyph of Rake - should not affect swipe bear +UPDATE spell_template SET EffectSpellClassMask1_2=0x00000000 WHERE Id IN(54821); +-- Glyph of Starfall - should proc on damage done +UPDATE spell_template SET ProcFlags=0x00001000 WHERE Id IN(54845); +-- Glyph of Rejuvenation - wrong mask and wrong flags +UPDATE spell_template SET EffectSpellClassMask1_2=0x00000000,EffectSpellClassMask1_1=0x00000010 WHERE Id IN(54754); -- ============================================================ -- Missing WotLK Achievement Spells diff --git a/sql/scriptdev2/spell.sql b/sql/scriptdev2/spell.sql index 3c307941d1a..8845764c23f 100644 --- a/sql/scriptdev2/spell.sql +++ b/sql/scriptdev2/spell.sql @@ -1489,6 +1489,12 @@ INSERT INTO spell_scripts(Id, ScriptName) VALUES (54743,'spell_glyph_of_regrowth'), (60137,'spell_nourish_heal_boost'), (50464,'spell_nourish'), +(61391,'spell_typhoon'), +(61390,'spell_typhoon'), +(61388,'spell_typhoon'), +(61387,'spell_typhoon'), +(53227,'spell_typhoon'), +(54845,'spell_glyph_of_starfire'), (40121,'spell_swift_flight_form_passive'); -- Rogue diff --git a/src/game/Spells/Scripts/Scripting/ClassScripts/Druid.cpp b/src/game/Spells/Scripts/Scripting/ClassScripts/Druid.cpp index 1721cc40c0a..2afddaf4a06 100644 --- a/src/game/Spells/Scripts/Scripting/ClassScripts/Druid.cpp +++ b/src/game/Spells/Scripts/Scripting/ClassScripts/Druid.cpp @@ -117,7 +117,7 @@ struct Brambles : public AuraScript } }; -// 1079 - Rip +// 5221 - Shred struct ShredDruid : public SpellScript { void OnHit(Spell* spell, SpellMissInfo missInfo) const override @@ -130,7 +130,7 @@ struct ShredDruid : public SpellScript if (Aura* rip = target->GetAura(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_DRUID, 0x0, 0x00200000, spell->GetCaster()->GetObjectGuid())) { int32 increaseAmount = glyphOfShred->GetAmount(); - int32 maxIncreaseAmount = spell->GetCaster()->CalculateSpellEffectValue(target, rip->GetSpellProto(), EFFECT_INDEX_1); + int32 maxIncreaseAmount = spell->GetCaster()->CalculateSpellEffectValue(target, glyphOfShred->GetSpellProto(), EFFECT_INDEX_1); if (rip->GetScriptValue() >= maxIncreaseAmount) return; SpellAuraHolder* holder = rip->GetHolder(); @@ -300,6 +300,40 @@ struct Nourish : public SpellScript } }; +// 61391 - Typhoon +struct GlyphOfTyphoon : public SpellScript +{ + void OnInit(Spell* spell) const override + { + // Glyph of Typhoon + if (spell->GetCaster()->HasAura(62135)) // does not knock back if glyphed + spell->SetEffectChance(0, EFFECT_INDEX_0); + } +}; + +// 54845 - Glyph of Starfire +struct GlyphOfStarfire : public AuraScript +{ + SpellAuraProcResult OnProc(Aura* aura, ProcExecutionData& procData) const override + { + if (Aura* moonfire = procData.victim->GetAura(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_DRUID, 0x00000002, 0, aura->GetTarget()->GetObjectGuid())) + { + int32 increaseAmount = aura->GetAmount(); + int32 maxIncreaseAmount = aura->GetTarget()->CalculateSpellEffectValue(procData.victim, aura->GetSpellProto(), EFFECT_INDEX_1); + if (moonfire->GetScriptValue() >= maxIncreaseAmount) + return; + SpellAuraHolder* holder = moonfire->GetHolder(); + holder->SetAuraMaxDuration(holder->GetAuraMaxDuration() + increaseAmount); + holder->SetAuraDuration(holder->GetAuraDuration() + increaseAmount); + holder->SendAuraUpdate(false); + moonfire->SetScriptValue(moonfire->GetScriptValue() + increaseAmount); + } + return SPELL_AURA_PROC_OK; + } +}; + +// TODO: Glyph of Entangling Roots + void LoadDruidScripts() { RegisterSpellScript("spell_regrowth"); @@ -317,4 +351,6 @@ void LoadDruidScripts() RegisterSpellScript("spell_glyph_of_regrowth"); RegisterSpellScript("spell_nourish_heal_boost"); RegisterSpellScript("spell_nourish"); + RegisterSpellScript("spell_typhoon"); + RegisterSpellScript("spell_glyph_of_starfire"); } \ No newline at end of file