Scripts/Icecrown Citadel: Adjusted Ooze Puddle spell effect radius after correcting its size

This commit is contained in:
Shauren
2011-10-12 10:38:42 +02:00
parent 801ab6dd37
commit 12c30b0c98
2 changed files with 30 additions and 18 deletions

View File

@@ -0,0 +1,6 @@
DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_putricide_slime_puddle';
INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES
(70346,'spell_putricide_slime_puddle'),
(72456,'spell_putricide_slime_puddle'),
(72868,'spell_putricide_slime_puddle'),
(72869,'spell_putricide_slime_puddle');

View File

@@ -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);