diff options
author | ccrs <ccrs@users.noreply.github.com> | 2021-08-10 13:17:47 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2022-03-12 14:48:45 +0100 |
commit | 51d842a8bdf4fc5e9d606c1749e992c1a1b8d097 (patch) | |
tree | 98fe59ee03ba3ec0bf80aa559c2abc820bb9b9ab /src | |
parent | 5b6bcbff1a94c4bc32c42f05d77af97d63cef420 (diff) |
Scripts/Ahnkahet: corrections to npc_amanitar_mushrooms script
(cherry picked from commit 9c7f2544c872d820fbf649c2d5d509f04f38a899)
Diffstat (limited to 'src')
-rw-r--r-- | src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_amanitar.cpp | 47 |
1 files changed, 27 insertions, 20 deletions
diff --git a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_amanitar.cpp b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_amanitar.cpp index 91452e736f2..8aa18cb80a0 100644 --- a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_amanitar.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_amanitar.cpp @@ -192,8 +192,8 @@ struct boss_amanitar : public BossAI DoMeleeAttackIfReady(); } - private: - std::deque<Position> _mushroomsDeque; +private: + std::deque<Position> _mushroomsDeque; }; struct npc_amanitar_mushrooms : public ScriptedAI @@ -209,33 +209,38 @@ struct npc_amanitar_mushrooms : public ScriptedAI DoCastSelf(SPELL_GROW, true); if (me->GetEntry() == NPC_HEALTHY_MUSHROOM) - { DoCastSelf(SPELL_POWER_MUSHROOM_VISUAL_AURA); - _active = true; - } else + { DoCastSelf(SPELL_POISONOUS_MUSHROOM_VISUAL_AURA); - _scheduler.Schedule(Milliseconds(800), [this](TaskContext /*context*/) - { - DoCastSelf(SPELL_GROW, true); - }); - } + _scheduler.Schedule(1s, [this](TaskContext checkRangeContext) + { + std::vector<Player*> playersNearby; + GetPlayerListInGrid(playersNearby, me, 2.0f); + if (!playersNearby.empty()) + { + _active = true; - void MoveInLineOfSight(Unit* target) override - { - if (_active || target->GetTypeId() != TYPEID_PLAYER || me->GetDistance2d(target) > 2.0f) - return; + for (Player* foundPlayer : playersNearby) + foundPlayer->RemoveAurasDueToSpell(SPELL_POTENT_FUNGUS); - _active = true; + DoCastAOE(SPELL_POISONOUS_MUSHROOM_POISON_CLOUD); - target->RemoveAurasDueToSpell(SPELL_POTENT_FUNGUS); - DoCastAOE(SPELL_POISONOUS_MUSHROOM_POISON_CLOUD); + _scheduler.Schedule(Seconds(1), [this](TaskContext /*context*/) + { + me->SetObjectScale(0.1f); + me->DespawnOrUnsummon(Seconds(4)); + }); + } + else + checkRangeContext.Repeat(1s); + }); + } - _scheduler.Schedule(Seconds(1), [this](TaskContext /*context*/) + _scheduler.Schedule(Milliseconds(800), [this](TaskContext /*context*/) { - me->SetObjectScale(0.1f); - me->DespawnOrUnsummon(Seconds(4)); + DoCastSelf(SPELL_GROW, true); }); } @@ -243,6 +248,8 @@ struct npc_amanitar_mushrooms : public ScriptedAI { if (me->GetEntry() == NPC_HEALTHY_MUSHROOM) DoCastAOE(SPELL_POTENT_FUNGUS, true); + else if (!_active) + DoCastAOE(SPELL_POISONOUS_MUSHROOM_POISON_CLOUD); } void UpdateAI(uint32 diff) override |