aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/server/scripts/Spells/spell_item.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/server/scripts/Spells/spell_item.cpp b/src/server/scripts/Spells/spell_item.cpp
index ddfa1d0ea6a..de331cdeab2 100644
--- a/src/server/scripts/Spells/spell_item.cpp
+++ b/src/server/scripts/Spells/spell_item.cpp
@@ -4257,6 +4257,34 @@ class spell_item_crazy_alchemists_potion : public SpellScript
}
};
+enum Eggnog
+{
+ SPELL_EGG_NOG_REINDEER = 21936,
+ SPELL_EGG_NOG_SNOWMAN = 21980,
+};
+
+// 21149 - Egg Nog
+class spell_item_eggnog : public SpellScript
+{
+ PrepareSpellScript(spell_item_eggnog);
+
+ bool Validate(SpellInfo const* /*spellInfo*/) override
+ {
+ return ValidateSpellInfo({ SPELL_EGG_NOG_REINDEER, SPELL_EGG_NOG_SNOWMAN});
+ }
+
+ void HandleScript(SpellEffIndex /* effIndex */)
+ {
+ if (roll_chance_i(40))
+ GetCaster()->CastSpell(GetHitUnit(), roll_chance_i(50) ? SPELL_EGG_NOG_REINDEER : SPELL_EGG_NOG_SNOWMAN, GetCastItem());
+ }
+
+ void Register() override
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_item_eggnog::HandleScript, EFFECT_2, SPELL_EFFECT_INEBRIATE);
+ }
+};
+
void AddSC_item_spell_scripts()
{
// 23074 Arcanite Dragonling
@@ -4387,4 +4415,5 @@ void AddSC_item_spell_scripts()
RegisterSpellScript(spell_item_mad_alchemists_potion);
RegisterSpellScript(spell_item_crazy_alchemists_potion);
+ RegisterSpellScript(spell_item_eggnog);
}