aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rwxr-xr-xsrc/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp42
1 files changed, 24 insertions, 18 deletions
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp
index d5186833364..28f337dcfb0 100755
--- a/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp
+++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp
@@ -815,38 +815,45 @@ class spell_putricide_ooze_channel : public SpellScriptLoader
}
};
+class ExactDistanceCheck
+{
+ public:
+ ExactDistanceCheck(Unit* source, float dist) : _source(source), _dist(dist) {}
+
+ bool operator()(Unit* unit)
+ {
+ return _source->GetExactDist2d(unit) > _dist;
+ }
+
+ private:
+ Unit* _source;
+ float _dist;
+};
+
class spell_putricide_slime_puddle : public SpellScriptLoader
{
public:
spell_putricide_slime_puddle() : SpellScriptLoader("spell_putricide_slime_puddle") { }
- class spell_putricide_slime_puddle_AuraScript : public AuraScript
+ class spell_putricide_slime_puddle_SpellScript : public SpellScript
{
- PrepareAuraScript(spell_putricide_slime_puddle_AuraScript);
+ PrepareSpellScript(spell_putricide_slime_puddle_SpellScript);
- void HandleTriggerSpell(AuraEffect const* aurEff)
+ void ScaleRange(std::list<Unit*>& targets)
{
- PreventDefaultAction();
- if (Unit* caster = GetCaster())
- {
- int32 radiusMod = 4;
- if (Aura* size = caster->GetAura(70347))
- radiusMod += size->GetStackAmount();
-
- uint32 triggerSpellId = GetSpellInfo()->Effects[aurEff->GetEffIndex()].TriggerSpell;
- caster->CastCustomSpell(triggerSpellId, SPELLVALUE_RADIUS_MOD, radiusMod * 100, caster, true);
- }
+ targets.remove_if(ExactDistanceCheck(GetCaster(), 2.5f * GetCaster()->GetFloatValue(OBJECT_FIELD_SCALE_X)));
}
void Register()
{
- OnEffectPeriodic += AuraEffectPeriodicFn(spell_putricide_slime_puddle_AuraScript::HandleTriggerSpell, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
+ OnUnitTargetSelect += SpellUnitTargetFn(spell_putricide_slime_puddle_SpellScript::ScaleRange, EFFECT_0, TARGET_UNIT_DEST_AREA_ENEMY);
+ OnUnitTargetSelect += SpellUnitTargetFn(spell_putricide_slime_puddle_SpellScript::ScaleRange, EFFECT_1, TARGET_UNIT_DEST_AREA_ENEMY);
}
};
AuraScript* GetAuraScript() const
{
- return new spell_putricide_slime_puddle_AuraScript();
+ return new spell_putricide_slime_puddle_SpellScript();
}
};
@@ -1051,7 +1058,6 @@ class spell_putricide_unbound_plague : public SpellScriptLoader
return;
uint32 plagueId = sSpellMgr->GetSpellIdForDifficulty(SPELL_UNBOUND_PLAGUE, GetCaster());
- uint32 searcherId = sSpellMgr->GetSpellIdForDifficulty(SPELL_UNBOUND_PLAGUE_SEARCHER, GetCaster());
if (!GetHitUnit()->HasAura(plagueId))
{
@@ -1061,10 +1067,10 @@ class spell_putricide_unbound_plague : public SpellScriptLoader
{
if (Aura* newPlague = professor->AddAura(plagueId, GetHitUnit()))
{
- newPlague->SetMaxDuration(oldPlague->GetDuration());
+ newPlague->SetMaxDuration(oldPlague->GetMaxDuration());
newPlague->SetDuration(oldPlague->GetDuration());
oldPlague->Remove();
- GetCaster()->RemoveAurasDueToSpell(searcherId);
+ GetCaster()->RemoveAurasDueToSpell(SPELL_UNBOUND_PLAGUE_SEARCHER);
GetCaster()->CastSpell(GetCaster(), SPELL_PLAGUE_SICKNESS, true);
GetCaster()->CastSpell(GetCaster(), SPELL_UNBOUND_PLAGUE_PROTECTION, true);
professor->CastSpell(GetHitUnit(), SPELL_UNBOUND_PLAGUE_SEARCHER, true);