From cd1a9a98c4364b0c1f6038c9314f539105db7482 Mon Sep 17 00:00:00 2001 From: maximius Date: Fri, 11 Sep 2009 12:57:21 -0700 Subject: * [8456] Implement area check for SPELL_ATTR_EX6_NOT_IN_RAID_INSTANCE Author: VladimirMangos --HG-- branch : trunk --- src/game/SpellMgr.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'src/game/SpellMgr.cpp') 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) -- cgit v1.2.3