[8456] Implement area check for SPELL_ATTR_EX6_NOT_IN_RAID_INSTANCE

Base at hunuza reseach.
This commit is contained in:
VladimirMangos 2009-09-02 22:59:01 +04:00
parent 664112a738
commit e59eea4fb5
5 changed files with 16 additions and 8 deletions

View file

@ -2746,7 +2746,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;
@ -2754,7 +2754,7 @@ SpellCastResult SpellMgr::GetSpellAllowedInLocationError(SpellEntry const *spell
groupEntry = sAreaGroupStore.LookupEntry(groupEntry->nextGroup);
}
if(!found)
if (!found)
return SPELL_FAILED_INCORRECT_AREA;
}
@ -2763,10 +2763,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)