aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormaximius <none@none>2009-11-18 02:31:38 -0800
committermaximius <none@none>2009-11-18 02:31:38 -0800
commit977692c07081e3ffb9076f41d6b15a00ee36b085 (patch)
tree4cc39b8ac33d48055a09bf9f4842781b40b01ad6
parent753c472010291296855a9f0d193c7a416ec5a21d (diff)
*Better (but still hacky) Dalaran Mageguard 'Trespasser!' conditions
--HG-- branch : trunk
-rw-r--r--src/bindings/scripts/scripts/northrend/dalaran.cpp24
1 files changed, 14 insertions, 10 deletions
diff --git a/src/bindings/scripts/scripts/northrend/dalaran.cpp b/src/bindings/scripts/scripts/northrend/dalaran.cpp
index ea06c2d3a0f..f7b01fd2551 100644
--- a/src/bindings/scripts/scripts/northrend/dalaran.cpp
+++ b/src/bindings/scripts/scripts/northrend/dalaran.cpp
@@ -67,26 +67,30 @@ struct TRINITY_DLL_DECL npc_mageguard_dalaranAI : public Scripted_NoMovementAI
if (!pWho)
return;
- Player* pVisiblePlayer = NULL;
-
- if (pWho->GetTypeId() == TYPEID_PLAYER)
- pVisiblePlayer = CAST_PLR(pWho);
+ if (pWho->GetZoneId() != 4395) // Dalaran
+ return;
- if (!pVisiblePlayer || pVisiblePlayer->isGameMaster())
+ if (!me->IsWithinDist(pWho, 50.0f, false))
return;
- if (m_creature->GetDistance(pVisiblePlayer) >= 12.0f)
+ Player *pPlayer = pWho->GetCharmerOrOwnerPlayerOrPlayerItself();
+
+ if (!pPlayer || pPlayer->isGameMaster())
return;
+ float x = pWho->GetPositionX();
+ float y = pWho->GetPositionY();
switch (m_creature->GetEntry())
{
case 29254:
- if (pVisiblePlayer->GetTeam() == HORDE)
- DoCast(pVisiblePlayer, SPELL_TRESPASSER_A);
+ if (pPlayer->GetTeam() == HORDE)
+ if (x < 5760.0f && y > 665.0f && y < 812.0f) // Silver Enclave (Dalaran), fast check
+ DoCast(pWho, SPELL_TRESPASSER_A);
break;
case 29255:
- if (pVisiblePlayer->GetTeam() == ALLIANCE)
- DoCast(pVisiblePlayer, SPELL_TRESPASSER_H);
+ if (pPlayer->GetTeam() == ALLIANCE)
+ if (x > 5864.0f && y > 507.0f && y < 600.0f) // Sunreaver's Sanctuary (Dalaran), fast check
+ DoCast(pWho, SPELL_TRESPASSER_H);
break;
}
return;