diff options
author | Kandera <KanderaDev@gmail.com> | 2012-07-06 10:21:00 -0400 |
---|---|---|
committer | Kandera <KanderaDev@gmail.com> | 2012-07-06 10:21:00 -0400 |
commit | 2bcc29136ab2b4982fae765b360b16518ca67880 (patch) | |
tree | 5baf0d9fd5ade06e9ec0f579105743b68d540b8b /src | |
parent | 6a83cd453cc05790f74587390a2d6d65c8723899 (diff) |
Scripts/Spells: fix wrath of the astromancer and stop the startup error.
Diffstat (limited to 'src')
-rw-r--r-- | src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp | 47 |
1 files changed, 11 insertions, 36 deletions
diff --git a/src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp b/src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp index 0454274401c..3975d77aa25 100644 --- a/src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp +++ b/src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp @@ -501,9 +501,9 @@ class spell_astromancer_wrath_of_the_astromancer : public SpellScriptLoader public: spell_astromancer_wrath_of_the_astromancer() : SpellScriptLoader("spell_astromancer_wrath_of_the_astromancer") { } - class spell_astromancer_wrath_of_the_astromancer_SpellScript : public SpellScript + class spell_astromancer_wrath_of_the_astromancer_AuraScript : public AuraScript { - PrepareSpellScript(spell_astromancer_wrath_of_the_astromancer_SpellScript); + PrepareAuraScript(spell_astromancer_wrath_of_the_astromancer_AuraScript); bool Validate(SpellInfo const* /*SpellEntry*/) { @@ -512,50 +512,25 @@ class spell_astromancer_wrath_of_the_astromancer : public SpellScriptLoader return true; } - bool Load() + void AfterRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { - _targetCount = 0; - return true; - } - - void CountTargets(std::list<WorldObject*>& targetList) - { - _targetCount = targetList.size(); - } - - void HandleDummy(SpellEffIndex /* effIndex */) - { - if (Unit* caster = GetOriginalCaster()) - if (Unit* target = GetHitUnit()) - { - if (!target->isAlive() || !_targetCount) - return; - - int32 damage = 10000 / _targetCount; - - SpellNonMeleeDamage damageInfo(caster, target, GetSpellInfo()->Id, GetSpellInfo()->SchoolMask); - damageInfo.damage = damage; + // Final heal only on duration end + if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE) + return; - caster->CalcAbsorbResist(target, GetSpellInfo()->GetSchoolMask(), DOT, damage, &damageInfo.absorb, &damageInfo.resist, GetSpellInfo()); - caster->DealDamageMods(target, damageInfo.damage, &damageInfo.absorb); - caster->SendSpellNonMeleeDamageLog(&damageInfo); - caster->DealSpellDamage(&damageInfo, false); - } + Unit* target = GetUnitOwner(); + target->CastSpell(target, GetSpellInfo()->Effects[EFFECT_1].CalcValue(),false); } - private: - int32 _targetCount; - void Register() { - OnEffectHitTarget += SpellEffectFn(spell_astromancer_wrath_of_the_astromancer_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); - OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_astromancer_wrath_of_the_astromancer_SpellScript::CountTargets, EFFECT_0, TARGET_DEST_CASTER_RADIUS); + AfterEffectRemove += AuraEffectRemoveFn(spell_astromancer_wrath_of_the_astromancer_AuraScript::AfterRemove, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL); } }; - SpellScript* GetSpellScript() const + AuraScript* GetAuraScript() const { - return new spell_astromancer_wrath_of_the_astromancer_SpellScript(); + return new spell_astromancer_wrath_of_the_astromancer_AuraScript(); } }; |