Skip to content

Commit

Permalink
Spell/Druid: Implement almost all missing glyphs for druid
Browse files Browse the repository at this point in the history
  • Loading branch information
killerwife committed Oct 7, 2023
1 parent 69cc2cf commit 41993b8
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 2 deletions.
9 changes: 9 additions & 0 deletions sql/base/dbc/cmangos_fixes/Spell.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions sql/scriptdev2/spell.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
40 changes: 38 additions & 2 deletions src/game/Spells/Scripts/Scripting/ClassScripts/Druid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ struct Brambles : public AuraScript
}
};

// 1079 - Rip
// 5221 - Shred
struct ShredDruid : public SpellScript
{
void OnHit(Spell* spell, SpellMissInfo missInfo) const override
Expand All @@ -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();
Expand Down Expand Up @@ -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<Regrowth>("spell_regrowth");
Expand All @@ -317,4 +351,6 @@ void LoadDruidScripts()
RegisterSpellScript<GlyphOfRegrowth>("spell_glyph_of_regrowth");
RegisterSpellScript<NourishHealBoost>("spell_nourish_heal_boost");
RegisterSpellScript<Nourish>("spell_nourish");
RegisterSpellScript<GlyphOfTyphoon>("spell_typhoon");
RegisterSpellScript<GlyphOfStarfire>("spell_glyph_of_starfire");
}

0 comments on commit 41993b8

Please sign in to comment.