aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormaximius <none@none>2009-11-19 18:21:43 -0800
committermaximius <none@none>2009-11-19 18:21:43 -0800
commitd7ed79825c1b9cb2ec8a0ca1686ee34d13ae5e2c (patch)
tree39c2ce98076b7fa8133d43f669de5f30e18f9f34 /src
parent02eeffd22f10920aacd8292ed3bf52ac0d74e4a6 (diff)
*Dalaran Mageguards now only consider you to be behind them if you are close to them, and they reset their orientation after casting the Trespasser spell. Closes #329
--HG-- branch : trunk
Diffstat (limited to 'src')
-rw-r--r--src/bindings/scripts/scripts/northrend/dalaran.cpp25
1 files changed, 12 insertions, 13 deletions
diff --git a/src/bindings/scripts/scripts/northrend/dalaran.cpp b/src/bindings/scripts/scripts/northrend/dalaran.cpp
index f793b4dc6fc..30d3ccc5f0b 100644
--- a/src/bindings/scripts/scripts/northrend/dalaran.cpp
+++ b/src/bindings/scripts/scripts/northrend/dalaran.cpp
@@ -18,7 +18,7 @@
/* Script Data Start
SDName: Dalaran
-SDAuthor: WarHead
+SDAuthor: WarHead, MaXiMiUS
SD%Complete: 99%
SDComment: For what is 63990+63991? Same function but don't work correct...
SDCategory: Dalaran
@@ -59,7 +59,7 @@ struct TRINITY_DLL_DECL npc_mageguard_dalaranAI : public Scripted_NoMovementAI
void MoveInLineOfSight(Unit *pWho)
{
- if (!pWho || me->GetZoneId() != 4395) // Must be in Dalaran
+ if (!pWho || !pWho->IsInWorld() || pWho->GetZoneId() != 4395)
return;
if (!me->IsWithinDist(pWho, 65.0f, false))
@@ -67,34 +67,33 @@ struct TRINITY_DLL_DECL npc_mageguard_dalaranAI : public Scripted_NoMovementAI
Player *pPlayer = pWho->GetCharmerOrOwnerPlayerOrPlayerItself();
- if (!pPlayer || pPlayer->isGameMaster())
+ if (!pPlayer || pPlayer->isGameMaster() || pPlayer->IsBeingTeleported())
return;
- float x = pWho->GetPositionX();
- float y = pWho->GetPositionY();
switch (m_creature->GetEntry())
{
case 29254:
if (pPlayer->GetTeam() == HORDE)
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
+ if (me->isInBackInMap(pWho, 12.0f))
+ DoCast(pWho, SPELL_TRESPASSER_A);
}
- else if (me->HasInArc(M_PI, pWho)) // In front of me, and "indoors"
- DoCast(pWho, SPELL_TRESPASSER_A); // Teleport the Horde unit out
+ else // In my line of sight, and "indoors"
+ DoCast(pWho, SPELL_TRESPASSER_A); // Teleport the Horde unit out
break;
case 29255:
if (pPlayer->GetTeam() == ALLIANCE)
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
+ if (me->isInBackInMap(pWho, 12.0f))
+ DoCast(pWho, SPELL_TRESPASSER_A);
}
- else if (me->HasInArc(M_PI, pWho)) // In front of me, and "indoors"
- DoCast(pWho, SPELL_TRESPASSER_H); // Teleport the Alliance unit out
+ else // In my line of sight, and "indoors"
+ DoCast(pWho, SPELL_TRESPASSER_H); // Teleport the Alliance unit out
break;
}
+ me->SetOrientation(me->GetHomePosition().GetOrientation());
return;
}