aboutsummaryrefslogtreecommitdiff
path: root/src/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'src/scripts')
-rw-r--r--src/scripts/kalimdor/temple_of_ahnqiraj/boss_twinemperors.cpp7
-rw-r--r--src/scripts/northrend/naxxramas/boss_four_horsemen.cpp10
-rw-r--r--src/scripts/outland/tempest_keep/the_eye/boss_alar.cpp2
3 files changed, 14 insertions, 5 deletions
diff --git a/src/scripts/kalimdor/temple_of_ahnqiraj/boss_twinemperors.cpp b/src/scripts/kalimdor/temple_of_ahnqiraj/boss_twinemperors.cpp
index a0a9723cd3c..73f17485f7f 100644
--- a/src/scripts/kalimdor/temple_of_ahnqiraj/boss_twinemperors.cpp
+++ b/src/scripts/kalimdor/temple_of_ahnqiraj/boss_twinemperors.cpp
@@ -258,12 +258,11 @@ struct boss_twinemperorsAI : public ScriptedAI
{
AfterTeleport = false;
me->clearUnitState(UNIT_STAT_STUNNED);
- Unit *nearu = me->SelectNearestTarget(100);
- //DoYell(nearu->GetName(), LANG_UNIVERSAL, 0);
- if (nearu)
+ if (Unit *nearu = me->SelectNearestTarget(100))
{
+ //DoYell(nearu->GetName(), LANG_UNIVERSAL, 0);
AttackStart(nearu);
- me->getThreatManager().addThreat(nearu, 10000);
+ me->AddThreat(nearu, 10000);
}
return true;
}
diff --git a/src/scripts/northrend/naxxramas/boss_four_horsemen.cpp b/src/scripts/northrend/naxxramas/boss_four_horsemen.cpp
index b88d45bf97a..f04b39040db 100644
--- a/src/scripts/northrend/naxxramas/boss_four_horsemen.cpp
+++ b/src/scripts/northrend/naxxramas/boss_four_horsemen.cpp
@@ -236,6 +236,16 @@ struct boss_four_horsemenAI : public BossAI
nextWP = id + 1;
}
+ // switch to "who" if nearer than current target.
+ void SelectNearestTarget(Unit *who)
+ {
+ if (me->getVictim() && me->GetDistanceOrder(who, me->getVictim()) && me->canAttack(who))
+ {
+ me->getThreatManager().modifyThreatPercent(me->getVictim(), -100);
+ me->AddThreat(who, 1000000.0f);
+ }
+ }
+
void MoveInLineOfSight(Unit *who)
{
BossAI::MoveInLineOfSight(who);
diff --git a/src/scripts/outland/tempest_keep/the_eye/boss_alar.cpp b/src/scripts/outland/tempest_keep/the_eye/boss_alar.cpp
index b26836b42e2..af5f1bd95c1 100644
--- a/src/scripts/outland/tempest_keep/the_eye/boss_alar.cpp
+++ b/src/scripts/outland/tempest_keep/the_eye/boss_alar.cpp
@@ -408,7 +408,7 @@ struct boss_alarAI : public ScriptedAI
else
{
Unit *pTarget = NULL;
- pTarget = me->SelectNearestTarget(5);
+ pTarget = me->SelectNearestTargetInAttackDistance(5);
if (pTarget)
me->AI()->AttackStart(pTarget);
else