mirror of
https://github.com/mangosfour/server.git
synced 2025-12-16 13:37:00 +00:00
[8456] Implement area check for SPELL_ATTR_EX6_NOT_IN_RAID_INSTANCE
Base at hunuza reseach.
This commit is contained in:
parent
664112a738
commit
e59eea4fb5
5 changed files with 16 additions and 8 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue