Skip to content

Commit

Permalink
fix(Scripts/TempleOfAhnQiraj): Don't let Giant Claw Tentacles autoatt…
Browse files Browse the repository at this point in the history
…… (#13550)

* fix(Scripts/TempleOfAhnQiraj): Don't let Giant Claw Tentacles autoattack while submerged and reorder digestive acid cast

* delay small claw tentacles autoattack by 2s

* Revert "delay small claw tentacles autoattack by 2s"

This reverts commit 08b9c7d62528a9147266d084768b8a7fb0deb3e0.

* change the delay
  • Loading branch information
Nyeriah committed Oct 26, 2022
1 parent 47bf00a commit bfa68b0
Showing 1 changed file with 23 additions and 9 deletions.
32 changes: 23 additions & 9 deletions src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -452,10 +452,9 @@ struct boss_cthun : public BossAI

target->m_Events.AddEventAtOffset([target, this]()
{
DoCast(target, SPELL_DIGESTIVE_ACID, true);
DoTeleportPlayer(target, STOMACH_X, STOMACH_Y, STOMACH_Z, STOMACH_O);
target->RemoveAurasDueToSpell(SPELL_MIND_FLAY);
//Cast digestive acid on them
DoCast(target, SPELL_DIGESTIVE_ACID, true);
}, 3800ms);
}

Expand Down Expand Up @@ -747,6 +746,8 @@ struct npc_giant_claw_tentacle : public ScriptedAI
}
}
}

_canAttack = false;
}

void JustDied(Unit* /*killer*/) override
Expand All @@ -770,14 +771,17 @@ struct npc_giant_claw_tentacle : public ScriptedAI
DoZoneInCombat();

_scheduler.Schedule(2s, [this](TaskContext context)
{
{
DoCastVictim(SPELL_HAMSTRING);
context.Repeat(10s);
}).Schedule(5s, [this](TaskContext context)
{
DoCastSelf(SPELL_THRASH);
context.Repeat(10s);
});
}).Schedule(5s, [this](TaskContext context)
{
DoCastSelf(SPELL_THRASH);
context.Repeat(10s);
}).Schedule(3s, [this](TaskContext /*context*/)
{
_canAttack = true;
});

ScheduleMeleeCheck();
}
Expand Down Expand Up @@ -825,6 +829,7 @@ struct npc_giant_claw_tentacle : public ScriptedAI
me->SetUnitFlag(UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE);

_scheduler.CancelAll();
_canAttack = false;

_scheduler.Schedule(5s, [this](TaskContext /*task*/)
{
Expand All @@ -851,6 +856,11 @@ struct npc_giant_claw_tentacle : public ScriptedAI

ScheduleMeleeCheck();
}

_scheduler.Schedule(3s, [this](TaskContext /*context*/)
{
_canAttack = true;
});
}

void UpdateAI(uint32 diff) override
Expand All @@ -861,12 +871,16 @@ struct npc_giant_claw_tentacle : public ScriptedAI

_scheduler.Update(diff);

DoMeleeAttackIfReady();
if (_canAttack)
{
DoMeleeAttackIfReady();
}
}

private:
TaskScheduler _scheduler;
ObjectGuid _portalGUID;
bool _canAttack;
};

struct npc_giant_eye_tentacle : public ScriptedAI
Expand Down

0 comments on commit bfa68b0

Please sign in to comment.