* [8456] Implement area check for SPELL_ATTR_EX6_NOT_IN_RAID_INSTANCE Author: VladimirMangos

--HG--
branch : trunk
This commit is contained in:
maximius
2009-09-11 12:57:21 -07:00
parent 5bd67d1b4b
commit cd1a9a98c4
2 changed files with 13 additions and 5 deletions
+2 -2
View File
@@ -425,7 +425,7 @@ const uint32 ItemQualityColors[MAX_ITEM_QUALITY] = {
#define SPELL_ATTR_EX5_UNK31 0x80000000 // 31 Forces all nearby enemies to focus attacks caster #define SPELL_ATTR_EX5_UNK31 0x80000000 // 31 Forces all nearby enemies to focus attacks caster
#define SPELL_ATTR_EX6_UNK0 0x00000001 // 0 Only Move spell have this flag #define SPELL_ATTR_EX6_UNK0 0x00000001 // 0 Only Move spell have this flag
#define SPELL_ATTR_EX6_UNK1 0x00000002 // 1 only usable in arena #define SPELL_ATTR_EX6_ONLY_IN_ARENA 0x00000002 // 1 only usable in arena
#define SPELL_ATTR_EX6_IGNORE_CASTER_AURAS 0x00000004 // 2 #define SPELL_ATTR_EX6_IGNORE_CASTER_AURAS 0x00000004 // 2
#define SPELL_ATTR_EX6_UNK3 0x00000008 // 3 #define SPELL_ATTR_EX6_UNK3 0x00000008 // 3
#define SPELL_ATTR_EX6_UNK4 0x00000010 // 4 #define SPELL_ATTR_EX6_UNK4 0x00000010 // 4
@@ -435,7 +435,7 @@ const uint32 ItemQualityColors[MAX_ITEM_QUALITY] = {
#define SPELL_ATTR_EX6_UNK8 0x00000100 // 8 #define SPELL_ATTR_EX6_UNK8 0x00000100 // 8
#define SPELL_ATTR_EX6_UNK9 0x00000200 // 9 #define SPELL_ATTR_EX6_UNK9 0x00000200 // 9
#define SPELL_ATTR_EX6_UNK10 0x00000400 // 10 #define SPELL_ATTR_EX6_UNK10 0x00000400 // 10
#define SPELL_ATTR_EX6_UNK11 0x00000800 // 11 not usable in raid instance #define SPELL_ATTR_EX6_NOT_IN_RAID_INSTANCE 0x00000800 // 11 not usable in raid instance
#define SPELL_ATTR_EX6_UNK12 0x00001000 // 12 #define SPELL_ATTR_EX6_UNK12 0x00001000 // 12
#define SPELL_ATTR_EX6_UNK13 0x00002000 // 13 #define SPELL_ATTR_EX6_UNK13 0x00002000 // 13
#define SPELL_ATTR_EX6_UNK14 0x00004000 // 14 #define SPELL_ATTR_EX6_UNK14 0x00004000 // 14
+11 -3
View File
@@ -2624,7 +2624,7 @@ SpellCastResult SpellMgr::GetSpellAllowedInLocationError(SpellEntry const *spell
while (groupEntry) while (groupEntry)
{ {
for (uint32 i=0; i<6; ++i) 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; found = true;
if (found || !groupEntry->nextGroup) if (found || !groupEntry->nextGroup)
break; break;
@@ -2632,7 +2632,7 @@ SpellCastResult SpellMgr::GetSpellAllowedInLocationError(SpellEntry const *spell
groupEntry = sAreaGroupStore.LookupEntry(groupEntry->nextGroup); groupEntry = sAreaGroupStore.LookupEntry(groupEntry->nextGroup);
} }
if(!found) if (!found)
return SPELL_FAILED_INCORRECT_AREA; return SPELL_FAILED_INCORRECT_AREA;
} }
@@ -2641,10 +2641,18 @@ SpellCastResult SpellMgr::GetSpellAllowedInLocationError(SpellEntry const *spell
{ {
uint32 v_map = GetVirtualMapForMapAndZone(map_id, zone_id); uint32 v_map = GetVirtualMapForMapAndZone(map_id, zone_id);
MapEntry const* mapEntry = sMapStore.LookupEntry(v_map); 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; 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) // DB base check (if non empty then must fit at least single for allow)
SpellAreaMapBounds saBounds = spellmgr.GetSpellAreaMapBounds(spellInfo->Id); SpellAreaMapBounds saBounds = spellmgr.GetSpellAreaMapBounds(spellInfo->Id);
if (saBounds.first != saBounds.second) if (saBounds.first != saBounds.second)