From e59eea4fb5335945d0b227264be8f41c60b820d4 Mon Sep 17 00:00:00 2001 From: VladimirMangos Date: Wed, 2 Sep 2009 22:59:01 +0400 Subject: [PATCH] [8456] Implement area check for SPELL_ATTR_EX6_NOT_IN_RAID_INSTANCE Base at hunuza reseach. --- src/game/DBCStructure.h | 2 +- src/game/DBCfmt.h | 2 +- src/game/SharedDefines.h | 4 ++-- src/game/SpellMgr.cpp | 14 +++++++++++--- src/shared/revision_nr.h | 2 +- 5 files changed, 16 insertions(+), 8 deletions(-) diff --git a/src/game/DBCStructure.h b/src/game/DBCStructure.h index 62b9d9587..b7ea2724c 100644 --- a/src/game/DBCStructure.h +++ b/src/game/DBCStructure.h @@ -1302,7 +1302,7 @@ struct SpellEntry uint32 AttributesEx3; // 7 m_attributesExC uint32 AttributesEx4; // 8 m_attributesExD uint32 AttributesEx5; // 9 m_attributesExE - //uint32 AttributesEx6; // 10 m_attributesExF not used + uint32 AttributesEx6; // 10 m_attributesExF uint32 Stances; // 11 m_shapeshiftMask uint32 StancesNot; // 12 m_shapeshiftExclude uint32 Targets; // 13 m_targets diff --git a/src/game/DBCfmt.h b/src/game/DBCfmt.h index 67086d8c1..da26a14f7 100644 --- a/src/game/DBCfmt.h +++ b/src/game/DBCfmt.h @@ -83,7 +83,7 @@ const char SkillLineAbilityfmt[]="niiiixxiiiiixx"; const char SoundEntriesfmt[]="nxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; const char SpellCastTimefmt[]="nixx"; const char SpellDurationfmt[]="niii"; -const char SpellEntryfmt[]="niiiiiiiiixiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiifxiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiffffffiiiiiiiiiiiiiiiiiiiiifffiiiiiiiiiiiiiiifffiiiiiiiiiiiiixssssssssssssssssxssssssssssssssssxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxiiiiiiiiiiixfffxxxiiiiixx"; +const char SpellEntryfmt[]="niiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiifxiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiffffffiiiiiiiiiiiiiiiiiiiiifffiiiiiiiiiiiiiiifffiiiiiiiiiiiiixssssssssssssssssxssssssssssssssssxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxiiiiiiiiiiixfffxxxiiiiixx"; const char SpellFocusObjectfmt[]="nxxxxxxxxxxxxxxxxx"; const char SpellItemEnchantmentfmt[]="nxiiiiiixxxiiissssssssssssssssxiiiixxx"; const char SpellItemEnchantmentConditionfmt[]="nbbbbbxxxxxbbbbbbbbbbiiiiiXXXXX"; diff --git a/src/game/SharedDefines.h b/src/game/SharedDefines.h index e59383381..9c26e3373 100644 --- a/src/game/SharedDefines.h +++ b/src/game/SharedDefines.h @@ -417,7 +417,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, not used in 3.2.0a and early #define SPELL_ATTR_EX6_UNK2 0x00000004 // 2 #define SPELL_ATTR_EX6_UNK3 0x00000008 // 3 #define SPELL_ATTR_EX6_UNK4 0x00000010 // 4 @@ -427,7 +427,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 66eb0ea1b..87c0849b7 100644 --- a/src/game/SpellMgr.cpp +++ b/src/game/SpellMgr.cpp @@ -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) diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 1917ef341..59bdd01ed 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "8455" + #define REVISION_NR "8456" #endif // __REVISION_NR_H__