aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorccrs <ccrs@users.noreply.github.com>2021-08-10 13:17:47 +0200
committerccrs <ccrs@users.noreply.github.com>2021-08-10 13:17:47 +0200
commit9c7f2544c872d820fbf649c2d5d509f04f38a899 (patch)
tree936218314711e160fefd10b2d71d0ed1c076e363 /src
parentd49b6af71fae60f4bcb5fed4d745a020657f0b3a (diff)
Scripts/Ahnkahet: corrections to npc_amanitar_mushrooms script
Diffstat (limited to 'src')
-rw-r--r--src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_amanitar.cpp49
1 files changed, 28 insertions, 21 deletions
diff --git a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_amanitar.cpp b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_amanitar.cpp
index 2deb5f4016d..63132aa1b13 100644
--- a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_amanitar.cpp
+++ b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_amanitar.cpp
@@ -147,7 +147,7 @@ struct boss_amanitar : public BossAI
switch (eventId)
{
case EVENT_SPAWN:
- for (Position const pos : MushroomPositions)
+ for (Position const& pos : MushroomPositions)
SpawnMushroom(pos);
break;
case EVENT_MINI:
@@ -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