aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEridium <6587064+Killyana@users.noreply.github.com>2019-12-29 16:09:31 +0100
committerShauren <shauren.trinity@gmail.com>2021-12-19 15:48:29 +0100
commit2b27278516510bbe055f67bca9409fcf7bac40c7 (patch)
treeab373409b7b3fbde76fe123d86aee155d0c58776
parenta09d5d485404ce5ee976dbba74ab0b50f3a2bcde (diff)
Spell/Script: Egg Nog (#24007)
Closes #23996 (cherry picked from commit b60786a91610d2c841b4d61c360a2cdd97a49118)
-rw-r--r--sql/updates/world/master/2021_12_19_25_world_2019_12_29_00_world.sql4
-rw-r--r--src/server/scripts/Spells/spell_item.cpp29
2 files changed, 33 insertions, 0 deletions
diff --git a/sql/updates/world/master/2021_12_19_25_world_2019_12_29_00_world.sql b/sql/updates/world/master/2021_12_19_25_world_2019_12_29_00_world.sql
new file mode 100644
index 00000000000..9a71b45987a
--- /dev/null
+++ b/sql/updates/world/master/2021_12_19_25_world_2019_12_29_00_world.sql
@@ -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');
diff --git a/src/server/scripts/Spells/spell_item.cpp b/src/server/scripts/Spells/spell_item.cpp
index 82f42a2d496..8dc30ef57d5 100644
--- a/src/server/scripts/Spells/spell_item.cpp
+++ b/src/server/scripts/Spells/spell_item.cpp
@@ -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);
}