diff options
author | maximius <none@none> | 2009-11-19 04:12:08 -0800 |
---|---|---|
committer | maximius <none@none> | 2009-11-19 04:12:08 -0800 |
commit | 43d9a5eae1256fe1b653edaa580613681fb5fc34 (patch) | |
tree | 466bc3807103696cae506d6fc301bcc14bafe18e /src | |
parent | aa36d772a15fc6490a903017c147519236b4d7ab (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.cpp | 18 |
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; |