diff --git a/data/sql/updates/pending_db_world/rev_1719036750384415139.sql b/data/sql/updates/pending_db_world/rev_1719036750384415139.sql new file mode 100644 index 000000000..081ab49c6 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1719036750384415139.sql @@ -0,0 +1,5 @@ +-- +UPDATE `spell_script_names` SET `ScriptName`='spell_the_eye_countercharge_aura' WHERE `spell_id`=35035; +UPDATE `spell_script_names` SET `ScriptName`='spell_botanica_call_of_the_falcon_aura' WHERE `spell_id`=34852; +UPDATE `spell_script_names` SET `ScriptName`='spell_botanica_shift_form_aura' WHERE `spell_id`=34201; +UPDATE `spell_script_names` SET `ScriptName`='spell_arcatraz_soul_steal_aura' WHERE `spell_id`=36778; diff --git a/src/server/scripts/Outland/TempestKeep/Eye/instance_the_eye.cpp b/src/server/scripts/Outland/TempestKeep/Eye/instance_the_eye.cpp index 5164b994d..4da9dbc14 100644 --- a/src/server/scripts/Outland/TempestKeep/Eye/instance_the_eye.cpp +++ b/src/server/scripts/Outland/TempestKeep/Eye/instance_the_eye.cpp @@ -145,37 +145,26 @@ public: } }; -class spell_the_eye_countercharge : public SpellScriptLoader +class spell_the_eye_countercharge_aura : public AuraScript { -public: - spell_the_eye_countercharge() : SpellScriptLoader("spell_the_eye_countercharge") { } + PrepareAuraScript(spell_the_eye_countercharge_aura); - class spell_the_eye_counterchargeScript : public AuraScript + bool PrepareProc(ProcEventInfo& /*eventInfo*/) { - PrepareAuraScript(spell_the_eye_counterchargeScript); + // xinef: prevent charge drop + PreventDefaultAction(); + return true; + } - bool PrepareProc(ProcEventInfo& /*eventInfo*/) - { - // xinef: prevent charge drop - PreventDefaultAction(); - return true; - } - - void Register() override - { - DoCheckProc += AuraCheckProcFn(spell_the_eye_counterchargeScript::PrepareProc); - } - }; - - AuraScript* GetAuraScript() const override + void Register() override { - return new spell_the_eye_counterchargeScript(); + DoCheckProc += AuraCheckProcFn(spell_the_eye_countercharge_aura::PrepareProc); } }; void AddSC_instance_the_eye() { new instance_the_eye(); - new spell_the_eye_countercharge(); + RegisterSpellScript(spell_the_eye_countercharge_aura); } diff --git a/src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.cpp b/src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.cpp index 424e3b1e2..fbe462b86 100644 --- a/src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.cpp +++ b/src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.cpp @@ -585,37 +585,31 @@ public: } }; -class spell_arcatraz_soul_steal : public SpellScriptLoader +class spell_arcatraz_soul_steal_aura : public AuraScript { -public: - spell_arcatraz_soul_steal() : SpellScriptLoader("spell_arcatraz_soul_steal") { } + PrepareAuraScript(spell_arcatraz_soul_steal_aura); - class spell_arcatraz_soul_steal_AuraScript : public AuraScript + bool Validate(SpellInfo const* /*spellInfo*/) override { - PrepareAuraScript(spell_arcatraz_soul_steal_AuraScript) + return ValidateSpellInfo({ SPELL_SOUL_STEAL }); + } - void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) - { - if (Unit* caster = GetCaster()) - caster->CastSpell(caster, SPELL_SOUL_STEAL, true); - } - - void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) - { - if (Unit* caster = GetCaster()) - caster->RemoveAurasDueToSpell(SPELL_SOUL_STEAL); - } - - void Register() override - { - OnEffectApply += AuraEffectApplyFn(spell_arcatraz_soul_steal_AuraScript::HandleEffectApply, EFFECT_0, SPELL_AURA_MOD_DAMAGE_PERCENT_DONE, AURA_EFFECT_HANDLE_REAL); - OnEffectRemove += AuraEffectRemoveFn(spell_arcatraz_soul_steal_AuraScript::HandleEffectRemove, EFFECT_0, SPELL_AURA_MOD_DAMAGE_PERCENT_DONE, AURA_EFFECT_HANDLE_REAL); - } - }; - - AuraScript* GetAuraScript() const override + void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { - return new spell_arcatraz_soul_steal_AuraScript(); + if (Unit* caster = GetCaster()) + caster->CastSpell(caster, SPELL_SOUL_STEAL, true); + } + + void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + if (Unit* caster = GetCaster()) + caster->RemoveAurasDueToSpell(SPELL_SOUL_STEAL); + } + + void Register() override + { + OnEffectApply += AuraEffectApplyFn(spell_arcatraz_soul_steal_aura::HandleEffectApply, EFFECT_0, SPELL_AURA_MOD_DAMAGE_PERCENT_DONE, AURA_EFFECT_HANDLE_REAL); + OnEffectRemove += AuraEffectRemoveFn(spell_arcatraz_soul_steal_aura::HandleEffectRemove, EFFECT_0, SPELL_AURA_MOD_DAMAGE_PERCENT_DONE, AURA_EFFECT_HANDLE_REAL); } }; @@ -624,6 +618,6 @@ void AddSC_arcatraz() new npc_millhouse_manastorm(); new npc_warden_mellichar(); - new spell_arcatraz_soul_steal(); + RegisterSpellScript(spell_arcatraz_soul_steal_aura); } diff --git a/src/server/scripts/Outland/TempestKeep/botanica/instance_the_botanica.cpp b/src/server/scripts/Outland/TempestKeep/botanica/instance_the_botanica.cpp index b4687846b..02c20d600 100644 --- a/src/server/scripts/Outland/TempestKeep/botanica/instance_the_botanica.cpp +++ b/src/server/scripts/Outland/TempestKeep/botanica/instance_the_botanica.cpp @@ -42,136 +42,114 @@ public: } }; -class spell_botanica_call_of_the_falcon : public SpellScriptLoader +class spell_botanica_call_of_the_falcon_aura : public AuraScript { -public: - spell_botanica_call_of_the_falcon() : SpellScriptLoader("spell_botanica_call_of_the_falcon") { } + PrepareAuraScript(spell_botanica_call_of_the_falcon_aura); - class spell_botanica_call_of_the_falcon_AuraScript : public AuraScript + bool Load() override { - PrepareAuraScript(spell_botanica_call_of_the_falcon_AuraScript) - - bool Load() override - { - _falconSet.clear(); - return true; - } - - void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) - { - std::list creatureList; - GetUnitOwner()->GetCreaturesWithEntryInRange(creatureList, 80.0f, NPC_BLOODFALCON); - for (std::list::const_iterator itr = creatureList.begin(); itr != creatureList.end(); ++itr) - { - (*itr)->TauntApply(GetUnitOwner()); - (*itr)->AddThreat(GetUnitOwner(), 10000000.0f); - _falconSet.insert((*itr)->GetGUID()); - } - } - - void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) - { - for (ObjectGuid const& guid : _falconSet) - if (Creature* falcon = ObjectAccessor::GetCreature(*GetUnitOwner(), guid)) - { - falcon->TauntFadeOut(GetUnitOwner()); - falcon->AddThreat(GetUnitOwner(), -10000000.0f); - } - } - - void Register() override - { - OnEffectApply += AuraEffectApplyFn(spell_botanica_call_of_the_falcon_AuraScript::HandleEffectApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); - OnEffectRemove += AuraEffectRemoveFn(spell_botanica_call_of_the_falcon_AuraScript::HandleEffectRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); - } - - private: - GuidSet _falconSet; - }; - - AuraScript* GetAuraScript() const override - { - return new spell_botanica_call_of_the_falcon_AuraScript(); + _falconSet.clear(); + return true; } + + void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + std::list creatureList; + GetUnitOwner()->GetCreaturesWithEntryInRange(creatureList, 80.0f, NPC_BLOODFALCON); + for (std::list::const_iterator itr = creatureList.begin(); itr != creatureList.end(); ++itr) + { + (*itr)->TauntApply(GetUnitOwner()); + (*itr)->AddThreat(GetUnitOwner(), 10000000.0f); + _falconSet.insert((*itr)->GetGUID()); + } + } + + void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + for (ObjectGuid const& guid : _falconSet) + if (Creature* falcon = ObjectAccessor::GetCreature(*GetUnitOwner(), guid)) + { + falcon->TauntFadeOut(GetUnitOwner()); + falcon->AddThreat(GetUnitOwner(), -10000000.0f); + } + } + + void Register() override + { + OnEffectApply += AuraEffectApplyFn(spell_botanica_call_of_the_falcon_aura::HandleEffectApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); + OnEffectRemove += AuraEffectRemoveFn(spell_botanica_call_of_the_falcon_aura::HandleEffectRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); + } + +private: + GuidSet _falconSet; }; -class spell_botanica_shift_form : public SpellScriptLoader +class spell_botanica_shift_form_aura : public AuraScript { -public: - spell_botanica_shift_form() : SpellScriptLoader("spell_botanica_shift_form") { } + PrepareAuraScript(spell_botanica_shift_form_aura); - class spell_botanica_shift_form_AuraScript : public AuraScript + bool Load() override { - PrepareAuraScript(spell_botanica_shift_form_AuraScript); + _lastSchool = 0; + _lastForm = 0; + _swapTime = 0; + return true; + } - bool Load() override + bool CheckProc(ProcEventInfo& eventInfo) + { + if (SpellInfo const* spellInfo = eventInfo.GetSpellInfo()) { - _lastSchool = 0; - _lastForm = 0; - _swapTime = 0; - return true; - } + if ((spellInfo->GetSchoolMask() & _lastSchool) && _swapTime > GameTime::GetGameTime().count()) + return false; - bool CheckProc(ProcEventInfo& eventInfo) - { - if (SpellInfo const* spellInfo = eventInfo.GetSpellInfo()) + uint32 form = 0; + switch (GetFirstSchoolInMask(spellInfo->GetSchoolMask())) { - if ((spellInfo->GetSchoolMask() & _lastSchool) && _swapTime > GameTime::GetGameTime().count()) - return false; - - uint32 form = 0; - switch (GetFirstSchoolInMask(spellInfo->GetSchoolMask())) - { - case SPELL_SCHOOL_FIRE: - form = SPELL_FIRE_FORM; - break; - case SPELL_SCHOOL_FROST: - form = SPELL_FROST_FORM; - break; - case SPELL_SCHOOL_ARCANE: - form = SPELL_ARCANE_FORM; - break; - case SPELL_SCHOOL_SHADOW: - form = SPELL_SHADOW_FORM; - break; - default: - break; - } - - if (form) - { - _swapTime = GameTime::GetGameTime().count() + 6; - _lastSchool = spellInfo->GetSchoolMask(); - GetUnitOwner()->RemoveAurasDueToSpell(_lastForm); - _lastForm = form; - GetUnitOwner()->CastSpell(GetUnitOwner(), _lastForm, true); - } + case SPELL_SCHOOL_FIRE: + form = SPELL_FIRE_FORM; + break; + case SPELL_SCHOOL_FROST: + form = SPELL_FROST_FORM; + break; + case SPELL_SCHOOL_ARCANE: + form = SPELL_ARCANE_FORM; + break; + case SPELL_SCHOOL_SHADOW: + form = SPELL_SHADOW_FORM; + break; + default: + break; } - return false; + if (form) + { + _swapTime = GameTime::GetGameTime().count() + 6; + _lastSchool = spellInfo->GetSchoolMask(); + GetUnitOwner()->RemoveAurasDueToSpell(_lastForm); + _lastForm = form; + GetUnitOwner()->CastSpell(GetUnitOwner(), _lastForm, true); + } } - void Register() override - { - DoCheckProc += AuraCheckProcFn(spell_botanica_shift_form_AuraScript::CheckProc); - } - - private: - uint32 _lastSchool; - uint32 _lastForm; - uint32 _swapTime; - }; - - AuraScript* GetAuraScript() const override - { - return new spell_botanica_shift_form_AuraScript(); + return false; } + + void Register() override + { + DoCheckProc += AuraCheckProcFn(spell_botanica_shift_form_aura::CheckProc); + } + +private: + uint32 _lastSchool; + uint32 _lastForm; + uint32 _swapTime; }; void AddSC_instance_the_botanica() { new instance_the_botanica(); - new spell_botanica_call_of_the_falcon(); - new spell_botanica_shift_form(); + RegisterSpellScript(spell_botanica_call_of_the_falcon_aura); + RegisterSpellScript(spell_botanica_shift_form_aura); }