diff options
author | maximius <none@none> | 2009-09-11 12:57:21 -0700 |
---|---|---|
committer | maximius <none@none> | 2009-09-11 12:57:21 -0700 |
commit | cd1a9a98c4364b0c1f6038c9314f539105db7482 (patch) | |
tree | 67c2a5c8d9784aa3be12a52433b282b3fd2c37e8 /src | |
parent | 5bd67d1b4b3f60f8322d547ede27765048f00379 (diff) |
* [8456] Implement area check for SPELL_ATTR_EX6_NOT_IN_RAID_INSTANCE Author: VladimirMangos
--HG--
branch : trunk
Diffstat (limited to 'src')
-rw-r--r-- | src/game/SharedDefines.h | 4 | ||||
-rw-r--r-- | src/game/SpellMgr.cpp | 14 |
2 files changed, 13 insertions, 5 deletions
diff --git a/src/game/SharedDefines.h b/src/game/SharedDefines.h index f035e32d16f..139de37bf84 100644 --- a/src/game/SharedDefines.h +++ b/src/game/SharedDefines.h @@ -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_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_UNK3 0x00000008 // 3 #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_UNK9 0x00000200 // 9 #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_UNK13 0x00002000 // 13 #define SPELL_ATTR_EX6_UNK14 0x00004000 // 14 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) |