diff options
| author | QAston <qaston@gmail.com> | 2011-09-17 00:56:59 +0200 |
|---|---|---|
| committer | QAston <qaston@gmail.com> | 2011-09-17 00:56:59 +0200 |
| commit | fe25ce4fa3ce306beebc4c95b22cd14052a92566 (patch) | |
| tree | e8bbe02f5b43e8d648230cb2532dd24780ff113e /src/server/scripts/EasternKingdoms | |
| parent | 580264b5a56f742e5eaf1eeb2ea3729740e36478 (diff) | |
Core/AI: Replace many Unit::IsHostileTo with Unit::IsValidAttackTarget or Creature::canCreatureAttack.
Diffstat (limited to 'src/server/scripts/EasternKingdoms')
5 files changed, 5 insertions, 6 deletions
diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp index d308db1459a..2f7fde7ec60 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp @@ -487,7 +487,7 @@ public: if (!who) return; - if (who->isTargetableForAttack() && me->IsHostileTo(who)) + if (me->IsValidAttackTarget(who)) if (me->IsWithinDistInMap(who, 20) && me->IsWithinLOSInMap(who)) AttackStart(who); } diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp index e99f2c2a387..80cbcedda7c 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp @@ -800,7 +800,7 @@ public: void MoveInLineOfSight(Unit* who) { - if (!who || !who->isTargetableForAttack() || !me->IsHostileTo(who) || me->getVictim()) + if (!who || !me->IsValidAttackTarget(who) || me->getVictim()) return; me->AddThreat(who, 0.0f); diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp index ade340d7abb..5123bd2c0ec 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp @@ -269,7 +269,7 @@ public: void MoveInLineOfSight(Unit* who) { - if (!who->isTargetableForAttack() || !me->IsHostileTo(who)) + if (!me->IsValidAttackTarget(who)) return; if (pInstance && Intro) pInstance->SetData(DATA_BRUTALLUS_EVENT, SPECIAL); diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_eredar_twins.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_eredar_twins.cpp index 638bbb2f0d9..644c0eacde5 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_eredar_twins.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_eredar_twins.cpp @@ -437,9 +437,8 @@ public: if (!who || me->getVictim()) return; - if (who->isTargetableForAttack() && who->isInAccessiblePlaceFor(me) && me->IsHostileTo(who)) + if (me->canCreatureAttack(who)) { - float attackRadius = me->GetAttackDistance(who); if (me->IsWithinDistInMap(who, attackRadius) && me->GetDistanceZ(who) <= CREATURE_Z_ATTACK_RANGE && me->IsWithinLOSInMap(who)) { diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp index fb6e44eaf36..39aa4f6f6f3 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp @@ -331,7 +331,7 @@ public: if (bJustReset)//boss is invisible, don't attack return; - if (!me->getVictim() && who->isTargetableForAttack() && (me->IsHostileTo(who))) + if (!me->getVictim() && me->IsValidAttackTarget(who)) { float attackRadius = me->GetAttackDistance(who); if (me->IsWithinDistInMap(who, attackRadius)) |
