fix(Scripts/TempleOfAhnQiraj): Ouro Sand Blast should hit top threat … (#13578)
* fix(Scripts/TempleOfAhnQiraj): Ouro Sand Blast should hit top threat target * ouro should only target players in melee range * fix ouro resetting * Update boss_ouro.cpp
This commit is contained in:
@@ -112,6 +112,11 @@ struct boss_ouro : public BossAI
|
|||||||
_scheduler.SetValidator([this] { return !me->HasUnitState(UNIT_STATE_CASTING); });
|
_scheduler.SetValidator([this] { return !me->HasUnitState(UNIT_STATE_CASTING); });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool CanAIAttack(Unit const* victim) const override
|
||||||
|
{
|
||||||
|
return me->IsWithinMeleeRange(victim);
|
||||||
|
}
|
||||||
|
|
||||||
void DamageTaken(Unit* /*attacker*/, uint32& damage, DamageEffectType, SpellSchoolMask) override
|
void DamageTaken(Unit* /*attacker*/, uint32& damage, DamageEffectType, SpellSchoolMask) override
|
||||||
{
|
{
|
||||||
if (me->HealthBelowPctDamaged(20, damage) && !_enraged)
|
if (me->HealthBelowPctDamaged(20, damage) && !_enraged)
|
||||||
@@ -204,7 +209,21 @@ struct boss_ouro : public BossAI
|
|||||||
_scheduler
|
_scheduler
|
||||||
.Schedule(20s, GROUP_EMERGED, [this](TaskContext context)
|
.Schedule(20s, GROUP_EMERGED, [this](TaskContext context)
|
||||||
{
|
{
|
||||||
DoCastVictim(SPELL_SAND_BLAST);
|
if (Unit* target = SelectTarget(SelectTargetMethod::MaxThreat, 0, 0.0f, true))
|
||||||
|
{
|
||||||
|
me->SetTarget(target->GetGUID());
|
||||||
|
}
|
||||||
|
|
||||||
|
DoCastAOE(SPELL_SAND_BLAST);
|
||||||
|
|
||||||
|
me->m_Events.AddEventAtOffset([this]()
|
||||||
|
{
|
||||||
|
if (Unit* victim = me->GetVictim())
|
||||||
|
{
|
||||||
|
me->SetTarget(victim->GetGUID());
|
||||||
|
}
|
||||||
|
}, 3s);
|
||||||
|
|
||||||
context.Repeat();
|
context.Repeat();
|
||||||
})
|
})
|
||||||
.Schedule(22s, GROUP_EMERGED, [this](TaskContext context)
|
.Schedule(22s, GROUP_EMERGED, [this](TaskContext context)
|
||||||
@@ -254,11 +273,14 @@ struct boss_ouro : public BossAI
|
|||||||
|
|
||||||
void EnterEvadeMode(EvadeReason /*why*/) override
|
void EnterEvadeMode(EvadeReason /*why*/) override
|
||||||
{
|
{
|
||||||
DoCastSelf(SPELL_OURO_SUBMERGE_VISUAL);
|
if (me->GetThreatMgr().GetThreatList().empty())
|
||||||
me->DespawnOrUnsummon(1000);
|
{
|
||||||
instance->SetBossState(DATA_OURO, FAIL);
|
DoCastSelf(SPELL_OURO_SUBMERGE_VISUAL);
|
||||||
if (GameObject* base = me->FindNearestGameObject(GO_SANDWORM_BASE, 200.f))
|
me->DespawnOrUnsummon(1000);
|
||||||
base->DespawnOrUnsummon();
|
instance->SetBossState(DATA_OURO, FAIL);
|
||||||
|
if (GameObject* base = me->FindNearestGameObject(GO_SANDWORM_BASE, 200.f))
|
||||||
|
base->DespawnOrUnsummon();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void EnterCombat(Unit* who) override
|
void EnterCombat(Unit* who) override
|
||||||
|
|||||||
Reference in New Issue
Block a user