aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjoschiwald <joschiwald.trinity@gmail.com>2015-03-07 02:42:02 +0100
committerjoschiwald <joschiwald.trinity@gmail.com>2015-03-07 02:42:02 +0100
commit1dc60e8717bddab2a6bc39779a53e83c9fa3b339 (patch)
tree60a3bba7524769dfaed598f8ad5b6a635633e8bc
parent9a4116796f5bab4180eda82ebd145ca3b8758663 (diff)
Scripts/Rotface: moved mutated infection removal handling to spellscripts to fix an startup error
-rw-r--r--sql/updates/world/2015_03_07_00_world.sql1
-rw-r--r--src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp52
2 files changed, 32 insertions, 21 deletions
diff --git a/sql/updates/world/2015_03_07_00_world.sql b/sql/updates/world/2015_03_07_00_world.sql
new file mode 100644
index 00000000000..4cc5d647e1a
--- /dev/null
+++ b/sql/updates/world/2015_03_07_00_world.sql
@@ -0,0 +1 @@
+DELETE FROM `spell_linked_spell` WHERE `spell_effect`=69706;
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp
index 2b96e8e13a3..a210d87f2f8 100644
--- a/src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp
+++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp
@@ -18,7 +18,7 @@
#include "ObjectMgr.h"
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
-#include "SpellAuras.h"
+#include "SpellAuraEffects.h"
#include "GridNotifiers.h"
#include "icecrown_citadel.h"
@@ -213,7 +213,7 @@ class boss_rotface : public CreatureScript
}
break;
case EVENT_MUTATED_INFECTION:
- me->CastCustomSpell(SPELL_MUTATED_INFECTION, SPELLVALUE_MAX_TARGETS, 1, NULL, false);
+ DoCastAOE(SPELL_MUTATED_INFECTION);
events.ScheduleEvent(EVENT_MUTATED_INFECTION, infectionCooldown);
break;
case EVENT_VILE_GAS:
@@ -509,13 +509,6 @@ class spell_rotface_mutated_infection : public SpellScriptLoader
{
PrepareSpellScript(spell_rotface_mutated_infection_SpellScript);
- public:
- spell_rotface_mutated_infection_SpellScript()
- {
- _target = nullptr;
- }
-
- private:
void FilterTargets(std::list<WorldObject*>& targets)
{
// remove targets with this aura already
@@ -527,14 +520,6 @@ class spell_rotface_mutated_infection : public SpellScriptLoader
WorldObject* target = Trinity::Containers::SelectRandomContainerElement(targets);
targets.clear();
targets.push_back(target);
- _target = target;
- }
-
- void ReplaceTargets(std::list<WorldObject*>& targets)
- {
- targets.clear();
- if (_target)
- targets.push_back(_target);
}
void NotifyTargets()
@@ -546,19 +531,44 @@ class spell_rotface_mutated_infection : public SpellScriptLoader
void Register() override
{
- OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_rotface_mutated_infection_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
- OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_rotface_mutated_infection_SpellScript::ReplaceTargets, EFFECT_1, TARGET_UNIT_SRC_AREA_ENEMY);
- OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_rotface_mutated_infection_SpellScript::ReplaceTargets, EFFECT_2, TARGET_UNIT_SRC_AREA_ENEMY);
+ OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_rotface_mutated_infection_SpellScript::FilterTargets, EFFECT_ALL, TARGET_UNIT_SRC_AREA_ENEMY);
AfterHit += SpellHitFn(spell_rotface_mutated_infection_SpellScript::NotifyTargets);
}
+ };
+
+ class spell_rotface_mutated_infection_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_rotface_mutated_infection_AuraScript);
- WorldObject* _target;
+ bool Validate(SpellInfo const* spellInfo) override
+ {
+ SpellEffectInfo const* effect = spellInfo->GetEffect(EFFECT_2);
+ if (!effect || sSpellMgr->GetSpellInfo(effect->CalcValue()))
+ return false;
+ return true;
+ }
+
+ void HandleEffectRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
+ {
+ Unit* target = GetTarget();
+ target->CastSpell(target, GetAura()->GetSpellEffectInfo(EFFECT_2)->CalcValue(), true, nullptr, aurEff, GetCasterGUID());
+ }
+
+ void Register() override
+ {
+ AfterEffectRemove += AuraEffectRemoveFn(spell_rotface_mutated_infection_AuraScript::HandleEffectRemove, EFFECT_0, SPELL_AURA_PERIODIC_DAMAGE, AURA_EFFECT_HANDLE_REAL);
+ }
};
SpellScript* GetSpellScript() const override
{
return new spell_rotface_mutated_infection_SpellScript();
}
+
+ AuraScript* GetAuraScript() const override
+ {
+ return new spell_rotface_mutated_infection_AuraScript();
+ }
};
class spell_rotface_little_ooze_combine : public SpellScriptLoader