diff options
author | Shauren <shauren.trinity@gmail.com> | 2011-10-12 10:38:42 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2011-10-12 10:38:42 +0200 |
commit | 12c30b0c98d7bebb2a47ff8748e2554bd72e332c (patch) | |
tree | b3f70c1cbc02540feb7ec6c93174db797d88d677 | |
parent | 801ab6dd379aaa1b02e6eda454bbc801651a57e0 (diff) |
Scripts/Icecrown Citadel: Adjusted Ooze Puddle spell effect radius after correcting its size
-rw-r--r-- | sql/updates/world/2011_10_12_00_world_spell_script_names.sql | 6 | ||||
-rwxr-xr-x | src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp | 42 |
2 files changed, 30 insertions, 18 deletions
diff --git a/sql/updates/world/2011_10_12_00_world_spell_script_names.sql b/sql/updates/world/2011_10_12_00_world_spell_script_names.sql new file mode 100644 index 00000000000..cf2ea31306d --- /dev/null +++ b/sql/updates/world/2011_10_12_00_world_spell_script_names.sql @@ -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'); 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); |