Scripts/Icecrown Citadel: Removed crashing script for Expunged Gas and moved it to where it belongs - proc system

This commit is contained in:
Shauren
2011-08-29 13:17:08 +02:00
parent 308c2c0550
commit 240534ba2f
3 changed files with 28 additions and 87 deletions
+21 -10
View File
@@ -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:
@@ -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();