mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-24 10:56:38 +01:00
Spell/Script: Egg Nog (#24007)
Closes #23996
(cherry picked from commit b60786a916)
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
--
|
||||
DELETE FROM `spell_script_names` WHERE `ScriptName`="spell_item_eggnog";
|
||||
INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES
|
||||
(21149,'spell_item_eggnog');
|
||||
@@ -4407,6 +4407,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);
|
||||
}
|
||||
};
|
||||
|
||||
// 277253 - Heart of Azeroth
|
||||
class spell_item_heart_of_azeroth : public AuraScript
|
||||
{
|
||||
@@ -4574,6 +4602,7 @@ void AddSC_item_spell_scripts()
|
||||
|
||||
RegisterSpellScript(spell_item_mad_alchemists_potion);
|
||||
RegisterSpellScript(spell_item_crazy_alchemists_potion);
|
||||
RegisterSpellScript(spell_item_eggnog);
|
||||
|
||||
RegisterAuraScript(spell_item_heart_of_azeroth);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user