aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Spells/SpellMgr.cpp
diff options
context:
space:
mode:
authorManuel <manue.l@live.com.ar>2011-01-09 00:00:08 -0300
committerManuel <manue.l@live.com.ar>2011-01-09 00:00:08 -0300
commit5cf76896eb07c449327aaca7c36046027fb955df (patch)
treefb4844e27a521668a79f5fc4a69cce0ec4060f57 /src/server/game/Spells/SpellMgr.cpp
parent57173df80f29d796a6de56b877fceff7abe181bc (diff)
Core/Battleground: Implemented blizzlike script for Isle of Conquest, written by gyullo and me, based on Socolin's and Josh's patch -BIG THANKS TO THEM-
Anyway the map is not yet playable, there are issues not related with the script. I also want to thanks to QAston, linencloth, Shauren and Machiavelli to be so patient with my questions.
Diffstat (limited to 'src/server/game/Spells/SpellMgr.cpp')
-rwxr-xr-xsrc/server/game/Spells/SpellMgr.cpp32
1 files changed, 25 insertions, 7 deletions
diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp
index 56b3ab57306..08f8541f80b 100755
--- a/src/server/game/Spells/SpellMgr.cpp
+++ b/src/server/game/Spells/SpellMgr.cpp
@@ -27,6 +27,7 @@
#include "BattlegroundMgr.h"
#include "CreatureAI.h"
#include "MapManager.h"
+#include "BattlegroundIC.h"
bool IsAreaEffectTarget[TOTAL_SPELL_TARGETS];
SpellEffectTargetTypes EffectTargetType[TOTAL_SPELL_EFFECTS];
@@ -3084,15 +3085,32 @@ bool SpellArea::IsFitToRequirements(Player const* player, uint32 newZone, uint32
switch(spellId)
{
case 58600: // No fly Zone - Dalaran
- if (!player)
- return false;
+ {
+ if (!player)
+ return false;
+
+ AreaTableEntry const* pArea = GetAreaEntryByAreaID(player->GetAreaId());
+ if (!(pArea && pArea->flags & AREA_FLAG_NO_FLY_ZONE))
+ return false;
+ if (!player->HasAuraType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED) && !player->HasAuraType(SPELL_AURA_FLY))
+ return false;
+ break;
+ }
+ case 68719: // Oil Refinery - Isle of Conquest.
+ case 68720: // Quarry - Isle of Conquest.
+ {
+ if (player->GetBattlegroundTypeId() != BATTLEGROUND_IC || !player->GetBattleground())
+ return false;
+
+ uint8 nodeType = spellId == 68719 ? NODE_TYPE_REFINERY : NODE_TYPE_QUARRY;
+ uint8 nodeState = player->GetTeamId() == TEAM_ALLIANCE ? NODE_STATE_CONTROLLED_A : NODE_STATE_CONTROLLED_H;
+
+ BattlegroundIC* pIC = static_cast<BattlegroundIC*>(player->GetBattleground());
+ if (pIC->GetNodeState(nodeType) == nodeState)
+ return true;
- AreaTableEntry const* pArea = GetAreaEntryByAreaID(player->GetAreaId());
- if (!(pArea && pArea->flags & AREA_FLAG_NO_FLY_ZONE))
- return false;
- if (!player->HasAuraType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED) && !player->HasAuraType(SPELL_AURA_FLY))
return false;
- break;
+ }
}
return true;