diff options
-rw-r--r-- | src/server/scripts/Spells/spell_quest.cpp | 2681 |
1 files changed, 1024 insertions, 1657 deletions
diff --git a/src/server/scripts/Spells/spell_quest.cpp b/src/server/scripts/Spells/spell_quest.cpp index c76f80e9ffc..886223d16ea 100644 --- a/src/server/scripts/Spells/spell_quest.cpp +++ b/src/server/scripts/Spells/spell_quest.cpp @@ -121,37 +121,26 @@ enum ThaumaturgyChannel }; // 9712 - Thaumaturgy Channel -class spell_q2203_thaumaturgy_channel : public SpellScriptLoader +class spell_q2203_thaumaturgy_channel : public AuraScript { - public: - spell_q2203_thaumaturgy_channel() : SpellScriptLoader("spell_q2203_thaumaturgy_channel") { } - - class spell_q2203_thaumaturgy_channel_AuraScript : public AuraScript - { - PrepareAuraScript(spell_q2203_thaumaturgy_channel_AuraScript); - - bool Validate(SpellInfo const* /*spellInfo*/) override - { - return ValidateSpellInfo({ SPELL_THAUMATURGY_CHANNEL }); - } + PrepareAuraScript(spell_q2203_thaumaturgy_channel); - void HandleEffectPeriodic(AuraEffect const* /*aurEff*/) - { - PreventDefaultAction(); - if (Unit* caster = GetCaster()) - caster->CastSpell(caster, SPELL_THAUMATURGY_CHANNEL, false); - } + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo({ SPELL_THAUMATURGY_CHANNEL }); + } - void Register() override - { - OnEffectPeriodic += AuraEffectPeriodicFn(spell_q2203_thaumaturgy_channel_AuraScript::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL); - } - }; + void HandleEffectPeriodic(AuraEffect const* /*aurEff*/) + { + PreventDefaultAction(); + if (Unit* caster = GetCaster()) + caster->CastSpell(caster, SPELL_THAUMATURGY_CHANNEL, false); + } - AuraScript* GetAuraScript() const override - { - return new spell_q2203_thaumaturgy_channel_AuraScript(); - } + void Register() override + { + OnEffectPeriodic += AuraEffectPeriodicFn(spell_q2203_thaumaturgy_channel::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL); + } }; // http://www.wowhead.com/quest=5206 Marauders of Darrowshire @@ -162,42 +151,31 @@ enum Quest5206Data }; // 17271 - Test Fetid Skull -class spell_q5206_test_fetid_skull : public SpellScriptLoader +class spell_q5206_test_fetid_skull : public SpellScript { - public: - spell_q5206_test_fetid_skull() : SpellScriptLoader("spell_q5206_test_fetid_skull") { } - - class spell_q5206_test_fetid_skull_SpellScript : public SpellScript - { - PrepareSpellScript(spell_q5206_test_fetid_skull_SpellScript); + PrepareSpellScript(spell_q5206_test_fetid_skull); - bool Load() override - { - return GetCaster()->GetTypeId() == TYPEID_PLAYER; - } - - bool Validate(SpellInfo const* /*spellEntry*/) override - { - return ValidateSpellInfo({ SPELL_CREATE_RESONATING_SKULL, SPELL_CREATE_BONE_DUST }); - } + bool Load() override + { + return GetCaster()->GetTypeId() == TYPEID_PLAYER; + } - void HandleDummy(SpellEffIndex /*effIndex*/) - { - Unit* caster = GetCaster(); - uint32 spellId = roll_chance_i(50) ? SPELL_CREATE_RESONATING_SKULL : SPELL_CREATE_BONE_DUST; - caster->CastSpell(caster, spellId, true); - } + bool Validate(SpellInfo const* /*spellEntry*/) override + { + return ValidateSpellInfo({ SPELL_CREATE_RESONATING_SKULL, SPELL_CREATE_BONE_DUST }); + } - void Register() override - { - OnEffectHit += SpellEffectFn(spell_q5206_test_fetid_skull_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); - } - }; + void HandleDummy(SpellEffIndex /*effIndex*/) + { + Unit* caster = GetCaster(); + uint32 spellId = roll_chance_i(50) ? SPELL_CREATE_RESONATING_SKULL : SPELL_CREATE_BONE_DUST; + caster->CastSpell(caster, spellId, true); + } - SpellScript* GetSpellScript() const override - { - return new spell_q5206_test_fetid_skull_SpellScript(); - } + void Register() override + { + OnEffectHit += SpellEffectFn(spell_q5206_test_fetid_skull::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } }; // http://www.wowhead.com/quest=6124 Curing the Sick (A) @@ -213,57 +191,46 @@ enum Quests6124_6129Data constexpr Milliseconds Quest6124_6129_DESPAWN_TIME = 30s; // 19512 - Apply Salve -class spell_q6124_6129_apply_salve : public SpellScriptLoader +class spell_q6124_6129_apply_salve : public SpellScript { - public: - spell_q6124_6129_apply_salve() : SpellScriptLoader("spell_q6124_6129_apply_salve") { } + PrepareSpellScript(spell_q6124_6129_apply_salve); - class spell_q6124_6129_apply_salve_SpellScript : public SpellScript - { - PrepareSpellScript(spell_q6124_6129_apply_salve_SpellScript); - - bool Load() override - { - return GetCaster()->GetTypeId() == TYPEID_PLAYER; - } - - void HandleDummy(SpellEffIndex /*effIndex*/) - { - Player* caster = GetCaster()->ToPlayer(); - if (GetCastItem()) - if (Creature* creatureTarget = GetHitCreature()) - { - uint32 newEntry = 0; - switch (caster->GetTeam()) - { - case HORDE: - if (creatureTarget->GetEntry() == NPC_SICKLY_GAZELLE) - newEntry = NPC_CURED_GAZELLE; - break; - case ALLIANCE: - if (creatureTarget->GetEntry() == NPC_SICKLY_DEER) - newEntry = NPC_CURED_DEER; - break; - } - if (newEntry) - { - creatureTarget->UpdateEntry(newEntry); - creatureTarget->DespawnOrUnsummon(Quest6124_6129_DESPAWN_TIME); - caster->KilledMonsterCredit(newEntry); - } - } - } + bool Load() override + { + return GetCaster()->GetTypeId() == TYPEID_PLAYER; + } - void Register() override + void HandleDummy(SpellEffIndex /*effIndex*/) + { + Player* caster = GetCaster()->ToPlayer(); + if (GetCastItem()) + if (Creature* creatureTarget = GetHitCreature()) { - OnEffectHitTarget += SpellEffectFn(spell_q6124_6129_apply_salve_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + uint32 newEntry = 0; + switch (caster->GetTeam()) + { + case HORDE: + if (creatureTarget->GetEntry() == NPC_SICKLY_GAZELLE) + newEntry = NPC_CURED_GAZELLE; + break; + case ALLIANCE: + if (creatureTarget->GetEntry() == NPC_SICKLY_DEER) + newEntry = NPC_CURED_DEER; + break; + } + if (newEntry) + { + creatureTarget->UpdateEntry(newEntry); + creatureTarget->DespawnOrUnsummon(Quest6124_6129_DESPAWN_TIME); + caster->KilledMonsterCredit(newEntry); + } } - }; + } - SpellScript* GetSpellScript() const override - { - return new spell_q6124_6129_apply_salve_SpellScript(); - } + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_q6124_6129_apply_salve::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } }; // http://www.wowhead.com/quest=10255 Testing the Antidote @@ -294,109 +261,75 @@ enum Quest11396_11399Data }; // 43874 - Scourge Mur'gul Camp: Force Shield Arcane Purple x3 -class spell_q11396_11399_force_shield_arcane_purple_x3 : public SpellScriptLoader +class spell_q11396_11399_force_shield_arcane_purple_x3 : public AuraScript { - public: - spell_q11396_11399_force_shield_arcane_purple_x3() : SpellScriptLoader("spell_q11396_11399_force_shield_arcane_purple_x3") { } + PrepareAuraScript(spell_q11396_11399_force_shield_arcane_purple_x3); - class spell_q11396_11399_force_shield_arcane_purple_x3_AuraScript : public AuraScript - { - PrepareAuraScript(spell_q11396_11399_force_shield_arcane_purple_x3_AuraScript); - - void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) - { - Unit* target = GetTarget(); - target->SetImmuneToPC(true); - target->AddUnitState(UNIT_STATE_ROOT); - } - - void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) - { - GetTarget()->SetImmuneToPC(false); - } - - void Register() override - { - OnEffectApply += AuraEffectApplyFn(spell_q11396_11399_force_shield_arcane_purple_x3_AuraScript::HandleEffectApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); - OnEffectRemove += AuraEffectRemoveFn(spell_q11396_11399_force_shield_arcane_purple_x3_AuraScript::HandleEffectRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); - } + void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + Unit* target = GetTarget(); + target->SetImmuneToPC(true); + target->AddUnitState(UNIT_STATE_ROOT); + } - }; + void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + GetTarget()->SetImmuneToPC(false); + } - AuraScript* GetAuraScript() const override - { - return new spell_q11396_11399_force_shield_arcane_purple_x3_AuraScript(); - } + void Register() override + { + OnEffectApply += AuraEffectApplyFn(spell_q11396_11399_force_shield_arcane_purple_x3::HandleEffectApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); + OnEffectRemove += AuraEffectRemoveFn(spell_q11396_11399_force_shield_arcane_purple_x3::HandleEffectRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); + } }; // 50133 - Scourging Crystal Controller -class spell_q11396_11399_scourging_crystal_controller : public SpellScriptLoader +class spell_q11396_11399_scourging_crystal_controller : public SpellScript { - public: - spell_q11396_11399_scourging_crystal_controller() : SpellScriptLoader("spell_q11396_11399_scourging_crystal_controller") { } - - class spell_q11396_11399_scourging_crystal_controller_SpellScript : public SpellScript - { - PrepareSpellScript(spell_q11396_11399_scourging_crystal_controller_SpellScript); + PrepareSpellScript(spell_q11396_11399_scourging_crystal_controller); - bool Validate(SpellInfo const* /*spellEntry*/) override - { - return ValidateSpellInfo({ SPELL_FORCE_SHIELD_ARCANE_PURPLE_X3, SPELL_SCOURGING_CRYSTAL_CONTROLLER }); - } - - void HandleDummy(SpellEffIndex /*effIndex*/) - { - if (Unit* target = GetHitUnit()) - if (target->GetTypeId() == TYPEID_UNIT && target->HasAura(SPELL_FORCE_SHIELD_ARCANE_PURPLE_X3)) - // Make sure nobody else is channeling the same target - if (!target->HasAura(SPELL_SCOURGING_CRYSTAL_CONTROLLER)) - GetCaster()->CastSpell(target, SPELL_SCOURGING_CRYSTAL_CONTROLLER, GetCastItem()); - } + bool Validate(SpellInfo const* /*spellEntry*/) override + { + return ValidateSpellInfo({ SPELL_FORCE_SHIELD_ARCANE_PURPLE_X3, SPELL_SCOURGING_CRYSTAL_CONTROLLER }); + } - void Register() override - { - OnEffectHitTarget += SpellEffectFn(spell_q11396_11399_scourging_crystal_controller_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); - } - }; + void HandleDummy(SpellEffIndex /*effIndex*/) + { + if (Unit* target = GetHitUnit()) + if (target->GetTypeId() == TYPEID_UNIT && target->HasAura(SPELL_FORCE_SHIELD_ARCANE_PURPLE_X3)) + // Make sure nobody else is channeling the same target + if (!target->HasAura(SPELL_SCOURGING_CRYSTAL_CONTROLLER)) + GetCaster()->CastSpell(target, SPELL_SCOURGING_CRYSTAL_CONTROLLER, GetCastItem()); + } - SpellScript* GetSpellScript() const override - { - return new spell_q11396_11399_scourging_crystal_controller_SpellScript(); - } + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_q11396_11399_scourging_crystal_controller::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } }; // 43882 - Scourging Crystal Controller Dummy -class spell_q11396_11399_scourging_crystal_controller_dummy : public SpellScriptLoader +class spell_q11396_11399_scourging_crystal_controller_dummy : public SpellScript { - public: - spell_q11396_11399_scourging_crystal_controller_dummy() : SpellScriptLoader("spell_q11396_11399_scourging_crystal_controller_dummy") { } - - class spell_q11396_11399_scourging_crystal_controller_dummy_SpellScript : public SpellScript - { - PrepareSpellScript(spell_q11396_11399_scourging_crystal_controller_dummy_SpellScript); + PrepareSpellScript(spell_q11396_11399_scourging_crystal_controller_dummy); - bool Validate(SpellInfo const* /*spellEntry*/) override - { - return ValidateSpellInfo({ SPELL_FORCE_SHIELD_ARCANE_PURPLE_X3 }); - } - - void HandleDummy(SpellEffIndex /*effIndex*/) - { - if (Unit* target = GetHitUnit()) - if (target->GetTypeId() == TYPEID_UNIT) - target->RemoveAurasDueToSpell(SPELL_FORCE_SHIELD_ARCANE_PURPLE_X3); - } + bool Validate(SpellInfo const* /*spellEntry*/) override + { + return ValidateSpellInfo({ SPELL_FORCE_SHIELD_ARCANE_PURPLE_X3 }); + } - void Register() override - { - OnEffectHitTarget += SpellEffectFn(spell_q11396_11399_scourging_crystal_controller_dummy_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); - } - }; + void HandleDummy(SpellEffIndex /*effIndex*/) + { + if (Unit* target = GetHitUnit()) + if (target->GetTypeId() == TYPEID_UNIT) + target->RemoveAurasDueToSpell(SPELL_FORCE_SHIELD_ARCANE_PURPLE_X3); + } - SpellScript* GetSpellScript() const override - { - return new spell_q11396_11399_scourging_crystal_controller_dummy_SpellScript(); - } + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_q11396_11399_scourging_crystal_controller_dummy::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } }; // http://www.wowhead.com/quest=11515 Blood for Blood @@ -426,39 +359,28 @@ enum Quest11587Data }; // 45449 - Arcane Prisoner Rescue -class spell_q11587_arcane_prisoner_rescue : public SpellScriptLoader +class spell_q11587_arcane_prisoner_rescue : public SpellScript { - public: - spell_q11587_arcane_prisoner_rescue() : SpellScriptLoader("spell_q11587_arcane_prisoner_rescue") { } - - class spell_q11587_arcane_prisoner_rescue_SpellScript : public SpellScript - { - PrepareSpellScript(spell_q11587_arcane_prisoner_rescue_SpellScript); - - bool Validate(SpellInfo const* /*spellEntry*/) override - { - return ValidateSpellInfo({ SPELL_SUMMON_ARCANE_PRISONER_MALE, SPELL_SUMMON_ARCANE_PRISONER_FEMALE }); - } + PrepareSpellScript(spell_q11587_arcane_prisoner_rescue); - void HandleDummy(SpellEffIndex /*effIndex*/) - { - Unit* caster = GetCaster(); - uint32 spellId = SPELL_SUMMON_ARCANE_PRISONER_MALE; - if (rand32() % 2) - spellId = SPELL_SUMMON_ARCANE_PRISONER_FEMALE; - caster->CastSpell(caster, spellId, true); - } + bool Validate(SpellInfo const* /*spellEntry*/) override + { + return ValidateSpellInfo({ SPELL_SUMMON_ARCANE_PRISONER_MALE, SPELL_SUMMON_ARCANE_PRISONER_FEMALE }); + } - void Register() override - { - OnEffectHitTarget += SpellEffectFn(spell_q11587_arcane_prisoner_rescue_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); - } - }; + void HandleDummy(SpellEffIndex /*effIndex*/) + { + Unit* caster = GetCaster(); + uint32 spellId = SPELL_SUMMON_ARCANE_PRISONER_MALE; + if (rand32() % 2) + spellId = SPELL_SUMMON_ARCANE_PRISONER_FEMALE; + caster->CastSpell(caster, spellId, true); + } - SpellScript* GetSpellScript() const override - { - return new spell_q11587_arcane_prisoner_rescue_SpellScript(); - } + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_q11587_arcane_prisoner_rescue::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } }; // http://www.wowhead.com/quest=11730 Master and Servant @@ -478,66 +400,55 @@ enum Quest11730Data }; // 46023 - The Ultrasonic Screwdriver -class spell_q11730_ultrasonic_screwdriver : public SpellScriptLoader +class spell_q11730_ultrasonic_screwdriver : public SpellScript { - public: - spell_q11730_ultrasonic_screwdriver() : SpellScriptLoader("spell_q11730_ultrasonic_screwdriver") { } - - class spell_q11730_ultrasonic_screwdriver_SpellScript : public SpellScript - { - PrepareSpellScript(spell_q11730_ultrasonic_screwdriver_SpellScript); - - bool Load() override - { - return GetCaster()->GetTypeId() == TYPEID_PLAYER && GetCastItem(); - } + PrepareSpellScript(spell_q11730_ultrasonic_screwdriver); - bool Validate(SpellInfo const* /*spellEntry*/) override - { - return ValidateSpellInfo( - { - SPELL_SUMMON_SCAVENGEBOT_004A8, - SPELL_SUMMON_SENTRYBOT_57K, - SPELL_SUMMON_DEFENDOTANK_66D, - SPELL_SUMMON_SCAVENGEBOT_005B6, - SPELL_SUMMON_55D_COLLECTATRON, - SPELL_ROBOT_KILL_CREDIT - }); - } + bool Load() override + { + return GetCaster()->GetTypeId() == TYPEID_PLAYER && GetCastItem(); + } - void HandleDummy(SpellEffIndex /*effIndex*/) - { - Item* castItem = GetCastItem(); - Unit* caster = GetCaster(); - if (Creature* target = GetHitCreature()) - { - uint32 spellId = 0; - switch (target->GetEntry()) - { - case NPC_SCAVENGEBOT_004A8: spellId = SPELL_SUMMON_SCAVENGEBOT_004A8; break; - case NPC_SENTRYBOT_57K: spellId = SPELL_SUMMON_SENTRYBOT_57K; break; - case NPC_DEFENDOTANK_66D: spellId = SPELL_SUMMON_DEFENDOTANK_66D; break; - case NPC_SCAVENGEBOT_005B6: spellId = SPELL_SUMMON_SCAVENGEBOT_005B6; break; - case NPC_55D_COLLECTATRON: spellId = SPELL_SUMMON_55D_COLLECTATRON; break; - default: - return; - } - caster->CastSpell(caster, spellId, castItem); - caster->CastSpell(caster, SPELL_ROBOT_KILL_CREDIT, true); - target->DespawnOrUnsummon(); - } - } + bool Validate(SpellInfo const* /*spellEntry*/) override + { + return ValidateSpellInfo( + { + SPELL_SUMMON_SCAVENGEBOT_004A8, + SPELL_SUMMON_SENTRYBOT_57K, + SPELL_SUMMON_DEFENDOTANK_66D, + SPELL_SUMMON_SCAVENGEBOT_005B6, + SPELL_SUMMON_55D_COLLECTATRON, + SPELL_ROBOT_KILL_CREDIT + }); + } - void Register() override + void HandleDummy(SpellEffIndex /*effIndex*/) + { + Item* castItem = GetCastItem(); + Unit* caster = GetCaster(); + if (Creature* target = GetHitCreature()) + { + uint32 spellId = 0; + switch (target->GetEntry()) { - OnEffectHitTarget += SpellEffectFn(spell_q11730_ultrasonic_screwdriver_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + case NPC_SCAVENGEBOT_004A8: spellId = SPELL_SUMMON_SCAVENGEBOT_004A8; break; + case NPC_SENTRYBOT_57K: spellId = SPELL_SUMMON_SENTRYBOT_57K; break; + case NPC_DEFENDOTANK_66D: spellId = SPELL_SUMMON_DEFENDOTANK_66D; break; + case NPC_SCAVENGEBOT_005B6: spellId = SPELL_SUMMON_SCAVENGEBOT_005B6; break; + case NPC_55D_COLLECTATRON: spellId = SPELL_SUMMON_55D_COLLECTATRON; break; + default: + return; } - }; - - SpellScript* GetSpellScript() const override - { - return new spell_q11730_ultrasonic_screwdriver_SpellScript(); + caster->CastSpell(caster, spellId, castItem); + caster->CastSpell(caster, SPELL_ROBOT_KILL_CREDIT, true); + target->DespawnOrUnsummon(); } + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_q11730_ultrasonic_screwdriver::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } }; // http://www.wowhead.com/quest=12459 That Which Creates Can Also Destroy @@ -554,41 +465,30 @@ enum Quest12459Data }; // 49587 - Seeds of Nature's Wrath -class spell_q12459_seeds_of_natures_wrath : public SpellScriptLoader +class spell_q12459_seeds_of_natures_wrath : public SpellScript { - public: - spell_q12459_seeds_of_natures_wrath() : SpellScriptLoader("spell_q12459_seeds_of_natures_wrath") { } + PrepareSpellScript(spell_q12459_seeds_of_natures_wrath); - class spell_q12459_seeds_of_natures_wrath_SpellScript : public SpellScript + void HandleDummy(SpellEffIndex /*effIndex*/) + { + if (Creature* creatureTarget = GetHitCreature()) { - PrepareSpellScript(spell_q12459_seeds_of_natures_wrath_SpellScript); - - void HandleDummy(SpellEffIndex /*effIndex*/) - { - if (Creature* creatureTarget = GetHitCreature()) - { - uint32 uiNewEntry = 0; - switch (creatureTarget->GetEntry()) - { - case NPC_REANIMATED_FROSTWYRM: uiNewEntry = NPC_WEAK_REANIMATED_FROSTWYRM; break; - case NPC_TURGID: uiNewEntry = NPC_WEAK_TURGID; break; - case NPC_DEATHGAZE: uiNewEntry = NPC_WEAK_DEATHGAZE; break; - } - if (uiNewEntry) - creatureTarget->UpdateEntry(uiNewEntry); - } - } - - void Register() override + uint32 uiNewEntry = 0; + switch (creatureTarget->GetEntry()) { - OnEffectHitTarget += SpellEffectFn(spell_q12459_seeds_of_natures_wrath_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + case NPC_REANIMATED_FROSTWYRM: uiNewEntry = NPC_WEAK_REANIMATED_FROSTWYRM; break; + case NPC_TURGID: uiNewEntry = NPC_WEAK_TURGID; break; + case NPC_DEATHGAZE: uiNewEntry = NPC_WEAK_DEATHGAZE; break; } - }; - - SpellScript* GetSpellScript() const override - { - return new spell_q12459_seeds_of_natures_wrath_SpellScript(); + if (uiNewEntry) + creatureTarget->UpdateEntry(uiNewEntry); } + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_q12459_seeds_of_natures_wrath::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } }; // http://www.wowhead.com/quest=12634 Some Make Lemonade, Some Make Liquor @@ -601,90 +501,68 @@ enum Quest12634Data }; // 51840 - Despawn Fruit Tosser -class spell_q12634_despawn_fruit_tosser : public SpellScriptLoader +class spell_q12634_despawn_fruit_tosser : public SpellScript { - public: - spell_q12634_despawn_fruit_tosser() : SpellScriptLoader("spell_q12634_despawn_fruit_tosser") { } + PrepareSpellScript(spell_q12634_despawn_fruit_tosser); - class spell_q12634_despawn_fruit_tosser_SpellScript : public SpellScript + bool Validate(SpellInfo const* /*spellEntry*/) override + { + return ValidateSpellInfo( { - PrepareSpellScript(spell_q12634_despawn_fruit_tosser_SpellScript); - - bool Validate(SpellInfo const* /*spellEntry*/) override - { - return ValidateSpellInfo( - { - SPELL_BANANAS_FALL_TO_GROUND, - SPELL_ORANGE_FALLS_TO_GROUND, - SPELL_PAPAYA_FALLS_TO_GROUND, - SPELL_SUMMON_ADVENTUROUS_DWARF - }); - } - - void HandleDummy(SpellEffIndex /*effIndex*/) - { - uint32 spellId = SPELL_BANANAS_FALL_TO_GROUND; - switch (urand(0, 3)) - { - case 1: spellId = SPELL_ORANGE_FALLS_TO_GROUND; break; - case 2: spellId = SPELL_PAPAYA_FALLS_TO_GROUND; break; - } - // sometimes, if you're lucky, you get a dwarf - if (roll_chance_i(5)) - spellId = SPELL_SUMMON_ADVENTUROUS_DWARF; - GetCaster()->CastSpell(GetCaster(), spellId, true); - } - - void Register() override - { - OnEffectHit += SpellEffectFn(spell_q12634_despawn_fruit_tosser_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); - } - }; + SPELL_BANANAS_FALL_TO_GROUND, + SPELL_ORANGE_FALLS_TO_GROUND, + SPELL_PAPAYA_FALLS_TO_GROUND, + SPELL_SUMMON_ADVENTUROUS_DWARF + }); + } - SpellScript* GetSpellScript() const override + void HandleDummy(SpellEffIndex /*effIndex*/) + { + uint32 spellId = SPELL_BANANAS_FALL_TO_GROUND; + switch (urand(0, 3)) { - return new spell_q12634_despawn_fruit_tosser_SpellScript(); + case 1: spellId = SPELL_ORANGE_FALLS_TO_GROUND; break; + case 2: spellId = SPELL_PAPAYA_FALLS_TO_GROUND; break; } + // sometimes, if you're lucky, you get a dwarf + if (roll_chance_i(5)) + spellId = SPELL_SUMMON_ADVENTUROUS_DWARF; + GetCaster()->CastSpell(GetCaster(), spellId, true); + } + + void Register() override + { + OnEffectHit += SpellEffectFn(spell_q12634_despawn_fruit_tosser::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } }; // http://www.wowhead.com/quest=12683 Burning to Help // 52308 - Take Sputum Sample -class spell_q12683_take_sputum_sample : public SpellScriptLoader +class spell_q12683_take_sputum_sample : public SpellScript { - public: - spell_q12683_take_sputum_sample() : SpellScriptLoader("spell_q12683_take_sputum_sample") { } - - class spell_q12683_take_sputum_sample_SpellScript : public SpellScript - { - PrepareSpellScript(spell_q12683_take_sputum_sample_SpellScript); - - bool Validate(SpellInfo const* spellInfo) override - { - return spellInfo->GetEffects().size() > EFFECT_1; - } - - void HandleDummy(SpellEffIndex /*effIndex*/) - { - uint32 reqAuraId = GetEffectInfo(EFFECT_1).CalcValue(); + PrepareSpellScript(spell_q12683_take_sputum_sample); - Unit* caster = GetCaster(); - if (caster->HasAuraEffect(reqAuraId, 0)) - { - uint32 spellId = GetEffectInfo().CalcValue(); - caster->CastSpell(caster, spellId, true); - } - } + bool Validate(SpellInfo const* spellInfo) override + { + return spellInfo->GetEffects().size() > EFFECT_1; + } - void Register() override - { - OnEffectHit += SpellEffectFn(spell_q12683_take_sputum_sample_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); - } - }; + void HandleDummy(SpellEffIndex /*effIndex*/) + { + uint32 reqAuraId = GetEffectInfo(EFFECT_1).CalcValue(); - SpellScript* GetSpellScript() const override + Unit* caster = GetCaster(); + if (caster->HasAuraEffect(reqAuraId, 0)) { - return new spell_q12683_take_sputum_sample_SpellScript(); + uint32 spellId = GetEffectValue(); + caster->CastSpell(caster, spellId, true); } + } + + void Register() override + { + OnEffectHit += SpellEffectFn(spell_q12683_take_sputum_sample::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } }; // http://www.wowhead.com/quest=12851 Going Bearback @@ -699,54 +577,42 @@ enum Quest12851Data }; // 54798 - FLAMING Arrow Triggered Effect -class spell_q12851_going_bearback : public SpellScriptLoader +class spell_q12851_going_bearback : public AuraScript { - public: - spell_q12851_going_bearback() : SpellScriptLoader("spell_q12851_going_bearback") { } + PrepareAuraScript(spell_q12851_going_bearback); - class spell_q12851_going_bearback_AuraScript : public AuraScript + void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + if (Unit* caster = GetCaster()) { - PrepareAuraScript(spell_q12851_going_bearback_AuraScript); + Unit* target = GetTarget(); + // Already in fire + if (target->HasAura(SPELL_ABLAZE)) + return; - void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + if (Player* player = caster->GetCharmerOrOwnerPlayerOrPlayerItself()) { - if (Unit* caster = GetCaster()) + switch (target->GetEntry()) { - Unit* target = GetTarget(); - // Already in fire - if (target->HasAura(SPELL_ABLAZE)) - return; - - if (Player* player = caster->GetCharmerOrOwnerPlayerOrPlayerItself()) - { - switch (target->GetEntry()) - { - case NPC_FROSTWORG: - target->CastSpell(player, SPELL_FROSTWORG_CREDIT, true); - target->CastSpell(target, SPELL_IMMOLATION, true); - target->CastSpell(target, SPELL_ABLAZE, true); - break; - case NPC_FROSTGIANT: - target->CastSpell(player, SPELL_FROSTGIANT_CREDIT, true); - target->CastSpell(target, SPELL_IMMOLATION, true); - target->CastSpell(target, SPELL_ABLAZE, true); - break; - } - } + case NPC_FROSTWORG: + target->CastSpell(player, SPELL_FROSTWORG_CREDIT, true); + target->CastSpell(target, SPELL_IMMOLATION, true); + target->CastSpell(target, SPELL_ABLAZE, true); + break; + case NPC_FROSTGIANT: + target->CastSpell(player, SPELL_FROSTGIANT_CREDIT, true); + target->CastSpell(target, SPELL_IMMOLATION, true); + target->CastSpell(target, SPELL_ABLAZE, true); + break; } } - - void Register() override - { - AfterEffectApply += AuraEffectApplyFn(spell_q12851_going_bearback_AuraScript::HandleEffectApply, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK); - } - - }; - - AuraScript* GetAuraScript() const override - { - return new spell_q12851_going_bearback_AuraScript(); } + } + + void Register() override + { + AfterEffectApply += AuraEffectApplyFn(spell_q12851_going_bearback::HandleEffectApply, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK); + } }; // http://www.wowhead.com/quest=12937 Relief for the Fallen @@ -757,46 +623,35 @@ enum Quest12937Data }; // 55804 - Healing Finished -class spell_q12937_relief_for_the_fallen : public SpellScriptLoader +class spell_q12937_relief_for_the_fallen : public SpellScript { - public: - spell_q12937_relief_for_the_fallen() : SpellScriptLoader("spell_q12937_relief_for_the_fallen") { } - - class spell_q12937_relief_for_the_fallen_SpellScript : public SpellScript - { - PrepareSpellScript(spell_q12937_relief_for_the_fallen_SpellScript); + PrepareSpellScript(spell_q12937_relief_for_the_fallen); - bool Load() override - { - return GetCaster()->GetTypeId() == TYPEID_PLAYER; - } - - bool Validate(SpellInfo const* /*spellEntry*/) override - { - return ValidateSpellInfo({ SPELL_TRIGGER_AID_OF_THE_EARTHEN }); - } - - void HandleDummy(SpellEffIndex /*effIndex*/) - { - Player* caster = GetCaster()->ToPlayer(); - if (Creature* target = GetHitCreature()) - { - caster->CastSpell(caster, SPELL_TRIGGER_AID_OF_THE_EARTHEN, true); - caster->KilledMonsterCredit(NPC_FALLEN_EARTHEN_DEFENDER); - target->DespawnOrUnsummon(); - } - } + bool Load() override + { + return GetCaster()->GetTypeId() == TYPEID_PLAYER; + } - void Register() override - { - OnEffectHitTarget += SpellEffectFn(spell_q12937_relief_for_the_fallen_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); - } - }; + bool Validate(SpellInfo const* /*spellEntry*/) override + { + return ValidateSpellInfo({ SPELL_TRIGGER_AID_OF_THE_EARTHEN }); + } - SpellScript* GetSpellScript() const override + void HandleDummy(SpellEffIndex /*effIndex*/) + { + Player* caster = GetCaster()->ToPlayer(); + if (Creature* target = GetHitCreature()) { - return new spell_q12937_relief_for_the_fallen_SpellScript(); + caster->CastSpell(caster, SPELL_TRIGGER_AID_OF_THE_EARTHEN, true); + caster->KilledMonsterCredit(NPC_FALLEN_EARTHEN_DEFENDER); + target->DespawnOrUnsummon(); } + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_q12937_relief_for_the_fallen::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } }; enum Whoarethey @@ -807,40 +662,29 @@ enum Whoarethey }; // 48917 - Who Are They: Cast from Questgiver -class spell_q10041_q10040_who_are_they : public SpellScriptLoader +class spell_q10041_q10040_who_are_they : public SpellScript { - public: - spell_q10041_q10040_who_are_they() : SpellScriptLoader("spell_q10041_q10040_who_are_they") { } - - class spell_q10041_q10040_who_are_they_SpellScript : public SpellScript - { - PrepareSpellScript(spell_q10041_q10040_who_are_they_SpellScript); - - bool Validate(SpellInfo const* /*spellEntry*/) override - { - return ValidateSpellInfo({ SPELL_MALE_DISGUISE, SPELL_FEMALE_DISGUISE, SPELL_GENERIC_DISGUISE }); - } + PrepareSpellScript(spell_q10041_q10040_who_are_they); - void HandleScript(SpellEffIndex effIndex) - { - PreventHitDefaultEffect(effIndex); - if (Player* target = GetHitPlayer()) - { - target->CastSpell(target, target->GetNativeGender() == GENDER_MALE ? SPELL_MALE_DISGUISE : SPELL_FEMALE_DISGUISE, true); - target->CastSpell(target, SPELL_GENERIC_DISGUISE, true); - } - } - - void Register() override - { - OnEffectHitTarget += SpellEffectFn(spell_q10041_q10040_who_are_they_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); - } - }; + bool Validate(SpellInfo const* /*spellEntry*/) override + { + return ValidateSpellInfo({ SPELL_MALE_DISGUISE, SPELL_FEMALE_DISGUISE, SPELL_GENERIC_DISGUISE }); + } - SpellScript* GetSpellScript() const override + void HandleScript(SpellEffIndex effIndex) + { + PreventHitDefaultEffect(effIndex); + if (Player* target = GetHitPlayer()) { - return new spell_q10041_q10040_who_are_they_SpellScript(); + target->CastSpell(target, target->GetNativeGender() == GENDER_MALE ? SPELL_MALE_DISGUISE : SPELL_FEMALE_DISGUISE, true); + target->CastSpell(target, SPELL_GENERIC_DISGUISE, true); } + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_q10041_q10040_who_are_they::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + } }; enum symboloflife @@ -849,40 +693,29 @@ enum symboloflife }; // 8593 - Symbol of Life (Dummy) -class spell_symbol_of_life_dummy : public SpellScriptLoader +class spell_symbol_of_life_dummy : public SpellScript { - public: - spell_symbol_of_life_dummy() : SpellScriptLoader("spell_symbol_of_life_dummy") { } + PrepareSpellScript(spell_symbol_of_life_dummy); - class spell_symbol_of_life_dummy_SpellScript : public SpellScript + void HandleDummy(SpellEffIndex /*effIndex*/) + { + if (Creature* target = GetHitCreature()) { - PrepareSpellScript(spell_symbol_of_life_dummy_SpellScript); - - void HandleDummy(SpellEffIndex /*effIndex*/) + if (target->HasAura(SPELL_PERMANENT_FEIGN_DEATH)) { - if (Creature* target = GetHitCreature()) - { - if (target->HasAura(SPELL_PERMANENT_FEIGN_DEATH)) - { - target->RemoveAurasDueToSpell(SPELL_PERMANENT_FEIGN_DEATH); - target->SetDynamicFlags(0); - target->SetUnitFlags2(UnitFlags2(0)); - target->SetHealth(target->GetMaxHealth() / 2); - target->SetPower(POWER_MANA, target->GetMaxPower(POWER_MANA) * 0.75f); - } - } + target->RemoveAurasDueToSpell(SPELL_PERMANENT_FEIGN_DEATH); + target->SetDynamicFlags(0); + target->SetUnitFlags2(UnitFlags2(0)); + target->SetHealth(target->GetMaxHealth() / 2); + target->SetPower(POWER_MANA, uint32(target->GetMaxPower(POWER_MANA) * 0.75f)); } - - void Register() override - { - OnEffectHitTarget += SpellEffectFn(spell_symbol_of_life_dummy_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); - } - }; - - SpellScript* GetSpellScript() const override - { - return new spell_symbol_of_life_dummy_SpellScript(); } + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_symbol_of_life_dummy::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } }; // http://www.wowhead.com/quest=12659 Scalps! @@ -892,40 +725,29 @@ enum Quest12659Data }; // 52090 - Ahunae's Knife -class spell_q12659_ahunaes_knife : public SpellScriptLoader +class spell_q12659_ahunaes_knife : public SpellScript { - public: - spell_q12659_ahunaes_knife() : SpellScriptLoader("spell_q12659_ahunaes_knife") { } - - class spell_q12659_ahunaes_knife_SpellScript : public SpellScript - { - PrepareSpellScript(spell_q12659_ahunaes_knife_SpellScript); - - bool Load() override - { - return GetCaster()->GetTypeId() == TYPEID_PLAYER; - } - - void HandleDummy(SpellEffIndex /*effIndex*/) - { - Player* caster = GetCaster()->ToPlayer(); - if (Creature* target = GetHitCreature()) - { - target->DespawnOrUnsummon(); - caster->KilledMonsterCredit(NPC_SCALPS_KC_BUNNY); - } - } + PrepareSpellScript(spell_q12659_ahunaes_knife); - void Register() override - { - OnEffectHitTarget += SpellEffectFn(spell_q12659_ahunaes_knife_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); - } - }; + bool Load() override + { + return GetCaster()->GetTypeId() == TYPEID_PLAYER; + } - SpellScript* GetSpellScript() const override + void HandleDummy(SpellEffIndex /*effIndex*/) + { + Player* caster = GetCaster()->ToPlayer(); + if (Creature* target = GetHitCreature()) { - return new spell_q12659_ahunaes_knife_SpellScript(); + target->DespawnOrUnsummon(); + caster->KilledMonsterCredit(NPC_SCALPS_KC_BUNNY); } + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_q12659_ahunaes_knife::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } }; enum StoppingTheSpread @@ -935,44 +757,31 @@ enum StoppingTheSpread }; // 32146 - Liquid Fire -class spell_q9874_liquid_fire : public SpellScriptLoader +class spell_q9874_liquid_fire : public SpellScript { - public: - spell_q9874_liquid_fire() : SpellScriptLoader("spell_q9874_liquid_fire") - { - } - - class spell_q9874_liquid_fire_SpellScript : public SpellScript - { - PrepareSpellScript(spell_q9874_liquid_fire_SpellScript); - - bool Load() override - { - return GetCaster()->GetTypeId() == TYPEID_PLAYER; - } + PrepareSpellScript(spell_q9874_liquid_fire); - void HandleDummy(SpellEffIndex /*effIndex*/) - { - Player* caster = GetCaster()->ToPlayer(); - if (Creature* target = GetHitCreature()) - if (!target->HasAura(SPELL_FLAMES)) - { - caster->KilledMonsterCredit(NPC_VILLAGER_KILL_CREDIT); - target->CastSpell(target, SPELL_FLAMES, true); - target->DespawnOrUnsummon(60s); - } - } + bool Load() override + { + return GetCaster()->GetTypeId() == TYPEID_PLAYER; + } - void Register() override + void HandleDummy(SpellEffIndex /*effIndex*/) + { + Player* caster = GetCaster()->ToPlayer(); + if (Creature* target = GetHitCreature()) + if (!target->HasAura(SPELL_FLAMES)) { - OnEffectHitTarget += SpellEffectFn(spell_q9874_liquid_fire_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + caster->KilledMonsterCredit(NPC_VILLAGER_KILL_CREDIT); + target->CastSpell(target, SPELL_FLAMES, true); + target->DespawnOrUnsummon(60s); } - }; + } - SpellScript* GetSpellScript() const override - { - return new spell_q9874_liquid_fire_SpellScript(); - } + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_q9874_liquid_fire::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } }; enum SalvagingLifesStength @@ -981,43 +790,30 @@ enum SalvagingLifesStength }; // 54190 - Lifeblood Dummy -class spell_q12805_lifeblood_dummy : public SpellScriptLoader +class spell_q12805_lifeblood_dummy : public SpellScript { - public: - spell_q12805_lifeblood_dummy() : SpellScriptLoader("spell_q12805_lifeblood_dummy") - { - } + PrepareSpellScript(spell_q12805_lifeblood_dummy); - class spell_q12805_lifeblood_dummy_SpellScript : public SpellScript - { - PrepareSpellScript(spell_q12805_lifeblood_dummy_SpellScript); - - bool Load() override - { - return GetCaster()->GetTypeId() == TYPEID_PLAYER; - } - - void HandleScript(SpellEffIndex /*effIndex*/) - { - Player* caster = GetCaster()->ToPlayer(); - if (Creature* target = GetHitCreature()) - { - caster->KilledMonsterCredit(NPC_SHARD_KILL_CREDIT); - target->CastSpell(target, uint32(GetEffectValue()), true); - target->DespawnOrUnsummon(2s); - } - } - - void Register() override - { - OnEffectHitTarget += SpellEffectFn(spell_q12805_lifeblood_dummy_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); - } - }; + bool Load() override + { + return GetCaster()->GetTypeId() == TYPEID_PLAYER; + } - SpellScript* GetSpellScript() const override + void HandleScript(SpellEffIndex /*effIndex*/) + { + Player* caster = GetCaster()->ToPlayer(); + if (Creature* target = GetHitCreature()) { - return new spell_q12805_lifeblood_dummy_SpellScript(); + caster->KilledMonsterCredit(NPC_SHARD_KILL_CREDIT); + target->CastSpell(target, uint32(GetEffectValue()), true); + target->DespawnOrUnsummon(2s); } + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_q12805_lifeblood_dummy::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + } }; /* @@ -1091,36 +887,25 @@ enum ChumTheWaterSummons }; // 66741 - Chum the Water -class spell_q14112_14145_chum_the_water: public SpellScriptLoader +class spell_q14112_14145_chum_the_water : public SpellScript { - public: - spell_q14112_14145_chum_the_water() : SpellScriptLoader("spell_q14112_14145_chum_the_water") { } - - class spell_q14112_14145_chum_the_water_SpellScript : public SpellScript - { - PrepareSpellScript(spell_q14112_14145_chum_the_water_SpellScript); + PrepareSpellScript(spell_q14112_14145_chum_the_water); - bool Validate(SpellInfo const* /*spellEntry*/) override - { - return ValidateSpellInfo({ SUMMON_ANGRY_KVALDIR, SUMMON_NORTH_SEA_MAKO, SUMMON_NORTH_SEA_THRESHER, SUMMON_NORTH_SEA_BLUE_SHARK }); - } - - void HandleScriptEffect(SpellEffIndex /*effIndex*/) - { - Unit* caster = GetCaster(); - caster->CastSpell(caster, RAND(SUMMON_ANGRY_KVALDIR, SUMMON_NORTH_SEA_MAKO, SUMMON_NORTH_SEA_THRESHER, SUMMON_NORTH_SEA_BLUE_SHARK)); - } + bool Validate(SpellInfo const* /*spellEntry*/) override + { + return ValidateSpellInfo({ SUMMON_ANGRY_KVALDIR, SUMMON_NORTH_SEA_MAKO, SUMMON_NORTH_SEA_THRESHER, SUMMON_NORTH_SEA_BLUE_SHARK }); + } - void Register() override - { - OnEffectHitTarget += SpellEffectFn(spell_q14112_14145_chum_the_water_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); - } - }; + void HandleScriptEffect(SpellEffIndex /*effIndex*/) + { + Unit* caster = GetCaster(); + caster->CastSpell(caster, RAND(SUMMON_ANGRY_KVALDIR, SUMMON_NORTH_SEA_MAKO, SUMMON_NORTH_SEA_THRESHER, SUMMON_NORTH_SEA_BLUE_SHARK)); + } - SpellScript* GetSpellScript() const override - { - return new spell_q14112_14145_chum_the_water_SpellScript(); - } + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_q14112_14145_chum_the_water::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + } }; enum RedSnapperVeryTasty @@ -1196,38 +981,27 @@ enum HodirsHelm }; // 56278 - Read Pronouncement -class spell_q12987_read_pronouncement : public SpellScriptLoader +class spell_q12987_read_pronouncement : public AuraScript { -public: - spell_q12987_read_pronouncement() : SpellScriptLoader("spell_q12987_read_pronouncement") { } + PrepareAuraScript(spell_q12987_read_pronouncement); - class spell_q12987_read_pronouncement_AuraScript : public AuraScript + void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { - PrepareAuraScript(spell_q12987_read_pronouncement_AuraScript); - - void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + // player must cast kill credit and do emote text, according to sniff + if (Player* target = GetTarget()->ToPlayer()) { - // player must cast kill credit and do emote text, according to sniff - if (Player* target = GetTarget()->ToPlayer()) + if (Creature* trigger = target->FindNearestCreature(NPC_ICE_SPIKE_BUNNY, 25.0f)) { - if (Creature* trigger = target->FindNearestCreature(NPC_ICE_SPIKE_BUNNY, 25.0f)) - { - sCreatureTextMgr->SendChat(trigger, SAY_1, target, CHAT_MSG_ADDON, LANG_ADDON, TEXT_RANGE_NORMAL, 0, SoundKitPlayType::Normal, TEAM_OTHER, false, target); - target->KilledMonsterCredit(NPC_KILLCREDIT); - sCreatureTextMgr->SendChat(trigger, SAY_2, target, CHAT_MSG_ADDON, LANG_ADDON, TEXT_RANGE_NORMAL, 0, SoundKitPlayType::Normal, TEAM_OTHER, false, target); - } + sCreatureTextMgr->SendChat(trigger, SAY_1, target, CHAT_MSG_ADDON, LANG_ADDON, TEXT_RANGE_NORMAL, 0, SoundKitPlayType::Normal, TEAM_OTHER, false, target); + target->KilledMonsterCredit(NPC_KILLCREDIT); + sCreatureTextMgr->SendChat(trigger, SAY_2, target, CHAT_MSG_ADDON, LANG_ADDON, TEXT_RANGE_NORMAL, 0, SoundKitPlayType::Normal, TEAM_OTHER, false, target); } } + } - void Register() override - { - AfterEffectApply += AuraEffectApplyFn(spell_q12987_read_pronouncement_AuraScript::OnApply, EFFECT_0, SPELL_AURA_NONE, AURA_EFFECT_HANDLE_REAL); - } - }; - - AuraScript* GetAuraScript() const override + void Register() override { - return new spell_q12987_read_pronouncement_AuraScript(); + AfterEffectApply += AuraEffectApplyFn(spell_q12987_read_pronouncement::OnApply, EFFECT_0, SPELL_AURA_NONE, AURA_EFFECT_HANDLE_REAL); } }; @@ -1241,52 +1015,41 @@ enum LeaveNothingToChance }; // 48742 - Wintergarde Mine Explosion -class spell_q12277_wintergarde_mine_explosion : public SpellScriptLoader +class spell_q12277_wintergarde_mine_explosion : public SpellScript { - public: - spell_q12277_wintergarde_mine_explosion() : SpellScriptLoader("spell_q12277_wintergarde_mine_explosion") { } + PrepareSpellScript(spell_q12277_wintergarde_mine_explosion); - class spell_q12277_wintergarde_mine_explosion_SpellScript : public SpellScript + void HandleDummy(SpellEffIndex /*effIndex*/) + { + if (Creature* unitTarget = GetHitCreature()) { - PrepareSpellScript(spell_q12277_wintergarde_mine_explosion_SpellScript); - - void HandleDummy(SpellEffIndex /*effIndex*/) + if (Unit* caster = GetCaster()) { - if (Creature* unitTarget = GetHitCreature()) + if (caster->GetTypeId() == TYPEID_UNIT) { - if (Unit* caster = GetCaster()) + if (Unit* owner = caster->GetOwner()) { - if (caster->GetTypeId() == TYPEID_UNIT) + switch (unitTarget->GetEntry()) { - if (Unit* owner = caster->GetOwner()) - { - switch (unitTarget->GetEntry()) - { - case NPC_UPPER_MINE_SHAFT: - caster->CastSpell(owner, SPELL_UPPER_MINE_SHAFT_CREDIT, true); - break; - case NPC_LOWER_MINE_SHAFT: - caster->CastSpell(owner, SPELL_LOWER_MINE_SHAFT_CREDIT, true); - break; - default: - break; - } - } + case NPC_UPPER_MINE_SHAFT: + caster->CastSpell(owner, SPELL_UPPER_MINE_SHAFT_CREDIT, true); + break; + case NPC_LOWER_MINE_SHAFT: + caster->CastSpell(owner, SPELL_LOWER_MINE_SHAFT_CREDIT, true); + break; + default: + break; } } } } - - void Register() override - { - OnEffectHitTarget += SpellEffectFn(spell_q12277_wintergarde_mine_explosion_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); - } - }; - - SpellScript* GetSpellScript() const override - { - return new spell_q12277_wintergarde_mine_explosion_SpellScript(); } + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_q12277_wintergarde_mine_explosion::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } }; enum FocusOnTheBeach @@ -1295,30 +1058,19 @@ enum FocusOnTheBeach }; // 50546 - The Focus on the Beach: Ley Line Focus Control Ring Effect -class spell_q12066_bunny_kill_credit : public SpellScriptLoader +class spell_q12066_bunny_kill_credit : public SpellScript { -public: - spell_q12066_bunny_kill_credit() : SpellScriptLoader("spell_q12066_bunny_kill_credit") { } + PrepareSpellScript(spell_q12066_bunny_kill_credit); - class spell_q12066_bunny_kill_credit_SpellScript : public SpellScript + void HandleDummy(SpellEffIndex /*effIndex*/) { - PrepareSpellScript(spell_q12066_bunny_kill_credit_SpellScript); - - void HandleDummy(SpellEffIndex /*effIndex*/) - { - if (Creature* target = GetHitCreature()) - target->CastSpell(GetCaster(), SPELL_BUNNY_CREDIT_BEAM, false); - } - - void Register() override - { - OnEffectHitTarget += SpellEffectFn(spell_q12066_bunny_kill_credit_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); - } - }; + if (Creature* target = GetHitCreature()) + target->CastSpell(GetCaster(), SPELL_BUNNY_CREDIT_BEAM, false); + } - SpellScript* GetSpellScript() const override + void Register() override { - return new spell_q12066_bunny_kill_credit_SpellScript(); + OnEffectHitTarget += SpellEffectFn(spell_q12066_bunny_kill_credit::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); } }; @@ -1334,44 +1086,33 @@ enum ACleansingSong }; // 52941 - Song of Cleansing -class spell_q12735_song_of_cleansing : public SpellScriptLoader +class spell_q12735_song_of_cleansing : public SpellScript { - public: - spell_q12735_song_of_cleansing() : SpellScriptLoader("spell_q12735_song_of_cleansing") { } - - class spell_q12735_song_of_cleansing_SpellScript : public SpellScript - { - PrepareSpellScript(spell_q12735_song_of_cleansing_SpellScript); - - void HandleScript(SpellEffIndex /*effIndex*/) - { - Unit* caster = GetCaster(); - switch (caster->GetAreaId()) - { - case AREA_BITTERTIDELAKE: - caster->CastSpell(caster, SPELL_SUMMON_SPIRIT_ATAH); - break; - case AREA_RIVERSHEART: - caster->CastSpell(caster, SPELL_SUMMON_SPIRIT_HAKHALAN); - break; - case AREA_WINTERGRASPRIVER: - caster->CastSpell(caster, SPELL_SUMMON_SPIRIT_KOOSU); - break; - default: - break; - } - } + PrepareSpellScript(spell_q12735_song_of_cleansing); - void Register() override - { - OnEffectHitTarget += SpellEffectFn(spell_q12735_song_of_cleansing_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); - } - }; - - SpellScript* GetSpellScript() const override + void HandleScript(SpellEffIndex /*effIndex*/) + { + Unit* caster = GetCaster(); + switch (caster->GetAreaId()) { - return new spell_q12735_song_of_cleansing_SpellScript(); + case AREA_BITTERTIDELAKE: + caster->CastSpell(caster, SPELL_SUMMON_SPIRIT_ATAH); + break; + case AREA_RIVERSHEART: + caster->CastSpell(caster, SPELL_SUMMON_SPIRIT_HAKHALAN); + break; + case AREA_WINTERGRASPRIVER: + caster->CastSpell(caster, SPELL_SUMMON_SPIRIT_KOOSU); + break; + default: + break; } + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_q12735_song_of_cleansing::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + } }; enum DefendingWyrmrestTemple @@ -1380,30 +1121,19 @@ enum DefendingWyrmrestTemple }; // 49213 - Defending Wyrmrest Temple: Character Script Cast From Gossip -class spell_q12372_cast_from_gossip_trigger : public SpellScriptLoader +class spell_q12372_cast_from_gossip_trigger : public SpellScript { - public: - spell_q12372_cast_from_gossip_trigger() : SpellScriptLoader("spell_q12372_cast_from_gossip_trigger") { } + PrepareSpellScript(spell_q12372_cast_from_gossip_trigger); - class spell_q12372_cast_from_gossip_trigger_SpellScript : public SpellScript - { - PrepareSpellScript(spell_q12372_cast_from_gossip_trigger_SpellScript); - - void HandleScript(SpellEffIndex /*effIndex*/) - { - GetCaster()->CastSpell(GetCaster(), SPELL_SUMMON_WYRMREST_DEFENDER, true); - } - - void Register() override - { - OnEffectHitTarget += SpellEffectFn(spell_q12372_cast_from_gossip_trigger_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); - } - }; + void HandleScript(SpellEffIndex /*effIndex*/) + { + GetCaster()->CastSpell(GetCaster(), SPELL_SUMMON_WYRMREST_DEFENDER, true); + } - SpellScript* GetSpellScript() const override - { - return new spell_q12372_cast_from_gossip_trigger_SpellScript(); - } + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_q12372_cast_from_gossip_trigger::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + } }; // http://www.wowhead.com/quest=12372 Defending Wyrmrest Temple @@ -1416,35 +1146,24 @@ enum Quest12372Data }; // 49370 - Wyrmrest Defender: Destabilize Azure Dragonshrine Effect -class spell_q12372_destabilize_azure_dragonshrine_dummy : public SpellScriptLoader +class spell_q12372_destabilize_azure_dragonshrine_dummy : public SpellScript { - public: - spell_q12372_destabilize_azure_dragonshrine_dummy() : SpellScriptLoader("spell_q12372_destabilize_azure_dragonshrine_dummy") { } - - class spell_q12372_destabilize_azure_dragonshrine_dummy_SpellScript : public SpellScript - { - PrepareSpellScript(spell_q12372_destabilize_azure_dragonshrine_dummy_SpellScript); + PrepareSpellScript(spell_q12372_destabilize_azure_dragonshrine_dummy); - void HandleDummy(SpellEffIndex /*effIndex*/) - { - if (GetHitCreature()) - if (Unit* caster = GetOriginalCaster()) - if (Vehicle* vehicle = caster->GetVehicleKit()) - if (Unit* passenger = vehicle->GetPassenger(0)) - if (Player* player = passenger->ToPlayer()) - player->KilledMonsterCredit(NPC_WYRMREST_TEMPLE_CREDIT); - } - - void Register() override - { - OnEffectHitTarget += SpellEffectFn(spell_q12372_destabilize_azure_dragonshrine_dummy_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); - } - }; + void HandleDummy(SpellEffIndex /*effIndex*/) + { + if (GetHitCreature()) + if (Unit* caster = GetOriginalCaster()) + if (Vehicle* vehicle = caster->GetVehicleKit()) + if (Unit* passenger = vehicle->GetPassenger(0)) + if (Player* player = passenger->ToPlayer()) + player->KilledMonsterCredit(NPC_WYRMREST_TEMPLE_CREDIT); + } - SpellScript* GetSpellScript() const override - { - return new spell_q12372_destabilize_azure_dragonshrine_dummy_SpellScript(); - } + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_q12372_destabilize_azure_dragonshrine_dummy::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } }; enum q12372Creatures @@ -1453,32 +1172,21 @@ enum q12372Creatures }; // 50287 - Azure Dragon: On Death Force Cast Wyrmrest Defender to Whisper to Controller - Random (cast from Azure Dragons and Azure Drakes on death) -class spell_q12372_azure_on_death_force_whisper : public SpellScriptLoader +class spell_q12372_azure_on_death_force_whisper : public SpellScript { - public: - spell_q12372_azure_on_death_force_whisper() : SpellScriptLoader("spell_q12372_azure_on_death_force_whisper") { } - - class spell_q12372_azure_on_death_force_whisper_SpellScript : public SpellScript - { - PrepareSpellScript(spell_q12372_azure_on_death_force_whisper_SpellScript); + PrepareSpellScript(spell_q12372_azure_on_death_force_whisper); - void HandleScript(SpellEffIndex /*effIndex*/) - { - Creature* defender = GetHitCreature(); - if (defender && defender->GetEntry() == NPC_WYRMREST_DEFENDER) - defender->AI()->Talk(WHISPER_ON_HIT_BY_FORCE_WHISPER, defender->GetCharmerOrOwner()); - } - - void Register() override - { - OnEffectHitTarget += SpellEffectFn(spell_q12372_azure_on_death_force_whisper_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); - } - }; + void HandleScript(SpellEffIndex /*effIndex*/) + { + Creature* defender = GetHitCreature(); + if (defender && defender->GetEntry() == NPC_WYRMREST_DEFENDER) + defender->AI()->Talk(WHISPER_ON_HIT_BY_FORCE_WHISPER, defender->GetCharmerOrOwner()); + } - SpellScript* GetSpellScript() const override - { - return new spell_q12372_azure_on_death_force_whisper_SpellScript(); - } + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_q12372_azure_on_death_force_whisper::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + } }; // "Bombing Run" and "Bomb Them Again!" @@ -1493,160 +1201,105 @@ enum Quest11010_11102_11023Data }; // 40113 - Knockdown Fel Cannon: The Aggro Check Aura -class spell_q11010_q11102_q11023_aggro_check_aura : public SpellScriptLoader +class spell_q11010_q11102_q11023_aggro_check_aura : public AuraScript { - public: - spell_q11010_q11102_q11023_aggro_check_aura() : SpellScriptLoader("spell_q11010_q11102_q11023_aggro_check_aura") { } + PrepareAuraScript(spell_q11010_q11102_q11023_aggro_check_aura); - class spell_q11010_q11102_q11023_aggro_check_aura_AuraScript : public AuraScript - { - PrepareAuraScript(spell_q11010_q11102_q11023_aggro_check_aura_AuraScript); - - void HandleTriggerSpell(AuraEffect const* /*aurEff*/) - { - if (Unit* target = GetTarget()) - // On trigger proccing - target->CastSpell(target, SPELL_AGGRO_CHECK); - } - - void Register() override - { - OnEffectPeriodic += AuraEffectPeriodicFn(spell_q11010_q11102_q11023_aggro_check_aura_AuraScript::HandleTriggerSpell, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL); - } - }; + void HandleTriggerSpell(AuraEffect const* /*aurEff*/) + { + if (Unit* target = GetTarget()) + // On trigger proccing + target->CastSpell(target, SPELL_AGGRO_CHECK); + } - AuraScript* GetAuraScript() const override - { - return new spell_q11010_q11102_q11023_aggro_check_aura_AuraScript(); - } + void Register() override + { + OnEffectPeriodic += AuraEffectPeriodicFn(spell_q11010_q11102_q11023_aggro_check_aura::HandleTriggerSpell, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL); + } }; // 40112 - Knockdown Fel Cannon: The Aggro Check -class spell_q11010_q11102_q11023_aggro_check : public SpellScriptLoader +class spell_q11010_q11102_q11023_aggro_check : public SpellScript { - public: - spell_q11010_q11102_q11023_aggro_check() : SpellScriptLoader("spell_q11010_q11102_q11023_aggro_check") { } - - class spell_q11010_q11102_q11023_aggro_check_SpellScript : public SpellScript - { - PrepareSpellScript(spell_q11010_q11102_q11023_aggro_check_SpellScript); + PrepareSpellScript(spell_q11010_q11102_q11023_aggro_check); - void HandleDummy(SpellEffIndex /*effIndex*/) - { - if (Player* playerTarget = GetHitPlayer()) - // Check if found player target is on fly mount or using flying form - if (playerTarget->HasAuraType(SPELL_AURA_FLY) || playerTarget->HasAuraType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED)) - playerTarget->CastSpell(playerTarget, SPELL_FLAK_CANNON_TRIGGER, TRIGGERED_IGNORE_CASTER_MOUNTED_OR_ON_VEHICLE); - } - - void Register() override - { - OnEffectHitTarget += SpellEffectFn(spell_q11010_q11102_q11023_aggro_check_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); - } - }; + void HandleDummy(SpellEffIndex /*effIndex*/) + { + if (Player* playerTarget = GetHitPlayer()) + // Check if found player target is on fly mount or using flying form + if (playerTarget->HasAuraType(SPELL_AURA_FLY) || playerTarget->HasAuraType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED)) + playerTarget->CastSpell(playerTarget, SPELL_FLAK_CANNON_TRIGGER, TRIGGERED_IGNORE_CASTER_MOUNTED_OR_ON_VEHICLE); + } - SpellScript* GetSpellScript() const override - { - return new spell_q11010_q11102_q11023_aggro_check_SpellScript(); - } + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_q11010_q11102_q11023_aggro_check::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } }; // 40119 - Knockdown Fel Cannon: The Aggro Burst -class spell_q11010_q11102_q11023_aggro_burst : public SpellScriptLoader +class spell_q11010_q11102_q11023_aggro_burst : public AuraScript { - public: - spell_q11010_q11102_q11023_aggro_burst() : SpellScriptLoader("spell_q11010_q11102_q11023_aggro_burst") { } + PrepareAuraScript(spell_q11010_q11102_q11023_aggro_burst); - class spell_q11010_q11102_q11023_aggro_burst_AuraScript : public AuraScript - { - PrepareAuraScript(spell_q11010_q11102_q11023_aggro_burst_AuraScript); - - void HandleEffectPeriodic(AuraEffect const* /*aurEff*/) - { - if (Unit* target = GetTarget()) - // On each tick cast Choose Loc to trigger summon - target->CastSpell(target, SPELL_CHOOSE_LOC); - } - - void Register() override - { - OnEffectPeriodic += AuraEffectPeriodicFn(spell_q11010_q11102_q11023_aggro_burst_AuraScript::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY); - } - }; + void HandleEffectPeriodic(AuraEffect const* /*aurEff*/) + { + if (Unit* target = GetTarget()) + // On each tick cast Choose Loc to trigger summon + target->CastSpell(target, SPELL_CHOOSE_LOC); + } - AuraScript* GetAuraScript() const override - { - return new spell_q11010_q11102_q11023_aggro_burst_AuraScript(); - } + void Register() override + { + OnEffectPeriodic += AuraEffectPeriodicFn(spell_q11010_q11102_q11023_aggro_burst::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY); + } }; // 40056 - Knockdown Fel Cannon: Choose Loc -class spell_q11010_q11102_q11023_choose_loc : public SpellScriptLoader +class spell_q11010_q11102_q11023_choose_loc : public SpellScript { - public: - spell_q11010_q11102_q11023_choose_loc() : SpellScriptLoader("spell_q11010_q11102_q11023_choose_loc") { } - - class spell_q11010_q11102_q11023_choose_loc_SpellScript : public SpellScript - { - PrepareSpellScript(spell_q11010_q11102_q11023_choose_loc_SpellScript); + PrepareSpellScript(spell_q11010_q11102_q11023_choose_loc); - void HandleDummy(SpellEffIndex /*effIndex*/) - { - Unit* caster = GetCaster(); - // Check for player that is in 65 y range - std::list<Player*> playerList; - Trinity::AnyPlayerInObjectRangeCheck checker(caster, 65.0f); - Trinity::PlayerListSearcher<Trinity::AnyPlayerInObjectRangeCheck> searcher(caster, playerList, checker); - Cell::VisitWorldObjects(caster, searcher, 65.0f); - for (std::list<Player*>::const_iterator itr = playerList.begin(); itr != playerList.end(); ++itr) - // Check if found player target is on fly mount or using flying form - if ((*itr)->HasAuraType(SPELL_AURA_FLY) || (*itr)->HasAuraType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED)) - // Summom Fel Cannon (bunny version) at found player - caster->SummonCreature(NPC_FEL_CANNON2, (*itr)->GetPositionX(), (*itr)->GetPositionY(), (*itr)->GetPositionZ()); - } - - void Register() override - { - OnEffectHit += SpellEffectFn(spell_q11010_q11102_q11023_choose_loc_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); - } - }; + void HandleDummy(SpellEffIndex /*effIndex*/) + { + Unit* caster = GetCaster(); + // Check for player that is in 65 y range + std::list<Player*> playerList; + Trinity::AnyPlayerInObjectRangeCheck checker(caster, 65.0f); + Trinity::PlayerListSearcher<Trinity::AnyPlayerInObjectRangeCheck> searcher(caster, playerList, checker); + Cell::VisitWorldObjects(caster, searcher, 65.0f); + for (std::list<Player*>::const_iterator itr = playerList.begin(); itr != playerList.end(); ++itr) + // Check if found player target is on fly mount or using flying form + if ((*itr)->HasAuraType(SPELL_AURA_FLY) || (*itr)->HasAuraType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED)) + // Summom Fel Cannon (bunny version) at found player + caster->SummonCreature(NPC_FEL_CANNON2, (*itr)->GetPositionX(), (*itr)->GetPositionY(), (*itr)->GetPositionZ()); + } - SpellScript* GetSpellScript() const override - { - return new spell_q11010_q11102_q11023_choose_loc_SpellScript(); - } + void Register() override + { + OnEffectHit += SpellEffectFn(spell_q11010_q11102_q11023_choose_loc::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } }; // 39844 - Skyguard Blasting Charge // 40160 - Throw Bomb -class spell_q11010_q11102_q11023_q11008_check_fly_mount : public SpellScriptLoader +class spell_q11010_q11102_q11023_q11008_check_fly_mount : public SpellScript { - public: - spell_q11010_q11102_q11023_q11008_check_fly_mount() : SpellScriptLoader("spell_q11010_q11102_q11023_q11008_check_fly_mount") { } - - class spell_q11010_q11102_q11023_q11008_check_fly_mount_SpellScript : public SpellScript - { - PrepareSpellScript(spell_q11010_q11102_q11023_q11008_check_fly_mount_SpellScript); - - SpellCastResult CheckRequirement() - { - Unit* caster = GetCaster(); - // This spell will be cast only if caster has one of these auras - if (!(caster->HasAuraType(SPELL_AURA_FLY) || caster->HasAuraType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED))) - return SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW; - return SPELL_CAST_OK; - } + PrepareSpellScript(spell_q11010_q11102_q11023_q11008_check_fly_mount); - void Register() override - { - OnCheckCast += SpellCheckCastFn(spell_q11010_q11102_q11023_q11008_check_fly_mount_SpellScript::CheckRequirement); - } - }; + SpellCastResult CheckRequirement() + { + Unit* caster = GetCaster(); + // This spell will be cast only if caster has one of these auras + if (!(caster->HasAuraType(SPELL_AURA_FLY) || caster->HasAuraType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED))) + return SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW; + return SPELL_CAST_OK; + } - SpellScript* GetSpellScript() const override - { - return new spell_q11010_q11102_q11023_q11008_check_fly_mount_SpellScript(); - } + void Register() override + { + OnCheckCast += SpellCheckCastFn(spell_q11010_q11102_q11023_q11008_check_fly_mount::CheckRequirement); + } }; enum RecoverTheCargo @@ -1687,69 +1340,47 @@ enum SpellZuldrakRat }; // 50894 - Zul'Drak Rat -class spell_q12527_zuldrak_rat : public SpellScriptLoader +class spell_q12527_zuldrak_rat : public SpellScript { - public: - spell_q12527_zuldrak_rat() : SpellScriptLoader("spell_q12527_zuldrak_rat") { } - - class spell_q12527_zuldrak_rat_SpellScript : public SpellScript - { - PrepareSpellScript(spell_q12527_zuldrak_rat_SpellScript); + PrepareSpellScript(spell_q12527_zuldrak_rat); - bool Validate(SpellInfo const* /*spell*/) override - { - return ValidateSpellInfo({ SPELL_SUMMON_GORGED_LURKING_BASILISK }); - } - - void HandleScriptEffect(SpellEffIndex /* effIndex */) - { - if (GetHitAura() && GetHitAura()->GetStackAmount() >= GetSpellInfo()->StackAmount) - { - GetHitUnit()->CastSpell(nullptr, SPELL_SUMMON_GORGED_LURKING_BASILISK, true); - if (Creature* basilisk = GetHitUnit()->ToCreature()) - basilisk->DespawnOrUnsummon(); - } - } - - void Register() override - { - OnEffectHitTarget += SpellEffectFn(spell_q12527_zuldrak_rat_SpellScript::HandleScriptEffect, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT); - } - }; + bool Validate(SpellInfo const* /*spell*/) override + { + return ValidateSpellInfo({ SPELL_SUMMON_GORGED_LURKING_BASILISK }); + } - SpellScript* GetSpellScript() const override + void HandleScriptEffect(SpellEffIndex /* effIndex */) + { + if (GetHitAura() && GetHitAura()->GetStackAmount() >= GetSpellInfo()->StackAmount) { - return new spell_q12527_zuldrak_rat_SpellScript(); + GetHitUnit()->CastSpell(nullptr, SPELL_SUMMON_GORGED_LURKING_BASILISK, true); + if (Creature* basilisk = GetHitUnit()->ToCreature()) + basilisk->DespawnOrUnsummon(); } + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_q12527_zuldrak_rat::HandleScriptEffect, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT); + } }; // 55368 - Summon Stefan -class spell_q12661_q12669_q12676_q12677_q12713_summon_stefan : public SpellScriptLoader +class spell_q12661_q12669_q12676_q12677_q12713_summon_stefan : public SpellScript { - public: - spell_q12661_q12669_q12676_q12677_q12713_summon_stefan() : SpellScriptLoader("spell_q12661_q12669_q12676_q12677_q12713_summon_stefan") { } + PrepareSpellScript(spell_q12661_q12669_q12676_q12677_q12713_summon_stefan); - class spell_q12661_q12669_q12676_q12677_q12713_summon_stefan_SpellScript : public SpellScript - { - PrepareSpellScript(spell_q12661_q12669_q12676_q12677_q12713_summon_stefan_SpellScript); - - void SetDest(SpellDestination& dest) - { - // Adjust effect summon position - Position const offset = { 0.0f, 0.0f, 20.0f, 0.0f }; - dest.RelocateOffset(offset); - } - - void Register() override - { - OnDestinationTargetSelect += SpellDestinationTargetSelectFn(spell_q12661_q12669_q12676_q12677_q12713_summon_stefan_SpellScript::SetDest, EFFECT_0, TARGET_DEST_CASTER_BACK); - } - }; + void SetDest(SpellDestination& dest) + { + // Adjust effect summon position + Position const offset = { 0.0f, 0.0f, 20.0f, 0.0f }; + dest.RelocateOffset(offset); + } - SpellScript* GetSpellScript() const override - { - return new spell_q12661_q12669_q12676_q12677_q12713_summon_stefan_SpellScript(); - } + void Register() override + { + OnDestinationTargetSelect += SpellDestinationTargetSelectFn(spell_q12661_q12669_q12676_q12677_q12713_summon_stefan::SetDest, EFFECT_0, TARGET_DEST_CASTER_BACK); + } }; enum QuenchingMist @@ -1758,35 +1389,24 @@ enum QuenchingMist }; // 53350 - Quenching Mist -class spell_q12730_quenching_mist : public SpellScriptLoader +class spell_q12730_quenching_mist : public AuraScript { - public: - spell_q12730_quenching_mist() : SpellScriptLoader("spell_q12730_quenching_mist") { } + PrepareAuraScript(spell_q12730_quenching_mist); - class spell_q12730_quenching_mist_AuraScript : public AuraScript - { - PrepareAuraScript(spell_q12730_quenching_mist_AuraScript); - - bool Validate(SpellInfo const* /*spellInfo*/) override - { - return ValidateSpellInfo({ SPELL_FLICKERING_FLAMES }); - } - - void HandleEffectPeriodic(AuraEffect const* /*aurEff*/) - { - GetTarget()->RemoveAurasDueToSpell(SPELL_FLICKERING_FLAMES); - } + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo({ SPELL_FLICKERING_FLAMES }); + } - void Register() override - { - OnEffectPeriodic += AuraEffectPeriodicFn(spell_q12730_quenching_mist_AuraScript::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_HEAL); - } - }; + void HandleEffectPeriodic(AuraEffect const* /*aurEff*/) + { + GetTarget()->RemoveAurasDueToSpell(SPELL_FLICKERING_FLAMES); + } - AuraScript* GetAuraScript() const override - { - return new spell_q12730_quenching_mist_AuraScript(); - } + void Register() override + { + OnEffectPeriodic += AuraEffectPeriodicFn(spell_q12730_quenching_mist::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_HEAL); + } }; // 13291 - Borrowed Technology/13292 - The Solution Solution /Daily//13239 - Volatility/13261 - Volatiliy /Daily// @@ -1800,97 +1420,64 @@ enum Quest13291_13292_13239_13261Data }; // 59318 - Grab Fake Soldier -class spell_q13291_q13292_q13239_q13261_frostbrood_skytalon_grab_decoy : public SpellScriptLoader +class spell_q13291_q13292_q13239_q13261_frostbrood_skytalon_grab_decoy : public SpellScript { - public: - spell_q13291_q13292_q13239_q13261_frostbrood_skytalon_grab_decoy() : SpellScriptLoader("spell_q13291_q13292_q13239_q13261_frostbrood_skytalon_grab_decoy") { } - - class spell_q13291_q13292_q13239_q13261_frostbrood_skytalon_grab_decoy_SpellScript : public SpellScript - { - PrepareSpellScript(spell_q13291_q13292_q13239_q13261_frostbrood_skytalon_grab_decoy_SpellScript); + PrepareSpellScript(spell_q13291_q13292_q13239_q13261_frostbrood_skytalon_grab_decoy); - bool Validate(SpellInfo const* /*spell*/) override - { - return ValidateSpellInfo({ SPELL_RIDE }); - } - - void HandleDummy(SpellEffIndex /*effIndex*/) - { - if (!GetHitCreature()) - return; - // TO DO: Being triggered is hack, but in checkcast it doesn't pass aurastate requirements. - // Beside that the decoy won't keep it's freeze animation state when enter. - GetHitCreature()->CastSpell(GetCaster(), SPELL_RIDE, true); - } + bool Validate(SpellInfo const* /*spell*/) override + { + return ValidateSpellInfo({ SPELL_RIDE }); + } - void Register() override - { - OnEffectHitTarget += SpellEffectFn(spell_q13291_q13292_q13239_q13261_frostbrood_skytalon_grab_decoy_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); - } - }; + void HandleDummy(SpellEffIndex /*effIndex*/) + { + if (!GetHitCreature()) + return; + // TO DO: Being triggered is hack, but in checkcast it doesn't pass aurastate requirements. + // Beside that the decoy won't keep it's freeze animation state when enter. + GetHitCreature()->CastSpell(GetCaster(), SPELL_RIDE, true); + } - SpellScript* GetSpellScript() const override - { - return new spell_q13291_q13292_q13239_q13261_frostbrood_skytalon_grab_decoy_SpellScript(); - } + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_q13291_q13292_q13239_q13261_frostbrood_skytalon_grab_decoy::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } }; // 59303 - Summon Frost Wyrm -class spell_q13291_q13292_q13239_q13261_armored_decoy_summon_skytalon : public SpellScriptLoader +class spell_q13291_q13292_q13239_q13261_armored_decoy_summon_skytalon : public SpellScript { - public: - spell_q13291_q13292_q13239_q13261_armored_decoy_summon_skytalon() : SpellScriptLoader("spell_q13291_q13292_q13239_q13261_armored_decoy_summon_skytalon") { } - - class spell_q13291_q13292_q13239_q13261_armored_decoy_summon_skytalon_SpellScript : public SpellScript - { - PrepareSpellScript(spell_q13291_q13292_q13239_q13261_armored_decoy_summon_skytalon_SpellScript); - - void SetDest(SpellDestination& dest) - { - // Adjust effect summon position - Position const offset = { 0.0f, 0.0f, 20.0f, 0.0f }; - dest.RelocateOffset(offset); - } + PrepareSpellScript(spell_q13291_q13292_q13239_q13261_armored_decoy_summon_skytalon); - void Register() override - { - OnDestinationTargetSelect += SpellDestinationTargetSelectFn(spell_q13291_q13292_q13239_q13261_armored_decoy_summon_skytalon_SpellScript::SetDest, EFFECT_0, TARGET_DEST_CASTER_BACK); - } - }; + void SetDest(SpellDestination& dest) + { + // Adjust effect summon position + Position const offset = { 0.0f, 0.0f, 20.0f, 0.0f }; + dest.RelocateOffset(offset); + } - SpellScript* GetSpellScript() const override - { - return new spell_q13291_q13292_q13239_q13261_armored_decoy_summon_skytalon_SpellScript(); - } + void Register() override + { + OnDestinationTargetSelect += SpellDestinationTargetSelectFn(spell_q13291_q13292_q13239_q13261_armored_decoy_summon_skytalon::SetDest, EFFECT_0, TARGET_DEST_CASTER_BACK); + } }; // 12601 - Second Chances: Summon Landgren's Soul Moveto Target Bunny -class spell_q12847_summon_soul_moveto_bunny : public SpellScriptLoader +class spell_q12847_summon_soul_moveto_bunny : public SpellScript { - public: - spell_q12847_summon_soul_moveto_bunny() : SpellScriptLoader("spell_q12847_summon_soul_moveto_bunny") { } + PrepareSpellScript(spell_q12847_summon_soul_moveto_bunny); - class spell_q12847_summon_soul_moveto_bunny_SpellScript : public SpellScript - { - PrepareSpellScript(spell_q12847_summon_soul_moveto_bunny_SpellScript); - - void SetDest(SpellDestination& dest) - { - // Adjust effect summon position - Position const offset = { 0.0f, 0.0f, 2.5f, 0.0f }; - dest.RelocateOffset(offset); - } - - void Register() override - { - OnDestinationTargetSelect += SpellDestinationTargetSelectFn(spell_q12847_summon_soul_moveto_bunny_SpellScript::SetDest, EFFECT_0, TARGET_DEST_CASTER); - } - }; + void SetDest(SpellDestination& dest) + { + // Adjust effect summon position + Position const offset = { 0.0f, 0.0f, 2.5f, 0.0f }; + dest.RelocateOffset(offset); + } - SpellScript* GetSpellScript() const override - { - return new spell_q12847_summon_soul_moveto_bunny_SpellScript(); - } + void Register() override + { + OnDestinationTargetSelect += SpellDestinationTargetSelectFn(spell_q12847_summon_soul_moveto_bunny::SetDest, EFFECT_0, TARGET_DEST_CASTER); + } }; enum BearFlankMaster @@ -1900,89 +1487,67 @@ enum BearFlankMaster }; // 56565 - Bear Flank Master -class spell_q13011_bear_flank_master : public SpellScriptLoader +class spell_q13011_bear_flank_master : public SpellScript { - public: - spell_q13011_bear_flank_master() : SpellScriptLoader("spell_q13011_bear_flank_master") { } + PrepareSpellScript(spell_q13011_bear_flank_master); - class spell_q13011_bear_flank_master_SpellScript : public SpellScript + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo( { - PrepareSpellScript(spell_q13011_bear_flank_master_SpellScript); - - bool Validate(SpellInfo const* /*spellInfo*/) override - { - return ValidateSpellInfo( - { - SPELL_CREATE_BEAR_FLANK, - SPELL_BEAR_FLANK_FAIL - }); - } - - bool Load() override - { - return GetCaster()->GetTypeId() == TYPEID_UNIT; - } + SPELL_CREATE_BEAR_FLANK, + SPELL_BEAR_FLANK_FAIL + }); + } - void HandleScript(SpellEffIndex /*effIndex*/) - { - if (Player* player = GetHitPlayer()) - { - if (roll_chance_i(50)) - { - Creature* creature = GetCaster()->ToCreature(); - player->CastSpell(creature, SPELL_BEAR_FLANK_FAIL); - creature->AI()->Talk(0, player); - } - else - player->CastSpell(player, SPELL_CREATE_BEAR_FLANK); - } - } + bool Load() override + { + return GetCaster()->GetTypeId() == TYPEID_UNIT; + } - void Register() override + void HandleScript(SpellEffIndex /*effIndex*/) + { + if (Player* player = GetHitPlayer()) + { + if (roll_chance_i(50)) { - OnEffectHitTarget += SpellEffectFn(spell_q13011_bear_flank_master_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + Creature* creature = GetCaster()->ToCreature(); + player->CastSpell(creature, SPELL_BEAR_FLANK_FAIL); + creature->AI()->Talk(0, player); } - }; - - SpellScript* GetSpellScript() const override - { - return new spell_q13011_bear_flank_master_SpellScript(); + else + player->CastSpell(player, SPELL_CREATE_BEAR_FLANK); } + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_q13011_bear_flank_master::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + } }; // 57385 - Argent Cannon // 57412 - Reckoning Bomb -class spell_q13086_cannons_target : public SpellScriptLoader +class spell_q13086_cannons_target : public SpellScript { - public: - spell_q13086_cannons_target() : SpellScriptLoader("spell_q13086_cannons_target") { } - - class spell_q13086_cannons_target_SpellScript : public SpellScript - { - PrepareSpellScript(spell_q13086_cannons_target_SpellScript); + PrepareSpellScript(spell_q13086_cannons_target); - bool Validate(SpellInfo const* spellInfo) override - { - return !spellInfo->GetEffects().empty() - && ValidateSpellInfo({ static_cast<uint32>(spellInfo->GetEffect(EFFECT_0).CalcValue()) }); - } - - void HandleEffectDummy(SpellEffIndex /*effIndex*/) - { - if (WorldLocation const* pos = GetExplTargetDest()) - GetCaster()->CastSpell(pos->GetPosition(), GetEffectValue(), true); - } + bool Validate(SpellInfo const* spellInfo) override + { + return !spellInfo->GetEffects().empty() + && ValidateSpellInfo({ static_cast<uint32>(spellInfo->GetEffect(EFFECT_0).CalcValue()) }); + } - void Register() override - { - OnEffectHit += SpellEffectFn(spell_q13086_cannons_target_SpellScript::HandleEffectDummy, EFFECT_0, SPELL_EFFECT_DUMMY); - } - }; + void HandleEffectDummy(SpellEffIndex /*effIndex*/) + { + if (WorldLocation const* pos = GetExplTargetDest()) + GetCaster()->CastSpell(pos->GetPosition(), GetEffectValue(), true); + } - SpellScript* GetSpellScript() const override - { - return new spell_q13086_cannons_target_SpellScript(); - } + void Register() override + { + OnEffectHit += SpellEffectFn(spell_q13086_cannons_target::HandleEffectDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } }; enum BurstAtTheSeams @@ -2245,66 +1810,44 @@ enum EscapeFromSilverbrook }; // 48682 - Escape from Silverbrook - Periodic Dummy -class spell_q12308_escape_from_silverbrook : public SpellScriptLoader +class spell_q12308_escape_from_silverbrook : public SpellScript { - public: - spell_q12308_escape_from_silverbrook() : SpellScriptLoader("spell_q12308_escape_from_silverbrook") { } - - class spell_q12308_escape_from_silverbrook_SpellScript : public SpellScript - { - PrepareSpellScript(spell_q12308_escape_from_silverbrook_SpellScript); + PrepareSpellScript(spell_q12308_escape_from_silverbrook); - bool Validate(SpellInfo const* /*spellInfo*/) override - { - return ValidateSpellInfo({ SPELL_SUMMON_WORGEN }); - } - - void HandleDummy(SpellEffIndex /*effIndex*/) - { - GetCaster()->CastSpell(GetCaster(), SPELL_SUMMON_WORGEN, true); - } + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo({ SPELL_SUMMON_WORGEN }); + } - void Register() override - { - OnEffectHit += SpellEffectFn(spell_q12308_escape_from_silverbrook_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); - } - }; + void HandleDummy(SpellEffIndex /*effIndex*/) + { + GetCaster()->CastSpell(GetCaster(), SPELL_SUMMON_WORGEN, true); + } - SpellScript* GetSpellScript() const override - { - return new spell_q12308_escape_from_silverbrook_SpellScript(); - } + void Register() override + { + OnEffectHit += SpellEffectFn(spell_q12308_escape_from_silverbrook::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } }; // 48681 - Summon Silverbrook Worgen -class spell_q12308_escape_from_silverbrook_summon_worgen : public SpellScriptLoader +class spell_q12308_escape_from_silverbrook_summon_worgen : public SpellScript { - public: - spell_q12308_escape_from_silverbrook_summon_worgen() : SpellScriptLoader("spell_q12308_escape_from_silverbrook_summon_worgen") { } - - class spell_q12308_escape_from_silverbrook_summon_worgen_SpellScript : public SpellScript - { - PrepareSpellScript(spell_q12308_escape_from_silverbrook_summon_worgen_SpellScript); - - void ModDest(SpellDestination& dest) - { - float dist = GetEffectInfo(EFFECT_0).CalcRadius(GetCaster()); - float angle = frand(0.75f, 1.25f) * float(M_PI); + PrepareSpellScript(spell_q12308_escape_from_silverbrook_summon_worgen); - Position pos = GetCaster()->GetNearPosition(dist, angle); - dest.Relocate(pos); - } + void ModDest(SpellDestination& dest) + { + float dist = GetEffectInfo(EFFECT_0).CalcRadius(GetCaster()); + float angle = frand(0.75f, 1.25f) * float(M_PI); - void Register() override - { - OnDestinationTargetSelect += SpellDestinationTargetSelectFn(spell_q12308_escape_from_silverbrook_summon_worgen_SpellScript::ModDest, EFFECT_0, TARGET_DEST_CASTER_SUMMON); - } - }; + Position pos = GetCaster()->GetNearPosition(dist, angle); + dest.Relocate(pos); + } - SpellScript* GetSpellScript() const override - { - return new spell_q12308_escape_from_silverbrook_summon_worgen_SpellScript(); - } + void Register() override + { + OnDestinationTargetSelect += SpellDestinationTargetSelectFn(spell_q12308_escape_from_silverbrook_summon_worgen::ModDest, EFFECT_0, TARGET_DEST_CASTER_SUMMON); + } }; enum BasicOrdersEmote @@ -2372,61 +1915,50 @@ enum DeathComesFromOnHigh }; // 51858 - Siphon of Acherus -class spell_q12641_death_comes_from_on_high : public SpellScriptLoader +class spell_q12641_death_comes_from_on_high : public SpellScript { - public: - spell_q12641_death_comes_from_on_high() : SpellScriptLoader("spell_q12641_death_comes_from_on_high") { } + PrepareSpellScript(spell_q12641_death_comes_from_on_high); - class spell_q12641_death_comes_from_on_high_SpellScript : public SpellScript + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo( { - PrepareSpellScript(spell_q12641_death_comes_from_on_high_SpellScript); - - bool Validate(SpellInfo const* /*spellInfo*/) override - { - return ValidateSpellInfo( - { - SPELL_FORGE_CREDIT, - SPELL_TOWN_HALL_CREDIT, - SPELL_SCARLET_HOLD_CREDIT, - SPELL_CHAPEL_CREDIT - }); - } - - void HandleDummy(SpellEffIndex /*effIndex*/) - { - uint32 spellId = 0; - - switch (GetHitCreature()->GetEntry()) - { - case NPC_NEW_AVALON_FORGE: - spellId = SPELL_FORGE_CREDIT; - break; - case NPC_NEW_AVALON_TOWN_HALL: - spellId = SPELL_TOWN_HALL_CREDIT; - break; - case NPC_SCARLET_HOLD: - spellId = SPELL_SCARLET_HOLD_CREDIT; - break; - case NPC_CHAPEL_OF_THE_CRIMSON_FLAME: - spellId = SPELL_CHAPEL_CREDIT; - break; - default: - return; - } - - GetCaster()->CastSpell(nullptr, spellId, true); - } + SPELL_FORGE_CREDIT, + SPELL_TOWN_HALL_CREDIT, + SPELL_SCARLET_HOLD_CREDIT, + SPELL_CHAPEL_CREDIT + }); + } - void Register() override - { - OnEffectHitTarget += SpellEffectFn(spell_q12641_death_comes_from_on_high_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); - } - }; + void HandleDummy(SpellEffIndex /*effIndex*/) + { + uint32 spellId = 0; - SpellScript* GetSpellScript() const override + switch (GetHitCreature()->GetEntry()) { - return new spell_q12641_death_comes_from_on_high_SpellScript(); + case NPC_NEW_AVALON_FORGE: + spellId = SPELL_FORGE_CREDIT; + break; + case NPC_NEW_AVALON_TOWN_HALL: + spellId = SPELL_TOWN_HALL_CREDIT; + break; + case NPC_SCARLET_HOLD: + spellId = SPELL_SCARLET_HOLD_CREDIT; + break; + case NPC_CHAPEL_OF_THE_CRIMSON_FLAME: + spellId = SPELL_CHAPEL_CREDIT; + break; + default: + return; } + + GetCaster()->CastSpell(nullptr, spellId, true); + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_q12641_death_comes_from_on_high::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } }; enum Recall_Eye_of_Acherus @@ -2435,91 +1967,58 @@ enum Recall_Eye_of_Acherus }; // 52694 - Recall Eye of Acherus -class spell_q12641_recall_eye_of_acherus : public SpellScriptLoader +class spell_q12641_recall_eye_of_acherus : public SpellScript { - public: - spell_q12641_recall_eye_of_acherus() : SpellScriptLoader("spell_q12641_recall_eye_of_acherus") { } - - class spell_q12641_recall_eye_of_acherus_SpellScript : public SpellScript - { - PrepareSpellScript(spell_q12641_recall_eye_of_acherus_SpellScript); - - void HandleDummy(SpellEffIndex /*effIndex*/) - { - if (Player* player = GetCaster()->GetCharmerOrOwner()->ToPlayer()) - { - player->StopCastingCharm(); - player->StopCastingBindSight(); - player->RemoveAura(THE_EYE_OF_ACHERUS); - } - } - - void Register() override - { - OnEffectHitTarget += SpellEffectFn(spell_q12641_recall_eye_of_acherus_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); - } - }; + PrepareSpellScript(spell_q12641_recall_eye_of_acherus); - SpellScript* GetSpellScript() const override + void HandleDummy(SpellEffIndex /*effIndex*/) + { + if (Player* player = GetCaster()->GetCharmerOrOwner()->ToPlayer()) { - return new spell_q12641_recall_eye_of_acherus_SpellScript(); + player->StopCastingCharm(); + player->StopCastingBindSight(); + player->RemoveAura(THE_EYE_OF_ACHERUS); } + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_q12641_recall_eye_of_acherus::HandleDummy, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + } }; // 51769 - Emblazon Runeblade -class spell_q12619_emblazon_runeblade : public SpellScriptLoader +class spell_q12619_emblazon_runeblade : public AuraScript { - public: - spell_q12619_emblazon_runeblade() : SpellScriptLoader("spell_q12619_emblazon_runeblade") { } + PrepareAuraScript(spell_q12619_emblazon_runeblade); - class spell_q12619_emblazon_runeblade_AuraScript : public AuraScript - { - PrepareAuraScript(spell_q12619_emblazon_runeblade_AuraScript); - - void HandleEffectPeriodic(AuraEffect const* aurEff) - { - PreventDefaultAction(); - if (Unit* caster = GetCaster()) - caster->CastSpell(caster, aurEff->GetSpellEffectInfo().TriggerSpell, aurEff); - } - - void Register() override - { - OnEffectPeriodic += AuraEffectPeriodicFn(spell_q12619_emblazon_runeblade_AuraScript::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL); - } - }; + void HandleEffectPeriodic(AuraEffect const* aurEff) + { + PreventDefaultAction(); + if (Unit* caster = GetCaster()) + caster->CastSpell(caster, aurEff->GetSpellEffectInfo().TriggerSpell, aurEff); + } - AuraScript* GetAuraScript() const override - { - return new spell_q12619_emblazon_runeblade_AuraScript(); - } + void Register() override + { + OnEffectPeriodic += AuraEffectPeriodicFn(spell_q12619_emblazon_runeblade::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL); + } }; // 51770 - Emblazon Runeblade -class spell_q12619_emblazon_runeblade_effect : public SpellScriptLoader +class spell_q12619_emblazon_runeblade_effect : public SpellScript { - public: - spell_q12619_emblazon_runeblade_effect() : SpellScriptLoader("spell_q12619_emblazon_runeblade_effect") { } - - class spell_q12619_emblazon_runeblade_effect_SpellScript : public SpellScript - { - PrepareSpellScript(spell_q12619_emblazon_runeblade_effect_SpellScript); + PrepareSpellScript(spell_q12619_emblazon_runeblade_effect); - void HandleScript(SpellEffIndex /*effIndex*/) - { - GetCaster()->CastSpell(GetCaster(), uint32(GetEffectValue()), false); - } - - void Register() override - { - OnEffectHit += SpellEffectFn(spell_q12619_emblazon_runeblade_effect_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); - } - }; + void HandleScript(SpellEffIndex /*effIndex*/) + { + GetCaster()->CastSpell(GetCaster(), uint32(GetEffectValue()), false); + } - SpellScript* GetSpellScript() const override - { - return new spell_q12619_emblazon_runeblade_effect_SpellScript(); - } + void Register() override + { + OnEffectHit += SpellEffectFn(spell_q12619_emblazon_runeblade_effect::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + } }; enum Quest_The_Storm_King @@ -2529,40 +2028,29 @@ enum Quest_The_Storm_King }; // 55516 - Gymer's Grab -class spell_q12919_gymers_grab : public SpellScriptLoader +class spell_q12919_gymers_grab : public SpellScript { - public: - spell_q12919_gymers_grab() : SpellScriptLoader("spell_q12919_gymers_grab") { } - - class spell_q12919_gymers_grab_SpellScript : public SpellScript - { - PrepareSpellScript(spell_q12919_gymers_grab_SpellScript); + PrepareSpellScript(spell_q12919_gymers_grab); - bool Validate(SpellInfo const* /*spell*/) override - { - return ValidateSpellInfo({ SPELL_RIDE_GYMER }); - } - - void HandleScript(SpellEffIndex /*effIndex*/) - { - if (!GetHitCreature()) - return; - CastSpellExtraArgs args(TRIGGERED_FULL_MASK); - args.AddSpellBP0(2); - GetHitCreature()->CastSpell(GetCaster(), SPELL_RIDE_GYMER, args); - GetHitCreature()->CastSpell(GetHitCreature(), SPELL_GRABBED, true); - } + bool Validate(SpellInfo const* /*spell*/) override + { + return ValidateSpellInfo({ SPELL_RIDE_GYMER }); + } - void Register() override - { - OnEffectHitTarget += SpellEffectFn(spell_q12919_gymers_grab_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); - } - }; + void HandleScript(SpellEffIndex /*effIndex*/) + { + if (!GetHitCreature()) + return; + CastSpellExtraArgs args(TRIGGERED_FULL_MASK); + args.AddSpellBP0(2); + GetHitCreature()->CastSpell(GetCaster(), SPELL_RIDE_GYMER, args); + GetHitCreature()->CastSpell(GetHitCreature(), SPELL_GRABBED, true); + } - SpellScript* GetSpellScript() const override - { - return new spell_q12919_gymers_grab_SpellScript(); - } + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_q12919_gymers_grab::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + } }; enum Quest_The_Storm_King_Throw @@ -2571,36 +2059,25 @@ enum Quest_The_Storm_King_Throw }; // 55421 - Gymer's Throw -class spell_q12919_gymers_throw : public SpellScriptLoader +class spell_q12919_gymers_throw : public SpellScript { - public: - spell_q12919_gymers_throw() : SpellScriptLoader("spell_q12919_gymers_throw") { } - - class spell_q12919_gymers_throw_SpellScript : public SpellScript - { - PrepareSpellScript(spell_q12919_gymers_throw_SpellScript); - - void HandleScript(SpellEffIndex /*effIndex*/) - { - Unit* caster = GetCaster(); - if (caster->IsVehicle()) - if (Unit* passenger = caster->GetVehicleKit()->GetPassenger(1)) - { - passenger->ExitVehicle(); - caster->CastSpell(passenger, SPELL_VARGUL_EXPLOSION, true); - } - } + PrepareSpellScript(spell_q12919_gymers_throw); - void Register() override + void HandleScript(SpellEffIndex /*effIndex*/) + { + Unit* caster = GetCaster(); + if (caster->IsVehicle()) + if (Unit* passenger = caster->GetVehicleKit()->GetPassenger(1)) { - OnEffectHitTarget += SpellEffectFn(spell_q12919_gymers_throw_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + passenger->ExitVehicle(); + caster->CastSpell(passenger, SPELL_VARGUL_EXPLOSION, true); } - }; + } - SpellScript* GetSpellScript() const override - { - return new spell_q12919_gymers_throw_SpellScript(); - } + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_q12919_gymers_throw::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + } }; enum Quest_The_Hunter_And_The_Prince @@ -2609,38 +2086,27 @@ enum Quest_The_Hunter_And_The_Prince }; // 61752 - Illidan Kill Credit Master -class spell_q13400_illidan_kill_master : public SpellScriptLoader +class spell_q13400_illidan_kill_master : public SpellScript { - public: - spell_q13400_illidan_kill_master() : SpellScriptLoader("spell_q13400_illidan_kill_master") { } + PrepareSpellScript(spell_q13400_illidan_kill_master); - class spell_q13400_illidan_kill_master_SpellScript : public SpellScript - { - PrepareSpellScript(spell_q13400_illidan_kill_master_SpellScript); - - bool Validate(SpellInfo const* /*spellInfo*/) override - { - return ValidateSpellInfo({ SPELL_ILLIDAN_KILL_CREDIT }); - } - - void HandleDummy(SpellEffIndex /*effIndex*/) - { - Unit* caster = GetCaster(); - if (caster->IsVehicle()) - if (Unit* passenger = caster->GetVehicleKit()->GetPassenger(0)) - passenger->CastSpell(passenger, SPELL_ILLIDAN_KILL_CREDIT, true); - } + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo({ SPELL_ILLIDAN_KILL_CREDIT }); + } - void Register() override - { - OnEffectHitTarget += SpellEffectFn(spell_q13400_illidan_kill_master_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); - } - }; + void HandleDummy(SpellEffIndex /*effIndex*/) + { + Unit* caster = GetCaster(); + if (caster->IsVehicle()) + if (Unit* passenger = caster->GetVehicleKit()->GetPassenger(0)) + passenger->CastSpell(passenger, SPELL_ILLIDAN_KILL_CREDIT, true); + } - SpellScript* GetSpellScript() const override - { - return new spell_q13400_illidan_kill_master_SpellScript(); - } + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_q13400_illidan_kill_master::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } }; enum RelicOfTheEarthenRing @@ -2649,36 +2115,25 @@ enum RelicOfTheEarthenRing }; // 66744 - Make Player Destroy Totems -class spell_q14100_q14111_make_player_destroy_totems : public SpellScriptLoader +class spell_q14100_q14111_make_player_destroy_totems : public SpellScript { - public: - spell_q14100_q14111_make_player_destroy_totems() : SpellScriptLoader("spell_q14100_q14111_make_player_destroy_totems") { } + PrepareSpellScript(spell_q14100_q14111_make_player_destroy_totems); - class spell_q14100_q14111_make_player_destroy_totems_SpellScript : public SpellScript - { - PrepareSpellScript(spell_q14100_q14111_make_player_destroy_totems_SpellScript); - - bool Validate(SpellInfo const* /*spellInfo*/) override - { - return ValidateSpellInfo({ SPELL_TOTEM_OF_THE_EARTHEN_RING }); - } - - void HandleScriptEffect(SpellEffIndex /*effIndex*/) - { - if (Player* player = GetHitPlayer()) - player->CastSpell(player, SPELL_TOTEM_OF_THE_EARTHEN_RING, TRIGGERED_FULL_MASK); // ignore reagent cost, consumed by quest - } + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo({ SPELL_TOTEM_OF_THE_EARTHEN_RING }); + } - void Register() override - { - OnEffectHitTarget += SpellEffectFn(spell_q14100_q14111_make_player_destroy_totems_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); - } - }; + void HandleScriptEffect(SpellEffIndex /*effIndex*/) + { + if (Player* player = GetHitPlayer()) + player->CastSpell(player, SPELL_TOTEM_OF_THE_EARTHEN_RING, TRIGGERED_FULL_MASK); // ignore reagent cost, consumed by quest + } - SpellScript* GetSpellScript() const override - { - return new spell_q14100_q14111_make_player_destroy_totems_SpellScript(); - } + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_q14100_q14111_make_player_destroy_totems::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + } }; enum Fumping @@ -2688,38 +2143,27 @@ enum Fumping }; // 39238 - Fumping -class spell_q10929_fumping : SpellScriptLoader +class spell_q10929_fumping : public AuraScript { - public: - spell_q10929_fumping() : SpellScriptLoader("spell_q10929_fumping") { } - - class spell_q10929_fumpingAuraScript : public AuraScript - { - PrepareAuraScript(spell_q10929_fumpingAuraScript); + PrepareAuraScript(spell_q10929_fumping); - bool Validate(SpellInfo const* /*spell*/) override - { - return ValidateSpellInfo({ SPELL_SUMMON_SAND_GNOME, SPELL_SUMMON_BONE_SLICER }); - } - - void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) - { - if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE) - return; + bool Validate(SpellInfo const* /*spell*/) override + { + return ValidateSpellInfo({ SPELL_SUMMON_SAND_GNOME, SPELL_SUMMON_BONE_SLICER }); + } - if (Unit* caster = GetCaster()) - caster->CastSpell(caster, urand(SPELL_SUMMON_SAND_GNOME, SPELL_SUMMON_BONE_SLICER), true); - } + void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE) + return; - void Register() override - { - OnEffectRemove += AuraEffectRemoveFn(spell_q10929_fumpingAuraScript::HandleEffectRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); - } - }; + if (Unit* caster = GetCaster()) + caster->CastSpell(caster, urand(SPELL_SUMMON_SAND_GNOME, SPELL_SUMMON_BONE_SLICER), true); + } - AuraScript* GetAuraScript() const override + void Register() override { - return new spell_q10929_fumpingAuraScript(); + OnEffectRemove += AuraEffectRemoveFn(spell_q10929_fumping::HandleEffectRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); } }; @@ -2796,91 +2240,58 @@ public: }; // 49285 - Hand Over Reins -class spell_q12414_hand_over_reins : public SpellScriptLoader +class spell_q12414_hand_over_reins : public SpellScript { - public: - spell_q12414_hand_over_reins() : SpellScriptLoader("spell_q12414_hand_over_reins") { } - - class spell_q12414_hand_over_reins_SpellScript : public SpellScript - { - PrepareSpellScript(spell_q12414_hand_over_reins_SpellScript); - - void HandleScript(SpellEffIndex /*effIndex*/) - { - Creature* caster = GetCaster()->ToCreature(); - GetHitUnit()->ExitVehicle(); + PrepareSpellScript(spell_q12414_hand_over_reins); - if (caster) - caster->DespawnOrUnsummon(); - } + void HandleScript(SpellEffIndex /*effIndex*/) + { + Creature* caster = GetCaster()->ToCreature(); + GetHitUnit()->ExitVehicle(); - void Register() override - { - OnEffectHitTarget += SpellEffectFn(spell_q12414_hand_over_reins_SpellScript::HandleScript, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT); - } - }; + if (caster) + caster->DespawnOrUnsummon(); + } - SpellScript* GetSpellScript() const override - { - return new spell_q12414_hand_over_reins_SpellScript(); - } + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_q12414_hand_over_reins::HandleScript, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT); + } }; // 13790 13793 13811 13814 - Among the Champions // 13665 13745 13750 13756 13761 13767 13772 13777 13782 13787 - The Grand Melee -class spell_q13665_q13790_bested_trigger : public SpellScriptLoader +class spell_q13665_q13790_bested_trigger : public SpellScript { - public: - spell_q13665_q13790_bested_trigger() : SpellScriptLoader("spell_q13665_q13790_bested_trigger") { } + PrepareSpellScript(spell_q13665_q13790_bested_trigger); - class spell_q13665_q13790_bested_trigger_SpellScript : public SpellScript - { - PrepareSpellScript(spell_q13665_q13790_bested_trigger_SpellScript); - - void HandleScript(SpellEffIndex /*effIndex*/) - { - Unit* target = GetHitUnit()->GetCharmerOrOwnerOrSelf(); - target->CastSpell(target, uint32(GetEffectValue()), true); - } - - void Register() override - { - OnEffectHitTarget += SpellEffectFn(spell_q13665_q13790_bested_trigger_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); - } - }; + void HandleScript(SpellEffIndex /*effIndex*/) + { + Unit* target = GetHitUnit()->GetCharmerOrOwnerOrSelf(); + target->CastSpell(target, uint32(GetEffectValue()), true); + } - SpellScript* GetSpellScript() const override - { - return new spell_q13665_q13790_bested_trigger_SpellScript(); - } + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_q13665_q13790_bested_trigger::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + } }; // herald of war and life without regret portal spells // 59064 - Portal to Orgrimmar // 59439 - Portal to Undercity -class spell_59064_59439_portals : public SpellScriptLoader +class spell_59064_59439_portals : public SpellScript { -public: - spell_59064_59439_portals() : SpellScriptLoader("spell_59064_59439_portals") { } + PrepareSpellScript(spell_59064_59439_portals); - class spell_59064_59439_portals_SpellScript : public SpellScript + void HandleScript(SpellEffIndex /*effIndex*/) { - PrepareSpellScript(spell_59064_59439_portals_SpellScript); - - void HandleScript(SpellEffIndex /*effIndex*/) - { - GetHitUnit()->CastSpell(GetHitUnit(), uint32(GetEffectValue())); - } - - void Register() override - { - OnEffectHitTarget += SpellEffectFn(spell_59064_59439_portals_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); - } - }; + GetHitUnit()->CastSpell(GetHitUnit(), uint32(GetEffectValue())); + } - SpellScript* GetSpellScript() const override + void Register() override { - return new spell_59064_59439_portals_SpellScript(); + OnEffectHitTarget += SpellEffectFn(spell_59064_59439_portals::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); } }; @@ -2899,132 +2310,88 @@ enum ApplyHeatAndStir }; // 43972 - Mixing Blood -class spell_q11306_mixing_blood : public SpellScriptLoader +class spell_q11306_mixing_blood : public SpellScript { -public: - spell_q11306_mixing_blood() : SpellScriptLoader("spell_q11306_mixing_blood") { } + PrepareSpellScript(spell_q11306_mixing_blood); - class spell_q11306_mixing_blood_SpellScript : public SpellScript + void HandleEffect(SpellEffIndex /*effIndex*/) { - PrepareSpellScript(spell_q11306_mixing_blood_SpellScript); - - void HandleEffect(SpellEffIndex /*effIndex*/) - { - if (Unit* caster = GetCaster()) - if (Creature* trigger = caster->FindNearestCreature(CREATURE_GENERIC_TRIGGER_LAB, 100.0f)) - trigger->AI()->DoCastSelf(SPELL_SPURTS_AND_SMOKE); - } - - void Register() override - { - OnEffectHit += SpellEffectFn(spell_q11306_mixing_blood_SpellScript::HandleEffect, EFFECT_1, SPELL_EFFECT_SEND_EVENT); - } - }; + if (Unit* caster = GetCaster()) + if (Creature* trigger = caster->FindNearestCreature(CREATURE_GENERIC_TRIGGER_LAB, 100.0f)) + trigger->AI()->DoCastSelf(SPELL_SPURTS_AND_SMOKE); + } - SpellScript* GetSpellScript() const override + void Register() override { - return new spell_q11306_mixing_blood_SpellScript(); + OnEffectHit += SpellEffectFn(spell_q11306_mixing_blood::HandleEffect, EFFECT_1, SPELL_EFFECT_SEND_EVENT); } }; // 43375 - Mixing Vrykul Blood -class spell_q11306_mixing_vrykul_blood : public SpellScriptLoader +class spell_q11306_mixing_vrykul_blood : public SpellScript { - public: - spell_q11306_mixing_vrykul_blood() : SpellScriptLoader("spell_q11306_mixing_vrykul_blood") { } + PrepareSpellScript(spell_q11306_mixing_vrykul_blood); - class spell_q11306_mixing_vrykul_blood_SpellScript : public SpellScript + void HandleDummy(SpellEffIndex /*effIndex*/) + { + if (Unit* caster = GetCaster()) { - PrepareSpellScript(spell_q11306_mixing_vrykul_blood_SpellScript); + uint8 chance = urand(0, 99); + uint32 spellId = 0; - void HandleDummy(SpellEffIndex /*effIndex*/) - { - if (Unit* caster = GetCaster()) - { - uint8 chance = urand(0, 99); - uint32 spellId = 0; - - // 90% chance of getting one out of three failure effects - if (chance < 30) - spellId = SPELL_FAILED_MIX_1; - else if (chance < 60) - spellId = SPELL_FAILED_MIX_2; - else if (chance < 90) - spellId = SPELL_FAILED_MIX_3; - else // 10% chance of successful cast - spellId = SPELL_SUCCESSFUL_MIX; - - caster->CastSpell(caster, spellId, true); - } - } + // 90% chance of getting one out of three failure effects + if (chance < 30) + spellId = SPELL_FAILED_MIX_1; + else if (chance < 60) + spellId = SPELL_FAILED_MIX_2; + else if (chance < 90) + spellId = SPELL_FAILED_MIX_3; + else // 10% chance of successful cast + spellId = SPELL_SUCCESSFUL_MIX; - void Register() override - { - OnEffectHitTarget += SpellEffectFn(spell_q11306_mixing_vrykul_blood_SpellScript::HandleDummy, EFFECT_1, SPELL_EFFECT_DUMMY); - } - }; - - SpellScript* GetSpellScript() const override - { - return new spell_q11306_mixing_vrykul_blood_SpellScript(); + caster->CastSpell(caster, spellId, true); } + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_q11306_mixing_vrykul_blood::HandleDummy, EFFECT_1, SPELL_EFFECT_DUMMY); + } }; // 43376 - Failed Mix -class spell_q11306_failed_mix_43376 : public SpellScriptLoader +class spell_q11306_failed_mix_43376 : public SpellScript { -public: - spell_q11306_failed_mix_43376() : SpellScriptLoader("spell_q11306_failed_mix_43376") { } + PrepareSpellScript(spell_q11306_failed_mix_43376); - class spell_q11306_failed_mix_43376_SpellScript : public SpellScript + void HandleEffect(SpellEffIndex /*effIndex*/) { - PrepareSpellScript(spell_q11306_failed_mix_43376_SpellScript); - - void HandleEffect(SpellEffIndex /*effIndex*/) - { - if (Unit* caster = GetCaster()) - if (Creature* trigger = caster->FindNearestCreature(CREATURE_GENERIC_TRIGGER_LAB, 100.0f)) - trigger->AI()->Talk(TALK_0, caster); - } - - void Register() override - { - OnEffectHit += SpellEffectFn(spell_q11306_failed_mix_43376_SpellScript::HandleEffect, EFFECT_1, SPELL_EFFECT_SEND_EVENT); - } - }; + if (Unit* caster = GetCaster()) + if (Creature* trigger = caster->FindNearestCreature(CREATURE_GENERIC_TRIGGER_LAB, 100.0f)) + trigger->AI()->Talk(TALK_0, caster); + } - SpellScript* GetSpellScript() const override + void Register() override { - return new spell_q11306_failed_mix_43376_SpellScript(); + OnEffectHit += SpellEffectFn(spell_q11306_failed_mix_43376::HandleEffect, EFFECT_1, SPELL_EFFECT_SEND_EVENT); } }; // 43378 - Failed Mix -class spell_q11306_failed_mix_43378 : public SpellScriptLoader +class spell_q11306_failed_mix_43378 : public SpellScript { -public: - spell_q11306_failed_mix_43378() : SpellScriptLoader("spell_q11306_failed_mix_43378") { } + PrepareSpellScript(spell_q11306_failed_mix_43378); - class spell_q11306_failed_mix_43378_SpellScript : public SpellScript + void HandleEffect(SpellEffIndex /*effIndex*/) { - PrepareSpellScript(spell_q11306_failed_mix_43378_SpellScript); - - void HandleEffect(SpellEffIndex /*effIndex*/) - { - if (Unit* caster = GetCaster()) - if (Creature* trigger = caster->FindNearestCreature(CREATURE_GENERIC_TRIGGER_LAB, 100.0f)) - trigger->AI()->Talk(TALK_1, caster); - } - - void Register() override - { - OnEffectHit += SpellEffectFn(spell_q11306_failed_mix_43378_SpellScript::HandleEffect, EFFECT_2, SPELL_EFFECT_SEND_EVENT); - } - }; + if (Unit* caster = GetCaster()) + if (Creature* trigger = caster->FindNearestCreature(CREATURE_GENERIC_TRIGGER_LAB, 100.0f)) + trigger->AI()->Talk(TALK_1, caster); + } - SpellScript* GetSpellScript() const override + void Register() override { - return new spell_q11306_failed_mix_43378_SpellScript(); + OnEffectHit += SpellEffectFn(spell_q11306_failed_mix_43378::HandleEffect, EFFECT_2, SPELL_EFFECT_SEND_EVENT); } }; @@ -3087,52 +2454,52 @@ void AddSC_quest_spell_scripts() { new spell_q55_sacred_cleansing(); RegisterSpellScript(spell_q1846_bending_shinbone); - new spell_q2203_thaumaturgy_channel(); - new spell_q5206_test_fetid_skull(); - new spell_q6124_6129_apply_salve(); + RegisterSpellScript(spell_q2203_thaumaturgy_channel); + RegisterSpellScript(spell_q5206_test_fetid_skull); + RegisterSpellScript(spell_q6124_6129_apply_salve); new spell_q10255_administer_antidote(); - new spell_q11396_11399_force_shield_arcane_purple_x3(); - new spell_q11396_11399_scourging_crystal_controller(); - new spell_q11396_11399_scourging_crystal_controller_dummy(); + RegisterSpellScript(spell_q11396_11399_force_shield_arcane_purple_x3); + RegisterSpellScript(spell_q11396_11399_scourging_crystal_controller); + RegisterSpellScript(spell_q11396_11399_scourging_crystal_controller_dummy); new spell_q11515_fel_siphon_dummy(); - new spell_q11587_arcane_prisoner_rescue(); - new spell_q11730_ultrasonic_screwdriver(); - new spell_q12459_seeds_of_natures_wrath(); - new spell_q12634_despawn_fruit_tosser(); - new spell_q12683_take_sputum_sample(); - new spell_q12851_going_bearback(); - new spell_q12937_relief_for_the_fallen(); - new spell_q10041_q10040_who_are_they(); - new spell_symbol_of_life_dummy(); - new spell_q12659_ahunaes_knife(); - new spell_q9874_liquid_fire(); - new spell_q12805_lifeblood_dummy(); + RegisterSpellScript(spell_q11587_arcane_prisoner_rescue); + RegisterSpellScript(spell_q11730_ultrasonic_screwdriver); + RegisterSpellScript(spell_q12459_seeds_of_natures_wrath); + RegisterSpellScript(spell_q12634_despawn_fruit_tosser); + RegisterSpellScript(spell_q12683_take_sputum_sample); + RegisterSpellScript(spell_q12851_going_bearback); + RegisterSpellScript(spell_q12937_relief_for_the_fallen); + RegisterSpellScript(spell_q10041_q10040_who_are_they); + RegisterSpellScript(spell_symbol_of_life_dummy); + RegisterSpellScript(spell_q12659_ahunaes_knife); + RegisterSpellScript(spell_q9874_liquid_fire); + RegisterSpellScript(spell_q12805_lifeblood_dummy); RegisterSpellScript(spell_q13280_13283_plant_battle_standard); RegisterSpellScript(spell_q13280_13283_jump_jets); - new spell_q14112_14145_chum_the_water(); + RegisterSpellScript(spell_q14112_14145_chum_the_water); RegisterSpellScript(spell_q9452_cast_net); RegisterSpellScript(spell_q14076_14092_pound_drum); - new spell_q12987_read_pronouncement(); - new spell_q12277_wintergarde_mine_explosion(); - new spell_q12066_bunny_kill_credit(); - new spell_q12735_song_of_cleansing(); - new spell_q12372_cast_from_gossip_trigger(); - new spell_q12372_destabilize_azure_dragonshrine_dummy(); - new spell_q11010_q11102_q11023_aggro_check_aura(); - new spell_q11010_q11102_q11023_aggro_check(); - new spell_q11010_q11102_q11023_aggro_burst(); - new spell_q11010_q11102_q11023_choose_loc(); - new spell_q11010_q11102_q11023_q11008_check_fly_mount(); + RegisterSpellScript(spell_q12987_read_pronouncement); + RegisterSpellScript(spell_q12277_wintergarde_mine_explosion); + RegisterSpellScript(spell_q12066_bunny_kill_credit); + RegisterSpellScript(spell_q12735_song_of_cleansing); + RegisterSpellScript(spell_q12372_cast_from_gossip_trigger); + RegisterSpellScript(spell_q12372_destabilize_azure_dragonshrine_dummy); + RegisterSpellScript(spell_q11010_q11102_q11023_aggro_check_aura); + RegisterSpellScript(spell_q11010_q11102_q11023_aggro_check); + RegisterSpellScript(spell_q11010_q11102_q11023_aggro_burst); + RegisterSpellScript(spell_q11010_q11102_q11023_choose_loc); + RegisterSpellScript(spell_q11010_q11102_q11023_q11008_check_fly_mount); RegisterSpellScript(spell_q11140salvage_wreckage); - new spell_q12372_azure_on_death_force_whisper(); - new spell_q12527_zuldrak_rat(); - new spell_q12661_q12669_q12676_q12677_q12713_summon_stefan(); - new spell_q12730_quenching_mist(); - new spell_q13291_q13292_q13239_q13261_frostbrood_skytalon_grab_decoy(); - new spell_q13291_q13292_q13239_q13261_armored_decoy_summon_skytalon(); - new spell_q12847_summon_soul_moveto_bunny(); - new spell_q13011_bear_flank_master(); - new spell_q13086_cannons_target(); + RegisterSpellScript(spell_q12372_azure_on_death_force_whisper); + RegisterSpellScript(spell_q12527_zuldrak_rat); + RegisterSpellScript(spell_q12661_q12669_q12676_q12677_q12713_summon_stefan); + RegisterSpellScript(spell_q12730_quenching_mist); + RegisterSpellScript(spell_q13291_q13292_q13239_q13261_frostbrood_skytalon_grab_decoy); + RegisterSpellScript(spell_q13291_q13292_q13239_q13261_armored_decoy_summon_skytalon); + RegisterSpellScript(spell_q12847_summon_soul_moveto_bunny); + RegisterSpellScript(spell_q13011_bear_flank_master); + RegisterSpellScript(spell_q13086_cannons_target); RegisterSpellScript(spell_q13264_q13276_q13288_q13289_burst_at_the_seams_59576); RegisterSpellScript(spell_q13264_q13276_q13288_q13289_burst_at_the_seams_59579); RegisterSpellScript(spell_q13264_q13276_q13288_q13289_bloated_abom_feign_death); @@ -3140,26 +2507,26 @@ void AddSC_quest_spell_scripts() RegisterSpellScript(spell_q13264_q13276_q13288_q13289_assign_credit_to_master); RegisterSpellScript(spell_q12690_burst_at_the_seams_52510); RegisterSpellScript(spell_q11896_weakness_to_lightning_46444); - new spell_q12308_escape_from_silverbrook_summon_worgen(); - new spell_q12308_escape_from_silverbrook(); + RegisterSpellScript(spell_q12308_escape_from_silverbrook_summon_worgen); + RegisterSpellScript(spell_q12308_escape_from_silverbrook); RegisterSpellScript(spell_q25199_emote); - new spell_q12641_death_comes_from_on_high(); - new spell_q12641_recall_eye_of_acherus(); - new spell_q12619_emblazon_runeblade(); - new spell_q12619_emblazon_runeblade_effect(); - new spell_q12919_gymers_grab(); - new spell_q12919_gymers_throw(); - new spell_q13400_illidan_kill_master(); - new spell_q14100_q14111_make_player_destroy_totems(); - new spell_q10929_fumping(); + RegisterSpellScript(spell_q12641_death_comes_from_on_high); + RegisterSpellScript(spell_q12641_recall_eye_of_acherus); + RegisterSpellScript(spell_q12619_emblazon_runeblade); + RegisterSpellScript(spell_q12619_emblazon_runeblade_effect); + RegisterSpellScript(spell_q12919_gymers_grab); + RegisterSpellScript(spell_q12919_gymers_throw); + RegisterSpellScript(spell_q13400_illidan_kill_master); + RegisterSpellScript(spell_q14100_q14111_make_player_destroy_totems); + RegisterSpellScript(spell_q10929_fumping); new spell_q28813_get_our_boys_back_dummy(); new spell_q28813_set_health_random(); - new spell_q12414_hand_over_reins(); - new spell_q13665_q13790_bested_trigger(); - new spell_59064_59439_portals(); - new spell_q11306_mixing_blood(); - new spell_q11306_mixing_vrykul_blood(); - new spell_q11306_failed_mix_43376(); - new spell_q11306_failed_mix_43378(); + RegisterSpellScript(spell_q12414_hand_over_reins); + RegisterSpellScript(spell_q13665_q13790_bested_trigger); + RegisterSpellScript(spell_59064_59439_portals); + RegisterSpellScript(spell_q11306_mixing_blood); + RegisterSpellScript(spell_q11306_mixing_vrykul_blood); + RegisterSpellScript(spell_q11306_failed_mix_43376); + RegisterSpellScript(spell_q11306_failed_mix_43378); RegisterSpellScript(spell_q14386_call_attack_mastiffs); } |