aboutsummaryrefslogtreecommitdiff
path: root/src/game/SpellMgr.cpp
diff options
context:
space:
mode:
authormaximius <none@none>2009-09-11 12:57:21 -0700
committermaximius <none@none>2009-09-11 12:57:21 -0700
commitcd1a9a98c4364b0c1f6038c9314f539105db7482 (patch)
tree67c2a5c8d9784aa3be12a52433b282b3fd2c37e8 /src/game/SpellMgr.cpp
parent5bd67d1b4b3f60f8322d547ede27765048f00379 (diff)
* [8456] Implement area check for SPELL_ATTR_EX6_NOT_IN_RAID_INSTANCE Author: VladimirMangos
--HG-- branch : trunk
Diffstat (limited to 'src/game/SpellMgr.cpp')
-rw-r--r--src/game/SpellMgr.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/game/SpellMgr.cpp b/src/game/SpellMgr.cpp
index 1998a336799..b82343111a3 100644
--- a/src/game/SpellMgr.cpp
+++ b/src/game/SpellMgr.cpp
@@ -2624,7 +2624,7 @@ SpellCastResult SpellMgr::GetSpellAllowedInLocationError(SpellEntry const *spell
while (groupEntry)
{
for (uint32 i=0; i<6; ++i)
- if( groupEntry->AreaId[i] == zone_id || groupEntry->AreaId[i] == area_id )
+ if (groupEntry->AreaId[i] == zone_id || groupEntry->AreaId[i] == area_id)
found = true;
if (found || !groupEntry->nextGroup)
break;
@@ -2632,7 +2632,7 @@ SpellCastResult SpellMgr::GetSpellAllowedInLocationError(SpellEntry const *spell
groupEntry = sAreaGroupStore.LookupEntry(groupEntry->nextGroup);
}
- if(!found)
+ if (!found)
return SPELL_FAILED_INCORRECT_AREA;
}
@@ -2641,10 +2641,18 @@ SpellCastResult SpellMgr::GetSpellAllowedInLocationError(SpellEntry const *spell
{
uint32 v_map = GetVirtualMapForMapAndZone(map_id, zone_id);
MapEntry const* mapEntry = sMapStore.LookupEntry(v_map);
- if(!mapEntry || mapEntry->addon < 1 || !mapEntry->IsContinent())
+ if (!mapEntry || mapEntry->addon < 1 || !mapEntry->IsContinent())
return SPELL_FAILED_INCORRECT_AREA;
}
+ // raid instance limitation
+ if (spellInfo->AttributesEx6 & SPELL_ATTR_EX6_NOT_IN_RAID_INSTANCE)
+ {
+ MapEntry const* mapEntry = sMapStore.LookupEntry(map_id);
+ if (!mapEntry || mapEntry->IsRaid())
+ return SPELL_FAILED_NOT_IN_RAID_INSTANCE;
+ }
+
// DB base check (if non empty then must fit at least single for allow)
SpellAreaMapBounds saBounds = spellmgr.GetSpellAreaMapBounds(spellInfo->Id);
if (saBounds.first != saBounds.second)