diff options
author | Shauren <shauren.trinity@gmail.com> | 2011-08-29 13:17:08 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2011-08-29 13:17:08 +0200 |
commit | 240534ba2fa3cc51e8e6fa5ecce8dbe03bab5c67 (patch) | |
tree | 7a92e4eb4c0c5defda167eb96e0407e43beb8c61 /src | |
parent | 308c2c0550d1705e54671606154c40748b358939 (diff) |
Scripts/Icecrown Citadel: Removed crashing script for Expunged Gas and moved it to where it belongs - proc system
Diffstat (limited to 'src')
-rwxr-xr-x | src/server/game/Entities/Unit/Unit.cpp | 31 | ||||
-rwxr-xr-x | src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp | 77 |
2 files changed, 21 insertions, 87 deletions
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 6086d5f9e2d..2e04e6d3bbf 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -5596,16 +5596,6 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere triggered_spell_id = 71203; break; } - // Gaseous Bloat (Professor Putricide add) - case 70215: - case 72858: - case 72859: - case 72860: - { - target = getVictim(); - triggered_spell_id = 70701; - break; - } // Essence of the Blood Queen case 70871: { @@ -7906,6 +7896,27 @@ bool Unit::HandleAuraProc(Unit* victim, uint32 damage, Aura* triggeredByAura, Sp RemoveAuraFromStack(71564); *handled = true; break; + // Gaseous Bloat + case 70672: + case 72455: + case 72832: + case 72833: + { + *handled = true; + uint32 stack = triggeredByAura->GetStackAmount(); + int32 const mod = (GetMap()->GetSpawnMode() & 1) ? 1500 : 1250; + int32 dmg = 0; + for (uint8 i = 1; i < stack; ++i) + dmg += mod * stack; + if (Unit* caster = triggeredByAura->GetCaster()) + { + caster->CastCustomSpell(70701, SPELLVALUE_BASE_POINT0, dmg); + if (Creature* creature = caster->ToCreature()) + creature->DespawnOrUnsummon(1); + } + break; + } + // Ball of Flames Proc case 71756: case 72782: case 72783: diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp index ef2639ed6b8..b5bcd93d257 100755 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp @@ -740,20 +740,6 @@ class spell_putricide_gaseous_bloat : public SpellScriptLoader } }; -class BeamProtectionCheck -{ - public: - explicit BeamProtectionCheck(uint32 excludeAura) : _excludeAura(excludeAura) { } - - bool operator()(Unit* unit) - { - return unit->HasAura(_excludeAura); - } - - private: - uint32 _excludeAura; -}; - class spell_putricide_ooze_channel : public SpellScriptLoader { public: @@ -782,7 +768,6 @@ class spell_putricide_ooze_channel : public SpellScriptLoader void SelectTarget(std::list<Unit*>& targetList) { - targetList.remove_if(BeamProtectionCheck(GetSpellInfo()->ExcludeTargetAuraSpell)); if (targetList.empty()) { FinishCast(SPELL_FAILED_NO_VALID_TARGETS); @@ -828,67 +813,6 @@ class spell_putricide_ooze_channel : public SpellScriptLoader } }; -class spell_putricide_expunged_gas : public SpellScriptLoader -{ - public: - spell_putricide_expunged_gas() : SpellScriptLoader("spell_putricide_expunged_gas") { } - - class spell_putricide_expunged_gas_SpellScript : public SpellScript - { - PrepareSpellScript(spell_putricide_expunged_gas_SpellScript); - - bool Load() - { - return GetCaster()->GetTypeId() == TYPEID_UNIT && GetCaster()->GetInstanceScript(); - } - - SpellCastResult CheckCast() - { - if (!GetCaster()->getVictim()) - return SPELL_FAILED_NO_VALID_TARGETS; - return SPELL_CAST_OK; - } - - void CalcDamage(SpellEffIndex /*effIndex*/) - { - // checked in script loading, cant be NULL here - InstanceScript* instance = GetCaster()->GetInstanceScript(); - Creature* professor = Unit::GetCreature(*GetCaster(), instance->GetData64(DATA_PROFESSOR_PUTRICIDE)); - if (!professor) - return; - - int32 dmg = 0; - uint32 bloatId = sSpellMgr->GetSpellIdForDifficulty(SPELL_GASEOUS_BLOAT, GetCaster()); - if (Aura* gasBloat = GetCaster()->getVictim()->GetAura(bloatId)) - { - uint32 stack = gasBloat->GetStackAmount(); - int32 const mod = (GetCaster()->GetMap()->GetSpawnMode() & 1) ? 1500 : 1250; - for (uint8 i = 1; i < stack; ++i) - dmg += mod * stack; - } - - SetHitDamage(dmg); - } - - void DespawnAfterCast() - { - GetCaster()->ToCreature()->DespawnOrUnsummon(100); - } - - void Register() - { - OnCheckCast += SpellCheckCastFn(spell_putricide_expunged_gas_SpellScript::CheckCast); - OnEffect += SpellEffectFn(spell_putricide_expunged_gas_SpellScript::CalcDamage, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE); - AfterHit += SpellHitFn(spell_putricide_expunged_gas_SpellScript::DespawnAfterCast); - } - }; - - SpellScript* GetSpellScript() const - { - return new spell_putricide_expunged_gas_SpellScript(); - } -}; - class spell_putricide_slime_puddle : public SpellScriptLoader { public: @@ -1532,7 +1456,6 @@ void AddSC_boss_professor_putricide() new npc_volatile_ooze(); new spell_putricide_gaseous_bloat(); new spell_putricide_ooze_channel(); - new spell_putricide_expunged_gas(); new spell_putricide_slime_puddle(); new spell_putricide_slime_puddle_aura(); new spell_putricide_unstable_experiment(); |