diff options
author | Vincent_Michael <Vincent_Michael@gmx.de> | 2014-01-24 19:48:15 +0100 |
---|---|---|
committer | Vincent_Michael <Vincent_Michael@gmx.de> | 2014-01-25 16:28:29 +0100 |
commit | c6650ecc7197aab566b30d74f42aff7e2be52bdd (patch) | |
tree | 1e2ad3daf00c0b1c31cad4fc0f1238bfff4a3b9f | |
parent | dcc20a7911bc865c4ba7a89e3969ca5df0867e0c (diff) |
Core/Spells: Move Pilgrims Bounty BuffFood in AuraScript (mimimi)
-rw-r--r-- | sql/updates/world/2014_01_24_00_world_spell_script_name.sql | 13 | ||||
-rw-r--r-- | src/server/game/Spells/Auras/SpellAuraEffects.cpp | 15 | ||||
-rw-r--r-- | src/server/scripts/Spells/spell_holiday.cpp | 61 |
3 files changed, 74 insertions, 15 deletions
diff --git a/sql/updates/world/2014_01_24_00_world_spell_script_name.sql b/sql/updates/world/2014_01_24_00_world_spell_script_name.sql new file mode 100644 index 00000000000..51030a39a85 --- /dev/null +++ b/sql/updates/world/2014_01_24_00_world_spell_script_name.sql @@ -0,0 +1,13 @@ +DELETE FROM `spell_script_names` WHERE `ScriptName` IN ( +'spell_gen_slow_roasted_turkey', +'spell_gen_cranberry_chutney', +'spell_gen_spice_bread_stuffing', +'spell_gen_pumpkin_pie', +'spell_gen_candied_sweet_potato' +); +INSERT INTO `spell_script_names` (`spell_id` ,`ScriptName`) VALUES +(65422, 'spell_gen_slow_roasted_turkey'), -- Slow-Roasted Turkey +(65420, 'spell_gen_cranberry_chutney'), -- Cranberry Chutney +(65419, 'spell_gen_spice_bread_stuffing'), -- Spice Bread Stuffing +(65421, 'spell_gen_pumpkin_pie'), -- Pumpkin Pie +(65418, 'spell_gen_candied_sweet_potato'); -- Candied Sweet Potato diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index e403bf34cc9..c769a0b6aea 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -5570,21 +5570,6 @@ void AuraEffect::HandlePeriodicTriggerSpellAuraTick(Unit* target, Unit* caster) case 46736: triggerSpellId = 46737; break; - case 65418: //Well Fed - Candied Sweet Potatoes - triggerSpellId = 65410; - break; - case 65419: //Well Fed - Spice Bread Stuffing - triggerSpellId = 65416; - break; - case 65420: //Well Fed - Cranberry Chutney - triggerSpellId = 65412; - break; - case 65421: //Well Fed - Pumpkin Pie - triggerSpellId = 65415; - break; - case 65422: //Well Fed - Slow-Roasted Turkey - triggerSpellId = 65414; - break; } break; } diff --git a/src/server/scripts/Spells/spell_holiday.cpp b/src/server/scripts/Spells/spell_holiday.cpp index bb84606dece..08aa19a4755 100644 --- a/src/server/scripts/Spells/spell_holiday.cpp +++ b/src/server/scripts/Spells/spell_holiday.cpp @@ -277,6 +277,61 @@ class spell_hallow_end_tricky_treat : public SpellScriptLoader } }; +enum PilgrimsBountyBuffFood +{ + // Pilgrims Bounty Buff Food + SPELL_WELL_FED_AP_TRIGGER = 65414, + SPELL_WELL_FED_ZM_TRIGGER = 65412, + SPELL_WELL_FED_HIT_TRIGGER = 65416, + SPELL_WELL_FED_HASTE_TRIGGER = 65410, + SPELL_WELL_FED_SPIRIT_TRIGGER = 65415 +}; + +class spell_pilgrims_bounty_buff_food : public SpellScriptLoader +{ + private: + uint32 _triggeredSpellId; + public: + spell_pilgrims_bounty_buff_food(const char* name, uint32 triggeredSpellId) : SpellScriptLoader(name), _triggeredSpellId(triggeredSpellId) { } + + class spell_pilgrims_bounty_buff_food_AuraScript : public AuraScript + { + PrepareAuraScript(spell_pilgrims_bounty_buff_food_AuraScript) + private: + uint32 _triggeredSpellId; + + public: + spell_pilgrims_bounty_buff_food_AuraScript(uint32 triggeredSpellId) : AuraScript(), _triggeredSpellId(triggeredSpellId) { } + + bool Load() + { + _handled = false; + return true; + } + + void HandleTriggerSpell(AuraEffect const* /*aurEff*/) + { + if (_handled) + return; + + _handled = true; + GetTarget()->CastSpell(GetTarget(), _triggeredSpellId, true); + } + + void Register() + { + OnEffectPeriodic += AuraEffectPeriodicFn(spell_pilgrims_bounty_buff_food_AuraScript::HandleTriggerSpell, EFFECT_2, SPELL_AURA_PERIODIC_TRIGGER_SPELL); + } + + bool _handled; + }; + + AuraScript* GetAuraScript() const + { + return new spell_pilgrims_bounty_buff_food_AuraScript(_triggeredSpellId); + } +}; + enum Mistletoe { SPELL_CREATE_MISTLETOE = 26206, @@ -396,6 +451,12 @@ void AddSC_holiday_spell_scripts() new spell_hallow_end_trick(); new spell_hallow_end_trick_or_treat(); new spell_hallow_end_tricky_treat(); + // Pilgrims Bounty + new spell_pilgrims_bounty_buff_food("spell_gen_slow_roasted_turkey", SPELL_WELL_FED_AP_TRIGGER); + new spell_pilgrims_bounty_buff_food("spell_gen_cranberry_chutney", SPELL_WELL_FED_ZM_TRIGGER); + new spell_pilgrims_bounty_buff_food("spell_gen_spice_bread_stuffing", SPELL_WELL_FED_HIT_TRIGGER); + new spell_pilgrims_bounty_buff_food("spell_gen_pumpkin_pie", SPELL_WELL_FED_SPIRIT_TRIGGER); + new spell_pilgrims_bounty_buff_food("spell_gen_candied_sweet_potato", SPELL_WELL_FED_HASTE_TRIGGER); // Winter Veil new spell_winter_veil_mistletoe(); new spell_winter_veil_px_238_winter_wondervolt(); |