From 0e3607df5b6df0e85a458cbd37da124f7fa58825 Mon Sep 17 00:00:00 2001 From: click Date: Tue, 7 Apr 2015 21:26:23 +0200 Subject: Core/Spells: Allow non-skill-based flying mounts to be used in designated areas. - Flying mounts that are not in the "SKILL_MOUNT"-tree and area-restricted can now be used properly (ex. 64749 - Loaned Gryphon). - Remove isKnowHowFlyIn()-function (useless and deprecated since this is handled properly in the spellsystem). Massive thanks to rat for extremely good help and support on fixing this (most of this is his work). --- src/server/game/Spells/SpellInfo.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src/server/game/Spells/SpellInfo.cpp') diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index 862521a068c..79db8672a4f 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -1482,12 +1482,19 @@ SpellCastResult SpellInfo::CheckLocation(uint32 map_id, uint32 zone_id, uint32 a case SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED: case SPELL_AURA_FLY: { - if (player && !player->IsKnowHowFlyIn(map_id, zone_id)) - return SPELL_FAILED_INCORRECT_AREA; + if (player) + { + SkillLineAbilityMapBounds bounds = sSpellMgr->GetSkillLineAbilityMapBounds(Id); + for (SkillLineAbilityMap::const_iterator skillIter = bounds.first; skillIter != bounds.second; ++skillIter) + { + // spell 54197 (Cold Weather Flying) is a prereq for flying in Northrend + if (skillIter->second->skillId == SKILL_MOUNTS && player->GetMapId() != 571 && !player->HasSpell(54197)) + return SPELL_FAILED_INCORRECT_AREA; // maybe: SPELL_CUSTOM_ERROR_CANT_USE_THAT_MOUNT + } + } } } } - return SPELL_CAST_OK; } -- cgit v1.2.3