aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormaximius <none@none>2009-11-19 04:12:08 -0800
committermaximius <none@none>2009-11-19 04:12:08 -0800
commit43d9a5eae1256fe1b653edaa580613681fb5fc34 (patch)
tree466bc3807103696cae506d6fc301bcc14bafe18e /src
parentaa36d772a15fc6490a903017c147519236b4d7ab (diff)
*Dalaran Mageguard, optimization and a more forgiving HasInArc check. Refs #329
--HG-- branch : trunk
Diffstat (limited to 'src')
-rw-r--r--src/bindings/scripts/scripts/northrend/dalaran.cpp18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/bindings/scripts/scripts/northrend/dalaran.cpp b/src/bindings/scripts/scripts/northrend/dalaran.cpp
index 9eb8d70e499..f793b4dc6fc 100644
--- a/src/bindings/scripts/scripts/northrend/dalaran.cpp
+++ b/src/bindings/scripts/scripts/northrend/dalaran.cpp
@@ -76,17 +76,23 @@ struct TRINITY_DLL_DECL npc_mageguard_dalaranAI : public Scripted_NoMovementAI
{
case 29254:
if (pPlayer->GetTeam() == HORDE)
- if (const Creature *pOutdoorNPC = me->FindNearestCreature(NPC_APPLEBOUGH_A, 200.0f))
- if ((!me->HasInArc(M_PI, pWho) && me->IsWithinDist(pOutdoorNPC, 35.0f, false)) // Behind me, and "outdoors"
- || ( me->HasInArc(M_PI, pWho) && !me->IsWithinDist(pOutdoorNPC, 35.0f, false))) // In front of me, and "indoors"
+ if (Creature *pOutdoorNPC = me->FindNearestCreature(NPC_APPLEBOUGH_A, 35.0f))
+ {
+ if (!me->HasInArc(1.5*M_PI, pWho)) // Behind me, and "outdoors"
DoCast(pWho, SPELL_TRESPASSER_A); // Teleport the Horde unit out
+ }
+ else if (me->HasInArc(M_PI, pWho)) // In front of me, and "indoors"
+ DoCast(pWho, SPELL_TRESPASSER_A); // Teleport the Horde unit out
break;
case 29255:
if (pPlayer->GetTeam() == ALLIANCE)
- if (const Creature *pOutdoorNPC = me->FindNearestCreature(NPC_SWEETBERRY_H, 200.0f))
- if ((!me->HasInArc(M_PI, pWho) && me->IsWithinDist(pOutdoorNPC, 35.0f, false)) // Behind me, and "outdoors"
- || ( me->HasInArc(M_PI, pWho) && !me->IsWithinDist(pOutdoorNPC, 35.0f, false))) // In front of me, and "indoors"
+ if (Creature *pOutdoorNPC = me->FindNearestCreature(NPC_SWEETBERRY_H, 35.0f))
+ {
+ if (!me->HasInArc(1.5*M_PI, pWho)) // Behind me, and "outdoors"
DoCast(pWho, SPELL_TRESPASSER_H); // Teleport the Alliance unit out
+ }
+ else if (me->HasInArc(M_PI, pWho)) // In front of me, and "indoors"
+ DoCast(pWho, SPELL_TRESPASSER_H); // Teleport the Alliance unit out
break;
}
return;