fix(Spells/Druid): Moonglade Raiment 2-piece set bonus (#22148)

This commit is contained in:
avarishd
2025-07-29 16:00:00 +03:00
committed by GitHub
parent 2e1f848f09
commit 231a03d785
2 changed files with 59 additions and 0 deletions

View File

@@ -0,0 +1,3 @@
-- Moonglade Raiment 2 set
DELETE FROM `spell_script_names` WHERE `spell_id`=-774 AND `ScriptName`='spell_dru_rejuvenation_moonglade_2_set';
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES (-774, 'spell_dru_rejuvenation_moonglade_2_set');

View File

@@ -60,6 +60,7 @@ enum DruidSpells
SPELL_DRUID_ENRAGE = 5229,
SPELL_DRUID_ENRAGED_DEFENSE = 70725,
SPELL_DRUID_ITEM_T10_FERAL_4P_BONUS = 70726,
SPELL_DRUID_MOONGLADE_2P_BONUS = 37286
};
enum DruidIcons
@@ -1194,6 +1195,60 @@ class spell_dru_moonkin_form_passive_proc : public AuraScript
}
};
// -774 - Rejuvenation
class spell_dru_rejuvenation_moonglade_2_set : public AuraScript
{
PrepareAuraScript(spell_dru_rejuvenation_moonglade_2_set);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_DRUID_MOONGLADE_2P_BONUS });
}
bool Load() override
{
_casterGUID.Clear();
return true;
}
void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
if (Player* caster = ObjectAccessor::FindPlayer(GetCasterGUID()))
if (caster->HasAura(SPELL_DRUID_MOONGLADE_2P_BONUS))
{
Player* target = GetTarget()->ToPlayer();
if (!target)
return;
_casterGUID = GetCasterGUID();
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(SPELL_DRUID_MOONGLADE_2P_BONUS);
target->ApplyRatingMod(CR_DODGE, spellInfo->Effects[EFFECT_0].CalcValue(), true); // 35 rating
}
}
void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
if (_casterGUID)
{
Player* target = GetTarget()->ToPlayer();
if (!target)
return;
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(SPELL_DRUID_MOONGLADE_2P_BONUS);
target->ApplyRatingMod(CR_DODGE, spellInfo->Effects[EFFECT_0].CalcValue(), false); // 35 rating
}
}
void Register() override
{
AfterEffectApply += AuraEffectApplyFn(spell_dru_rejuvenation_moonglade_2_set::OnApply, EFFECT_0, SPELL_AURA_PERIODIC_HEAL, AURA_EFFECT_HANDLE_REAL);
AfterEffectRemove += AuraEffectRemoveFn(spell_dru_rejuvenation_moonglade_2_set::OnRemove, EFFECT_0, SPELL_AURA_PERIODIC_HEAL, AURA_EFFECT_HANDLE_REAL);
}
private:
ObjectGuid _casterGUID;
};
void AddSC_druid_spell_scripts()
{
RegisterSpellScript(spell_dru_bear_form_passive);
@@ -1229,4 +1284,5 @@ void AddSC_druid_spell_scripts()
RegisterSpellScript(spell_dru_t10_restoration_4p_bonus);
RegisterSpellScript(spell_dru_wild_growth);
RegisterSpellScript(spell_dru_moonkin_form_passive_proc);
RegisterSpellScript(spell_dru_rejuvenation_moonglade_2_set);
}