diff options
author | Shauren <shauren.trinity@gmail.com> | 2018-09-25 21:08:38 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2018-09-26 23:08:22 +0200 |
commit | a6fb448b44b5c7e64e6ea960bf951ccf0a8dd0c9 (patch) | |
tree | b0e24d187f2ba39d3258e08410cfb7becc1676e0 /src/server/game/Spells/SpellInfo.cpp | |
parent | f46314c8cec6c741273b37f77fef378c619a6263 (diff) |
Core/DataStores: Updated hotfix database structure
* Updated handling for removed db2s
Diffstat (limited to 'src/server/game/Spells/SpellInfo.cpp')
-rw-r--r-- | src/server/game/Spells/SpellInfo.cpp | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index 4a8695a60f5..1c935e62bd5 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -1879,10 +1879,31 @@ SpellCastResult SpellInfo::CheckLocation(uint32 map_id, uint32 zone_id, uint32 a // continent limitation (virtual continent) if (HasAttribute(SPELL_ATTR4_CAST_ONLY_IN_OUTLAND)) { - uint32 v_map = sDB2Manager.GetVirtualMapForMapAndZone(map_id, zone_id); - MapEntry const* mapEntry = sMapStore.LookupEntry(v_map); - if (!mapEntry || mapEntry->ExpansionID < 1 || !mapEntry->IsContinent()) + uint32 mountFlags = 0; + if (player && player->HasAuraType(SPELL_AURA_MOUNT_RESTRICTIONS)) + { + for (AuraEffect const* auraEffect : player->GetAuraEffectsByType(SPELL_AURA_MOUNT_RESTRICTIONS)) + mountFlags |= auraEffect->GetMiscValue(); + } + else if (AreaTableEntry const* areaTable = sAreaTableStore.LookupEntry(area_id)) + mountFlags = areaTable->MountFlags; + + if (!(mountFlags & AREA_MOUNT_FLAG_FLYING_ALLOWED)) return SPELL_FAILED_INCORRECT_AREA; + + if (player) + { + uint32 mapToCheck = map_id; + if (MapEntry const* mapEntry = sMapStore.LookupEntry(map_id)) + mapToCheck = mapEntry->CosmeticParentMapID; + + if ((mapToCheck == 1116 || mapToCheck == 1464) && !player->HasSpell(191645)) // Draenor Pathfinder + return SPELL_FAILED_INCORRECT_AREA; + else if (mapToCheck == 1220 && !player->HasSpell(233368)) // Broken Isles Pathfinder + return SPELL_FAILED_INCORRECT_AREA; + else if ((mapToCheck == 1642 || mapToCheck == 1643) && !player->HasSpell(278833)) // Battle for Azeroth Pathfinder + return SPELL_FAILED_INCORRECT_AREA; + } } // raid instance limitation |