diff options
| author | treeston <treeston.mmoc@gmail.com> | 2017-06-10 15:08:35 +0200 |
|---|---|---|
| committer | treeston <treeston.mmoc@gmail.com> | 2017-06-10 15:08:35 +0200 |
| commit | d57307f63d8deb51003d61163adccce4e2c1bd47 (patch) | |
| tree | 16c3eeac40a43fe0898609d9051c4ad8c0b8e102 /src/server/scripts/Northrend | |
| parent | 9e80e977df56834d4cdc76a57a417a86a1dbda65 (diff) | |
So, I came in trying to fix gameobject LoS. So I restructured some stuff.
Then it turned out that gameobject LoS is already fixed. So all this does, really, is restructure some stuff.
And remove the hack from Sapphiron because I could.
Diffstat (limited to 'src/server/scripts/Northrend')
| -rw-r--r-- | src/server/scripts/Northrend/Naxxramas/boss_sapphiron.cpp | 77 |
1 files changed, 1 insertions, 76 deletions
diff --git a/src/server/scripts/Northrend/Naxxramas/boss_sapphiron.cpp b/src/server/scripts/Northrend/Naxxramas/boss_sapphiron.cpp index f0490e7d1d4..29e0d9f1555 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_sapphiron.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_sapphiron.cpp @@ -340,6 +340,7 @@ class boss_sapphiron : public CreatureScript case EVENT_EXPLOSION: DoCastAOE(SPELL_FROST_BREATH); DoCastAOE(SPELL_FROST_BREATH_ANTICHEAT); + instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_ICEBOLT); events.ScheduleEvent(EVENT_LAND, Seconds(3) + Milliseconds(500), 0, PHASE_FLIGHT); return; case EVENT_LAND: @@ -505,81 +506,6 @@ class spell_sapphiron_icebolt : public SpellScriptLoader } }; -// @hack Hello, developer from the future! How has your day been? -// Anyway, this is, as you can undoubtedly see, a hack to emulate line of sight checks on a spell that abides line of sight anyway. -// In the current core, line of sight is not properly checked for people standing behind an ice block. This is not a good thing and kills people. -// Thus, we have this hack to check for ice block LoS in a "safe" way. Kind of. It's inaccurate, but in a good way (tends to save people when it shouldn't in edge cases). -// If LoS handling is better in whatever the current revision is when you read this, please get rid of the hack. Thanks! -class spell_sapphiron_frost_breath : public SpellScriptLoader -{ - public: - spell_sapphiron_frost_breath() : SpellScriptLoader("spell_sapphiron_frost_breath") { } - - class spell_sapphiron_frost_breath_SpellScript : public SpellScript - { - PrepareSpellScript(spell_sapphiron_frost_breath_SpellScript); - - bool Validate(SpellInfo const* /*spell*/) override - { - return !!sSpellMgr->GetSpellInfo(SPELL_FROST_BREATH); - } - - void HandleTargets(std::list<WorldObject*>& targetList) - { - std::list<GameObject*> blocks; - if (GetCaster()) - GetCaster()->GetGameObjectListWithEntryInGrid(blocks, GO_ICEBLOCK, 200.0f); - - std::vector<Unit*> toRemove; - toRemove.reserve(3); - std::list<WorldObject*>::iterator it = targetList.begin(); - while (it != targetList.end()) - { - Unit* target = (*it)->ToUnit(); - if (!target) - { - it = targetList.erase(it); - continue; - } - - if (target->HasAura(SPELL_ICEBOLT)) - { - it = targetList.erase(it); - toRemove.push_back(target); - continue; - } - - bool found = false; - for (GameObject* block : blocks) - if (block->IsInBetween(GetCaster(), target, 2.0f) && GetCaster()->GetExactDist2d(block) + 5 >= GetCaster()->GetExactDist2d(target)) - { - found = true; - break; - } - if (found) - { - it = targetList.erase(it); - continue; - } - ++it; - } - - for (Unit* block : toRemove) - block->RemoveAura(SPELL_ICEBOLT); - } - - void Register() override - { - OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_sapphiron_frost_breath_SpellScript::HandleTargets, EFFECT_0, TARGET_UNIT_DEST_AREA_ENEMY); - } - }; - - SpellScript* GetSpellScript() const override - { - return new spell_sapphiron_frost_breath_SpellScript(); - } -}; - class spell_sapphiron_summon_blizzard : public SpellScriptLoader { public: @@ -641,7 +567,6 @@ void AddSC_boss_sapphiron() new go_sapphiron_birth(); new spell_sapphiron_change_blizzard_target(); new spell_sapphiron_icebolt(); - new spell_sapphiron_frost_breath(); new spell_sapphiron_summon_blizzard(); new achievement_the_hundred_club(); } |
