aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts/Spells
diff options
context:
space:
mode:
authorVincent-Michael <Vincent_Michael@gmx.de>2014-09-27 05:16:23 +0200
committerVincent-Michael <Vincent_Michael@gmx.de>2014-09-27 05:23:46 +0200
commitda91ae1f225b711c916b180675886b31b2d2ebf4 (patch)
tree2a0cbd5fed64c19a0166874d31ae960f0920df89 /src/server/scripts/Spells
parenteb4ff759ecb844aceb0017c16b2732423f199b84 (diff)
parenteccc6e97ead56d79cf58904a9276c73feea028ee (diff)
Merge branch 'master' of github.com:TrinityCore/TrinityCore into 4.3.4
Conflicts: src/server/scripts/EasternKingdoms/ZulAman/instance_zulaman.cpp src/server/scripts/EasternKingdoms/zone_isle_of_queldanas.cpp src/server/scripts/Spells/spell_dk.cpp src/server/scripts/Spells/spell_druid.cpp src/server/scripts/Spells/spell_shaman.cpp src/server/scripts/Spells/spell_warrior.cpp
Diffstat (limited to 'src/server/scripts/Spells')
-rw-r--r--src/server/scripts/Spells/spell_dk.cpp61
-rw-r--r--src/server/scripts/Spells/spell_druid.cpp7
-rw-r--r--src/server/scripts/Spells/spell_generic.cpp36
-rw-r--r--src/server/scripts/Spells/spell_holiday.cpp373
-rw-r--r--src/server/scripts/Spells/spell_mage.cpp13
-rw-r--r--src/server/scripts/Spells/spell_paladin.cpp29
-rw-r--r--src/server/scripts/Spells/spell_pet.cpp31
-rw-r--r--src/server/scripts/Spells/spell_priest.cpp20
-rw-r--r--src/server/scripts/Spells/spell_quest.cpp6
-rw-r--r--src/server/scripts/Spells/spell_rogue.cpp48
-rw-r--r--src/server/scripts/Spells/spell_shaman.cpp5
-rw-r--r--src/server/scripts/Spells/spell_warlock.cpp5
-rw-r--r--src/server/scripts/Spells/spell_warrior.cpp14
13 files changed, 586 insertions, 62 deletions
diff --git a/src/server/scripts/Spells/spell_dk.cpp b/src/server/scripts/Spells/spell_dk.cpp
index cacd480ceb0..638538872e8 100644
--- a/src/server/scripts/Spells/spell_dk.cpp
+++ b/src/server/scripts/Spells/spell_dk.cpp
@@ -78,6 +78,13 @@ class spell_dk_anti_magic_shell_raid : public SpellScriptLoader
{
PrepareAuraScript(spell_dk_anti_magic_shell_raid_AuraScript);
+ public:
+ spell_dk_anti_magic_shell_raid_AuraScript()
+ {
+ absorbPct = 0;
+ }
+
+ private:
uint32 absorbPct;
bool Load() override
@@ -120,6 +127,14 @@ class spell_dk_anti_magic_shell_self : public SpellScriptLoader
{
PrepareAuraScript(spell_dk_anti_magic_shell_self_AuraScript);
+ public:
+ spell_dk_anti_magic_shell_self_AuraScript()
+ {
+ absorbPct = 0;
+ hpPct = 0;
+ }
+
+ private:
uint32 absorbPct, hpPct;
bool Load() override
{
@@ -177,6 +192,13 @@ class spell_dk_anti_magic_zone : public SpellScriptLoader
{
PrepareAuraScript(spell_dk_anti_magic_zone_AuraScript);
+ public:
+ spell_dk_anti_magic_zone_AuraScript()
+ {
+ absorbPct = 0;
+ }
+
+ private:
uint32 absorbPct;
bool Load() override
@@ -228,6 +250,13 @@ class spell_dk_blood_boil : public SpellScriptLoader
{
PrepareSpellScript(spell_dk_blood_boil_SpellScript);
+ public:
+ spell_dk_blood_boil_SpellScript()
+ {
+ _executed = false;
+ }
+
+ private:
bool Validate(SpellInfo const* /*spellInfo*/) override
{
if (!sSpellMgr->GetSpellInfo(SPELL_DK_BLOOD_BOIL_TRIGGERED))
@@ -237,7 +266,6 @@ class spell_dk_blood_boil : public SpellScriptLoader
bool Load() override
{
- _executed = false;
return GetCaster()->GetTypeId() == TYPEID_PLAYER && GetCaster()->getClass() == CLASS_DEATH_KNIGHT;
}
@@ -274,16 +302,17 @@ class spell_dk_blood_gorged : public SpellScriptLoader
{
PrepareAuraScript(spell_dk_blood_gorged_AuraScript);
- bool Validate(SpellInfo const* /*spellInfo*/) override
+ public:
+ spell_dk_blood_gorged_AuraScript()
{
- if (!sSpellMgr->GetSpellInfo(SPELL_DK_BLOOD_GORGED_HEAL))
- return false;
- return true;
+ _procTarget = nullptr;
}
- bool Load() override
+ private:
+ bool Validate(SpellInfo const* /*spellInfo*/) override
{
- _procTarget = NULL;
+ if (!sSpellMgr->GetSpellInfo(SPELL_DK_BLOOD_GORGED_HEAL))
+ return false;
return true;
}
@@ -1192,6 +1221,14 @@ class spell_dk_raise_dead : public SpellScriptLoader
{
PrepareSpellScript(spell_dk_raise_dead_SpellScript);
+ public:
+ spell_dk_raise_dead_SpellScript()
+ {
+ _result = SPELL_CAST_OK;
+ _corpse = false;
+ }
+
+ private:
bool Validate(SpellInfo const* spellInfo) override
{
if (!sSpellMgr->GetSpellInfo(spellInfo->Effects[EFFECT_1].CalcValue())
@@ -1204,8 +1241,6 @@ class spell_dk_raise_dead : public SpellScriptLoader
bool Load() override
{
- _result = SPELL_CAST_OK;
- _corpse = false;
return GetCaster()->GetTypeId() == TYPEID_PLAYER;
}
@@ -1387,14 +1422,16 @@ class spell_dk_scourge_strike : public SpellScriptLoader
class spell_dk_scourge_strike_SpellScript : public SpellScript
{
PrepareSpellScript(spell_dk_scourge_strike_SpellScript);
- float multiplier;
- bool Load() override
+ public:
+ spell_dk_scourge_strike_SpellScript()
{
multiplier = 1.0f;
- return true;
}
+ private:
+ float multiplier;
+
bool Validate(SpellInfo const* /*spellInfo*/) override
{
if (!sSpellMgr->GetSpellInfo(SPELL_DK_SCOURGE_STRIKE_TRIGGERED))
diff --git a/src/server/scripts/Spells/spell_druid.cpp b/src/server/scripts/Spells/spell_druid.cpp
index 9c04aaa7578..7049ad90a27 100644
--- a/src/server/scripts/Spells/spell_druid.cpp
+++ b/src/server/scripts/Spells/spell_druid.cpp
@@ -746,6 +746,13 @@ class spell_dru_savage_defense : public SpellScriptLoader
{
PrepareAuraScript(spell_dru_savage_defense_AuraScript);
+ public:
+ spell_dru_savage_defense_AuraScript()
+ {
+ absorbPct = 0;
+ }
+
+ private:
uint32 absorbPct;
bool Load() override
diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp
index db8a9a5ace2..225920aa2dc 100644
--- a/src/server/scripts/Spells/spell_generic.cpp
+++ b/src/server/scripts/Spells/spell_generic.cpp
@@ -47,6 +47,13 @@ class spell_gen_absorb0_hitlimit1 : public SpellScriptLoader
{
PrepareAuraScript(spell_gen_absorb0_hitlimit1_AuraScript);
+ public:
+ spell_gen_absorb0_hitlimit1_AuraScript()
+ {
+ limit = 0;
+ }
+
+ private:
uint32 limit;
bool Load() override
@@ -849,6 +856,13 @@ class spell_gen_clone_weapon_aura : public SpellScriptLoader
{
PrepareAuraScript(spell_gen_clone_weapon_auraScript);
+ public:
+ spell_gen_clone_weapon_auraScript()
+ {
+ prevItem = 0;
+ }
+
+ private:
bool Validate(SpellInfo const* /*spellInfo*/) override
{
if (!sSpellMgr->GetSpellInfo(SPELL_COPY_WEAPON_AURA) ||
@@ -861,12 +875,6 @@ class spell_gen_clone_weapon_aura : public SpellScriptLoader
return true;
}
- bool Load() override
- {
- prevItem = 0;
- return true;
- }
-
void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
Unit* caster = GetCaster();
@@ -1409,9 +1417,15 @@ class spell_gen_dungeon_credit : public SpellScriptLoader
{
PrepareSpellScript(spell_gen_dungeon_credit_SpellScript);
- bool Load() override
+ public:
+ spell_gen_dungeon_credit_SpellScript()
{
_handled = false;
+ }
+
+ private:
+ bool Load() override
+ {
return GetCaster()->GetTypeId() == TYPEID_UNIT;
}
@@ -2240,11 +2254,17 @@ class spell_gen_on_tournament_mount : public SpellScriptLoader
{
PrepareAuraScript(spell_gen_on_tournament_mount_AuraScript);
+ public:
+ spell_gen_on_tournament_mount_AuraScript()
+ {
+ _pennantSpellId = 0;
+ }
+
+ private:
uint32 _pennantSpellId;
bool Load() override
{
- _pennantSpellId = 0;
return GetCaster() && GetCaster()->GetTypeId() == TYPEID_PLAYER;
}
diff --git a/src/server/scripts/Spells/spell_holiday.cpp b/src/server/scripts/Spells/spell_holiday.cpp
index 85bf85fa2d2..2d993e771db 100644
--- a/src/server/scripts/Spells/spell_holiday.cpp
+++ b/src/server/scripts/Spells/spell_holiday.cpp
@@ -301,12 +301,9 @@ class spell_pilgrims_bounty_buff_food : public SpellScriptLoader
uint32 const _triggeredSpellId;
public:
- spell_pilgrims_bounty_buff_food_AuraScript(uint32 triggeredSpellId) : AuraScript(), _triggeredSpellId(triggeredSpellId) { }
-
- bool Load() override
+ spell_pilgrims_bounty_buff_food_AuraScript(uint32 triggeredSpellId) : AuraScript(), _triggeredSpellId(triggeredSpellId)
{
_handled = false;
- return true;
}
void HandleTriggerSpell(AuraEffect const* /*aurEff*/)
@@ -444,6 +441,365 @@ class spell_winter_veil_px_238_winter_wondervolt : public SpellScriptLoader
}
};
+enum RamBlaBla
+{
+ SPELL_GIDDYUP = 42924,
+ SPELL_RENTAL_RACING_RAM = 43883,
+ SPELL_RENTAL_RACING_RAM_AURA = 42146,
+ SPELL_RAM_LEVEL_NEUTRAL = 43310,
+ SPELL_RAM_TROT = 42992,
+ SPELL_RAM_CANTER = 42993,
+ SPELL_RAM_GALLOP = 42994,
+ SPELL_RAM_FATIGUE = 43052,
+ SPELL_EXHAUSTED_RAM = 43332,
+
+ // Quest
+ SPELL_BREWFEST_QUEST_SPEED_BUNNY_GREEN = 43345,
+ SPELL_BREWFEST_QUEST_SPEED_BUNNY_YELLOW = 43346,
+ SPELL_BREWFEST_QUEST_SPEED_BUNNY_RED = 43347
+};
+
+// 42924 - Giddyup!
+class spell_brewfest_giddyup : public SpellScriptLoader
+{
+ public:
+ spell_brewfest_giddyup() : SpellScriptLoader("spell_brewfest_giddyup") { }
+
+ class spell_brewfest_giddyup_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_brewfest_giddyup_AuraScript);
+
+ void OnChange(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
+ {
+ Unit* target = GetTarget();
+ if (!target->HasAura(SPELL_RENTAL_RACING_RAM))
+ {
+ target->RemoveAura(GetId());
+ return;
+ }
+
+ if (target->HasAura(SPELL_EXHAUSTED_RAM))
+ return;
+
+ switch (GetStackAmount())
+ {
+ case 1: // green
+ target->RemoveAura(SPELL_RAM_LEVEL_NEUTRAL);
+ target->RemoveAura(SPELL_RAM_CANTER);
+ target->CastSpell(target, SPELL_RAM_TROT, true);
+ break;
+ case 6: // yellow
+ target->RemoveAura(SPELL_RAM_TROT);
+ target->RemoveAura(SPELL_RAM_GALLOP);
+ target->CastSpell(target, SPELL_RAM_CANTER, true);
+ break;
+ case 11: // red
+ target->RemoveAura(SPELL_RAM_CANTER);
+ target->CastSpell(target, SPELL_RAM_GALLOP, true);
+ break;
+ default:
+ break;
+ }
+
+ if (GetTargetApplication()->GetRemoveMode() == AURA_REMOVE_BY_DEFAULT)
+ {
+ target->RemoveAura(SPELL_RAM_TROT);
+ target->CastSpell(target, SPELL_RAM_LEVEL_NEUTRAL, true);
+ }
+ }
+
+ void OnPeriodic(AuraEffect const* /*aurEff*/)
+ {
+ GetTarget()->RemoveAuraFromStack(GetId());
+ }
+
+ void Register() override
+ {
+ AfterEffectApply += AuraEffectApplyFn(spell_brewfest_giddyup_AuraScript::OnChange, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY, AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK);
+ OnEffectRemove += AuraEffectRemoveFn(spell_brewfest_giddyup_AuraScript::OnChange, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY, AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK);
+ OnEffectPeriodic += AuraEffectPeriodicFn(spell_brewfest_giddyup_AuraScript::OnPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
+ }
+ };
+
+ AuraScript* GetAuraScript() const override
+ {
+ return new spell_brewfest_giddyup_AuraScript();
+ }
+};
+
+// 43310 - Ram Level - Neutral
+// 42992 - Ram - Trot
+// 42993 - Ram - Canter
+// 42994 - Ram - Gallop
+class spell_brewfest_ram : public SpellScriptLoader
+{
+ public:
+ spell_brewfest_ram() : SpellScriptLoader("spell_brewfest_ram") { }
+
+ class spell_brewfest_ram_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_brewfest_ram_AuraScript);
+
+ void OnPeriodic(AuraEffect const* aurEff)
+ {
+ Unit* target = GetTarget();
+ if (target->HasAura(SPELL_EXHAUSTED_RAM))
+ return;
+
+ switch (GetId())
+ {
+ case SPELL_RAM_LEVEL_NEUTRAL:
+ if (Aura* aura = target->GetAura(SPELL_RAM_FATIGUE))
+ aura->ModStackAmount(-4);
+ break;
+ case SPELL_RAM_TROT: // green
+ if (Aura* aura = target->GetAura(SPELL_RAM_FATIGUE))
+ aura->ModStackAmount(-2);
+ if (aurEff->GetTickNumber() == 4)
+ target->CastSpell(target, SPELL_BREWFEST_QUEST_SPEED_BUNNY_GREEN, true);
+ break;
+ case SPELL_RAM_CANTER:
+ target->CastCustomSpell(SPELL_RAM_FATIGUE, SPELLVALUE_AURA_STACK, 1, target, TRIGGERED_FULL_MASK);
+ if (aurEff->GetTickNumber() == 4)
+ target->CastSpell(target, SPELL_BREWFEST_QUEST_SPEED_BUNNY_YELLOW, true);
+ break;
+ case SPELL_RAM_GALLOP:
+ target->CastCustomSpell(SPELL_RAM_FATIGUE, SPELLVALUE_AURA_STACK, target->HasAura(SPELL_RAM_FATIGUE) ? 4 : 5 /*Hack*/, target, TRIGGERED_FULL_MASK);
+ if (aurEff->GetTickNumber() == 4)
+ target->CastSpell(target, SPELL_BREWFEST_QUEST_SPEED_BUNNY_RED, true);
+ break;
+ default:
+ break;
+ }
+
+ }
+
+ void Register() override
+ {
+ OnEffectPeriodic += AuraEffectPeriodicFn(spell_brewfest_ram_AuraScript::OnPeriodic, EFFECT_1, SPELL_AURA_PERIODIC_DUMMY);
+ }
+ };
+
+ AuraScript* GetAuraScript() const override
+ {
+ return new spell_brewfest_ram_AuraScript();
+ }
+};
+
+// 43052 - Ram Fatigue
+class spell_brewfest_ram_fatigue : public SpellScriptLoader
+{
+ public:
+ spell_brewfest_ram_fatigue() : SpellScriptLoader("spell_brewfest_ram_fatigue") { }
+
+ class spell_brewfest_ram_fatigue_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_brewfest_ram_fatigue_AuraScript);
+
+ void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
+ {
+ Unit* target = GetTarget();
+
+ if (GetStackAmount() == 101)
+ {
+ target->RemoveAura(SPELL_RAM_LEVEL_NEUTRAL);
+ target->RemoveAura(SPELL_RAM_TROT);
+ target->RemoveAura(SPELL_RAM_CANTER);
+ target->RemoveAura(SPELL_RAM_GALLOP);
+ target->RemoveAura(SPELL_GIDDYUP);
+
+ target->CastSpell(target, SPELL_EXHAUSTED_RAM, true);
+ }
+ }
+
+ void Register() override
+ {
+ AfterEffectApply += AuraEffectApplyFn(spell_brewfest_ram_fatigue_AuraScript::OnApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK);
+ }
+ };
+
+ AuraScript* GetAuraScript() const override
+ {
+ return new spell_brewfest_ram_fatigue_AuraScript();
+ }
+};
+
+// 43450 - Brewfest - apple trap - friendly DND
+class spell_brewfest_apple_trap : public SpellScriptLoader
+{
+ public:
+ spell_brewfest_apple_trap() : SpellScriptLoader("spell_brewfest_apple_trap") { }
+
+ class spell_brewfest_apple_trap_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_brewfest_apple_trap_AuraScript);
+
+ void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
+ {
+ GetTarget()->RemoveAura(SPELL_RAM_FATIGUE);
+ }
+
+ void Register() override
+ {
+ OnEffectApply += AuraEffectApplyFn(spell_brewfest_apple_trap_AuraScript::OnApply, EFFECT_0, SPELL_AURA_FORCE_REACTION, AURA_EFFECT_HANDLE_REAL);
+ }
+ };
+
+ AuraScript* GetAuraScript() const override
+ {
+ return new spell_brewfest_apple_trap_AuraScript();
+ }
+};
+
+// 43332 - Exhausted Ram
+class spell_brewfest_exhausted_ram : public SpellScriptLoader
+{
+ public:
+ spell_brewfest_exhausted_ram() : SpellScriptLoader("spell_brewfest_exhausted_ram") { }
+
+ class spell_brewfest_exhausted_ram_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_brewfest_exhausted_ram_AuraScript);
+
+ void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
+ {
+ Unit* target = GetTarget();
+ target->CastSpell(target, SPELL_RAM_LEVEL_NEUTRAL, true);
+ }
+
+ void Register() override
+ {
+ OnEffectRemove += AuraEffectApplyFn(spell_brewfest_exhausted_ram_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_MOD_DECREASE_SPEED, AURA_EFFECT_HANDLE_REAL);
+ }
+ };
+
+ AuraScript* GetAuraScript() const override
+ {
+ return new spell_brewfest_exhausted_ram_AuraScript();
+ }
+};
+
+// 43714 - Brewfest - Relay Race - Intro - Force - Player to throw- DND
+class spell_brewfest_relay_race_intro_force_player_to_throw : public SpellScriptLoader
+{
+ public:
+ spell_brewfest_relay_race_intro_force_player_to_throw() : SpellScriptLoader("spell_brewfest_relay_race_intro_force_player_to_throw") { }
+
+ class spell_brewfest_relay_race_intro_force_player_to_throw_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_brewfest_relay_race_intro_force_player_to_throw_SpellScript);
+
+ void HandleForceCast(SpellEffIndex effIndex)
+ {
+ PreventHitDefaultEffect(effIndex);
+ // All this spells trigger a spell that requires reagents; if the
+ // triggered spell is cast as "triggered", reagents are not consumed
+ GetHitUnit()->CastSpell((Unit*)NULL, GetSpellInfo()->Effects[effIndex].TriggerSpell, TriggerCastFlags(TRIGGERED_FULL_MASK & ~TRIGGERED_IGNORE_POWER_AND_REAGENT_COST));
+ }
+
+ void Register() override
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_brewfest_relay_race_intro_force_player_to_throw_SpellScript::HandleForceCast, EFFECT_0, SPELL_EFFECT_FORCE_CAST);
+ }
+ };
+
+ SpellScript* GetSpellScript() const override
+ {
+ return new spell_brewfest_relay_race_intro_force_player_to_throw_SpellScript();
+ }
+};
+
+// 43876 - Dismount Ram
+class spell_brewfest_dismount_ram : public SpellScriptLoader
+{
+ public:
+ spell_brewfest_dismount_ram() : SpellScriptLoader("spell_brewfest_dismount_ram") { }
+
+ class spell_brewfest_relay_race_intro_force_player_to_throw_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_brewfest_relay_race_intro_force_player_to_throw_SpellScript);
+
+ void HandleScript(SpellEffIndex /*effIndex*/)
+ {
+ GetCaster()->RemoveAura(SPELL_RENTAL_RACING_RAM);
+ }
+
+ void Register() override
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_brewfest_relay_race_intro_force_player_to_throw_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
+ }
+ };
+
+ SpellScript* GetSpellScript() const override
+ {
+ return new spell_brewfest_relay_race_intro_force_player_to_throw_SpellScript();
+ }
+};
+
+enum RamBlub
+{
+ QUEST_BARK_FOR_DROHNS_DISTILLERY = 11407,
+ QUEST_BARK_FOR_TCHALIS_VOODOO_BREWERY = 11408,
+
+ SAY_DROHN_DISTILLERY_1 = 23520,
+ SAY_DROHN_DISTILLERY_2 = 23521,
+ SAY_DROHN_DISTILLERY_3 = 23522,
+ SAY_DROHN_DISTILLERY_4 = 23523,
+
+ SAY_TCHALIS_VOODOO_1 = 23524,
+ SAY_TCHALIS_VOODOO_2 = 23525,
+ SAY_TCHALIS_VOODOO_3 = 23526,
+ SAY_TCHALIS_VOODOO_4 = 23527
+};
+
+// 43259 Brewfest - Barker Bunny 1
+// 43260 Brewfest - Barker Bunny 2
+// 43261 Brewfest - Barker Bunny 3
+// 43262 Brewfest - Barker Bunny 4
+class spell_brewfest_barker_bunny : public SpellScriptLoader
+{
+ public:
+ spell_brewfest_barker_bunny() : SpellScriptLoader("spell_brewfest_barker_bunny") { }
+
+ class spell_brewfest_barker_bunny_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_brewfest_barker_bunny_AuraScript);
+
+ bool Load() override
+ {
+ return GetUnitOwner()->GetTypeId() == TYPEID_PLAYER;
+ }
+
+ void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
+ {
+ Player* target = GetTarget()->ToPlayer();
+
+ uint32 BroadcastTextId = 0;
+
+ if (target->GetQuestStatus(QUEST_BARK_FOR_DROHNS_DISTILLERY) == QUEST_STATUS_INCOMPLETE ||
+ target->GetQuestStatus(QUEST_BARK_FOR_DROHNS_DISTILLERY) == QUEST_STATUS_COMPLETE)
+ BroadcastTextId = RAND(SAY_DROHN_DISTILLERY_1, SAY_DROHN_DISTILLERY_2, SAY_DROHN_DISTILLERY_3, SAY_DROHN_DISTILLERY_4);
+
+ if (target->GetQuestStatus(QUEST_BARK_FOR_TCHALIS_VOODOO_BREWERY) == QUEST_STATUS_INCOMPLETE ||
+ target->GetQuestStatus(QUEST_BARK_FOR_TCHALIS_VOODOO_BREWERY) == QUEST_STATUS_COMPLETE)
+ BroadcastTextId = RAND(SAY_TCHALIS_VOODOO_1, SAY_TCHALIS_VOODOO_2, SAY_TCHALIS_VOODOO_3, SAY_TCHALIS_VOODOO_4);
+
+ if (BroadcastTextId)
+ target->Talk(BroadcastTextId, CHAT_MSG_SAY, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY), target);
+ }
+
+ void Register() override
+ {
+ OnEffectApply += AuraEffectApplyFn(spell_brewfest_barker_bunny_AuraScript::OnApply, EFFECT_1, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
+ }
+ };
+
+ AuraScript* GetAuraScript() const override
+ {
+ return new spell_brewfest_barker_bunny_AuraScript();
+ }
+};
+
void AddSC_holiday_spell_scripts()
{
// Love is in the Air
@@ -461,4 +817,13 @@ void AddSC_holiday_spell_scripts()
// Winter Veil
new spell_winter_veil_mistletoe();
new spell_winter_veil_px_238_winter_wondervolt();
+ // Brewfest
+ new spell_brewfest_giddyup();
+ new spell_brewfest_ram();
+ new spell_brewfest_ram_fatigue();
+ new spell_brewfest_apple_trap();
+ new spell_brewfest_exhausted_ram();
+ new spell_brewfest_relay_race_intro_force_player_to_throw();
+ new spell_brewfest_dismount_ram();
+ new spell_brewfest_barker_bunny();
}
diff --git a/src/server/scripts/Spells/spell_mage.cpp b/src/server/scripts/Spells/spell_mage.cpp
index d72c6d5c775..17c72ba5561 100644
--- a/src/server/scripts/Spells/spell_mage.cpp
+++ b/src/server/scripts/Spells/spell_mage.cpp
@@ -537,16 +537,17 @@ class spell_mage_focus_magic : public SpellScriptLoader
{
PrepareAuraScript(spell_mage_focus_magic_AuraScript);
- bool Validate(SpellInfo const* /*spellInfo*/) override
+ public:
+ spell_mage_focus_magic_AuraScript()
{
- if (!sSpellMgr->GetSpellInfo(SPELL_MAGE_FOCUS_MAGIC_PROC))
- return false;
- return true;
+ _procTarget = nullptr;
}
- bool Load() override
+ private:
+ bool Validate(SpellInfo const* /*spellInfo*/) override
{
- _procTarget = NULL;
+ if (!sSpellMgr->GetSpellInfo(SPELL_MAGE_FOCUS_MAGIC_PROC))
+ return false;
return true;
}
diff --git a/src/server/scripts/Spells/spell_paladin.cpp b/src/server/scripts/Spells/spell_paladin.cpp
index e6ad3e83477..1dab620a9c7 100644
--- a/src/server/scripts/Spells/spell_paladin.cpp
+++ b/src/server/scripts/Spells/spell_paladin.cpp
@@ -88,6 +88,14 @@ class spell_pal_ardent_defender : public SpellScriptLoader
{
PrepareAuraScript(spell_pal_ardent_defender_AuraScript);
+ public:
+ spell_pal_ardent_defender_AuraScript()
+ {
+ absorbPct = 0;
+ healPct = 0;
+ }
+
+ private:
uint32 absorbPct, healPct;
enum Spell
@@ -459,6 +467,13 @@ class spell_pal_divine_storm : public SpellScriptLoader
{
PrepareSpellScript(spell_pal_divine_storm_SpellScript);
+ public:
+ spell_pal_divine_storm_SpellScript()
+ {
+ healPct = 0;
+ }
+
+ private:
uint32 healPct;
bool Validate(SpellInfo const* /*spellInfo*/) override
@@ -502,6 +517,13 @@ class spell_pal_divine_storm_dummy : public SpellScriptLoader
{
PrepareSpellScript(spell_pal_divine_storm_dummy_SpellScript);
+ public:
+ spell_pal_divine_storm_dummy_SpellScript()
+ {
+ _targetCount = 0;
+ }
+
+ private:
bool Validate(SpellInfo const* /*spellInfo*/) override
{
if (!sSpellMgr->GetSpellInfo(SPELL_PALADIN_DIVINE_STORM_HEAL))
@@ -693,6 +715,13 @@ class spell_pal_hand_of_sacrifice : public SpellScriptLoader
{
PrepareAuraScript(spell_pal_hand_of_sacrifice_AuraScript);
+ public:
+ spell_pal_hand_of_sacrifice_AuraScript()
+ {
+ remainingAmount = 0;
+ }
+
+ private:
int32 remainingAmount;
bool Load() override
diff --git a/src/server/scripts/Spells/spell_pet.cpp b/src/server/scripts/Spells/spell_pet.cpp
index f8466eb1f74..9fd55ae057e 100644
--- a/src/server/scripts/Spells/spell_pet.cpp
+++ b/src/server/scripts/Spells/spell_pet.cpp
@@ -229,11 +229,17 @@ public:
{
PrepareAuraScript(spell_warl_pet_scaling_01_AuraScript);
+ public:
+ spell_warl_pet_scaling_01_AuraScript()
+ {
+ _tempBonus = 0;
+ }
+
+ private:
bool Load() override
{
if (!GetCaster() || !GetCaster()->GetOwner() || GetCaster()->GetOwner()->GetTypeId() != TYPEID_PLAYER)
return false;
- _tempBonus = 0;
return true;
}
@@ -366,11 +372,17 @@ public:
{
PrepareAuraScript(spell_warl_pet_scaling_02_AuraScript);
+ public:
+ spell_warl_pet_scaling_02_AuraScript()
+ {
+ _tempBonus = 0;
+ }
+
+ private:
bool Load() override
{
if (!GetCaster() || !GetCaster()->GetOwner() || GetCaster()->GetOwner()->GetTypeId() != TYPEID_PLAYER)
return false;
- _tempBonus = 0;
return true;
}
@@ -880,6 +892,13 @@ public:
{
PrepareAuraScript(spell_hun_pet_scaling_01_AuraScript);
+ public:
+ spell_hun_pet_scaling_01_AuraScript()
+ {
+ _tempHealth = 0;
+ }
+
+ private:
void CalculateStaminaAmount(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/)
{
if (Unit* pet = GetUnitOwner())
@@ -1457,11 +1476,17 @@ public:
{
PrepareAuraScript(spell_dk_pet_scaling_01_AuraScript);
+ public:
+ spell_dk_pet_scaling_01_AuraScript()
+ {
+ _tempHealth = 0;
+ }
+
+ private:
bool Load() override
{
if (!GetCaster() || !GetCaster()->GetOwner() || GetCaster()->GetOwner()->GetTypeId() != TYPEID_PLAYER)
return false;
- _tempHealth = 0;
return true;
}
diff --git a/src/server/scripts/Spells/spell_priest.cpp b/src/server/scripts/Spells/spell_priest.cpp
index 0f78790bcee..8ec5450072f 100644
--- a/src/server/scripts/Spells/spell_priest.cpp
+++ b/src/server/scripts/Spells/spell_priest.cpp
@@ -465,6 +465,13 @@ class spell_pri_guardian_spirit : public SpellScriptLoader
{
PrepareAuraScript(spell_pri_guardian_spirit_AuraScript);
+ public:
+ spell_pri_guardian_spirit_AuraScript()
+ {
+ healPct = 0;
+ }
+
+ private:
uint32 healPct;
bool Validate(SpellInfo const* /*spellInfo*/) override
@@ -657,16 +664,17 @@ class spell_pri_mana_leech : public SpellScriptLoader
{
PrepareAuraScript(spell_pri_mana_leech_AuraScript);
- bool Validate(SpellInfo const* /*spellInfo*/) override
+ public:
+ spell_pri_mana_leech_AuraScript()
{
- if (!sSpellMgr->GetSpellInfo(SPELL_PRIEST_MANA_LEECH_PROC))
- return false;
- return true;
+ _procTarget = nullptr;
}
- bool Load() override
+ private:
+ bool Validate(SpellInfo const* /*spellInfo*/) override
{
- _procTarget = NULL;
+ if (!sSpellMgr->GetSpellInfo(SPELL_PRIEST_MANA_LEECH_PROC))
+ return false;
return true;
}
diff --git a/src/server/scripts/Spells/spell_quest.cpp b/src/server/scripts/Spells/spell_quest.cpp
index 9c65567fe7f..a59594935b5 100644
--- a/src/server/scripts/Spells/spell_quest.cpp
+++ b/src/server/scripts/Spells/spell_quest.cpp
@@ -2101,6 +2101,11 @@ class spell_q12641_death_comes_from_on_high : public SpellScriptLoader
};
// 52694 - Recall Eye of Acherus
+enum Recall_Eye_of_Acherus
+{
+ THE_EYE_OF_ACHERUS = 51852
+};
+
class spell_q12641_recall_eye_of_acherus : public SpellScriptLoader
{
public:
@@ -2116,6 +2121,7 @@ class spell_q12641_recall_eye_of_acherus : public SpellScriptLoader
{
player->StopCastingCharm();
player->StopCastingBindSight();
+ player->RemoveAura(THE_EYE_OF_ACHERUS);
}
}
diff --git a/src/server/scripts/Spells/spell_rogue.cpp b/src/server/scripts/Spells/spell_rogue.cpp
index 175a3c4f361..56010e275dc 100644
--- a/src/server/scripts/Spells/spell_rogue.cpp
+++ b/src/server/scripts/Spells/spell_rogue.cpp
@@ -68,16 +68,17 @@ class spell_rog_blade_flurry : public SpellScriptLoader
{
PrepareAuraScript(spell_rog_blade_flurry_AuraScript);
- bool Validate(SpellInfo const* /*spellInfo*/) override
+ public:
+ spell_rog_blade_flurry_AuraScript()
{
- if (!sSpellMgr->GetSpellInfo(SPELL_ROGUE_BLADE_FLURRY_EXTRA_ATTACK))
- return false;
- return true;
+ _procTarget = nullptr;
}
- bool Load() override
+ private:
+ bool Validate(SpellInfo const* /*spellInfo*/) override
{
- _procTarget = NULL;
+ if (!sSpellMgr->GetSpellInfo(SPELL_ROGUE_BLADE_FLURRY_EXTRA_ATTACK))
+ return false;
return true;
}
@@ -126,6 +127,13 @@ class spell_rog_cheat_death : public SpellScriptLoader
{
PrepareAuraScript(spell_rog_cheat_death_AuraScript);
+ public:
+ spell_rog_cheat_death_AuraScript()
+ {
+ absorbChance = 0;
+ }
+
+ private:
uint32 absorbChance;
bool Validate(SpellInfo const* /*spellInfo*/) override
@@ -253,9 +261,15 @@ class spell_rog_deadly_poison : public SpellScriptLoader
{
PrepareSpellScript(spell_rog_deadly_poison_SpellScript);
- bool Load() override
+ public:
+ spell_rog_deadly_poison_SpellScript()
{
_stackAmount = 0;
+ }
+
+ private:
+ bool Load() override
+ {
// at this point CastItem must already be initialized
return GetCaster()->GetTypeId() == TYPEID_PLAYER && GetCastItem();
}
@@ -487,6 +501,13 @@ class spell_rog_nerves_of_steel : public SpellScriptLoader
{
PrepareAuraScript(spell_rog_nerves_of_steel_AuraScript);
+ public:
+ spell_rog_nerves_of_steel_AuraScript()
+ {
+ absorbPct = 0;
+ }
+
+ private:
uint32 absorbPct;
bool Load() override
@@ -882,6 +903,13 @@ class spell_rog_tricks_of_the_trade : public SpellScriptLoader
{
PrepareAuraScript(spell_rog_tricks_of_the_trade_AuraScript);
+ public:
+ spell_rog_tricks_of_the_trade_AuraScript()
+ {
+ _redirectTarget = nullptr;
+ }
+
+ private:
bool Validate(SpellInfo const* /*spellInfo*/) override
{
if (!sSpellMgr->GetSpellInfo(SPELL_ROGUE_TRICKS_OF_THE_TRADE_DMG_BOOST))
@@ -891,12 +919,6 @@ class spell_rog_tricks_of_the_trade : public SpellScriptLoader
return true;
}
- bool Load() override
- {
- _redirectTarget = NULL;
- return true;
- }
-
void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_DEFAULT)
diff --git a/src/server/scripts/Spells/spell_shaman.cpp b/src/server/scripts/Spells/spell_shaman.cpp
index b9f34bafedf..5e8e3a1070f 100644
--- a/src/server/scripts/Spells/spell_shaman.cpp
+++ b/src/server/scripts/Spells/spell_shaman.cpp
@@ -219,14 +219,15 @@ class spell_sha_chain_heal : public SpellScriptLoader
{
PrepareSpellScript(spell_sha_chain_heal_SpellScript);
- bool Load() override
+ public:
+ spell_sha_chain_heal_SpellScript()
{
firstHeal = true;
riptide = false;
amount = 0;
- return true;
}
+ private:
void HandleHeal(SpellEffIndex /*effIndex*/)
{
if (firstHeal)
diff --git a/src/server/scripts/Spells/spell_warlock.cpp b/src/server/scripts/Spells/spell_warlock.cpp
index 42acb474169..24fa9ee31ae 100644
--- a/src/server/scripts/Spells/spell_warlock.cpp
+++ b/src/server/scripts/Spells/spell_warlock.cpp
@@ -139,12 +139,13 @@ class spell_warl_banish : public SpellScriptLoader
{
PrepareSpellScript(spell_warl_banish_SpellScript);
- bool Load() override
+ public:
+ spell_warl_banish_SpellScript()
{
_removed = false;
- return true;
}
+ private:
void HandleBanish()
{
/// Casting Banish on a banished target will cancel the effect
diff --git a/src/server/scripts/Spells/spell_warrior.cpp b/src/server/scripts/Spells/spell_warrior.cpp
index 4bf57d116fe..5e976b12071 100644
--- a/src/server/scripts/Spells/spell_warrior.cpp
+++ b/src/server/scripts/Spells/spell_warrior.cpp
@@ -839,16 +839,17 @@ class spell_warr_sweeping_strikes : public SpellScriptLoader
{
PrepareAuraScript(spell_warr_sweeping_strikes_AuraScript);
- bool Validate(SpellInfo const* /*spellInfo*/) override
+ public:
+ spell_warr_sweeping_strikes_AuraScript()
{
- if (!sSpellMgr->GetSpellInfo(SPELL_WARRIOR_SWEEPING_STRIKES_EXTRA_ATTACK_1) || !sSpellMgr->GetSpellInfo(SPELL_WARRIOR_SWEEPING_STRIKES_EXTRA_ATTACK_2))
- return false;
- return true;
+ _procTarget = nullptr;
}
- bool Load() override
+ private:
+ bool Validate(SpellInfo const* /*spellInfo*/) override
{
- _procTarget = NULL;
+ if (!sSpellMgr->GetSpellInfo(SPELL_WARRIOR_SWEEPING_STRIKES_EXTRA_ATTACK_1) || !sSpellMgr->GetSpellInfo(SPELL_WARRIOR_SWEEPING_STRIKES_EXTRA_ATTACK_2))
+ return false;
return true;
}
@@ -903,6 +904,7 @@ class spell_warr_sword_and_board : public SpellScriptLoader
{
PrepareAuraScript(spell_warr_sword_and_board_AuraScript);
+ private:
bool Validate(SpellInfo const* /*spellInfo*/) override
{
if (!sSpellMgr->GetSpellInfo(SPELL_WARRIOR_SHIELD_SLAM))