diff --git a/src/server/game/DataStores/DBCStructure.h b/src/server/game/DataStores/DBCStructure.h index 5da7145978..e8cef2879f 100644 --- a/src/server/game/DataStores/DBCStructure.h +++ b/src/server/game/DataStores/DBCStructure.h @@ -2252,7 +2252,7 @@ struct SpellShapeshiftFormEntry //uint32 unk3; // 9 unused always 0 //uint32 unk4; // 10 unused always 0 uint32 stanceSpell[MAX_SHAPESHIFT_SPELLS]; // 11-18 spells which appear in the bar after shapeshifting - //uint32 unk5; // 19 + uint32 MountTypeID; // 19 //uint32 unk6; // 20 }; diff --git a/src/server/game/DataStores/DBCfmt.h b/src/server/game/DataStores/DBCfmt.h index cc394e308f..3500858c89 100644 --- a/src/server/game/DataStores/DBCfmt.h +++ b/src/server/game/DataStores/DBCfmt.h @@ -172,7 +172,7 @@ char const SpellCooldownsEntryfmt[] = "diii"; char const SpellLevelsEntryfmt[] = "diii"; char const SpellRuneCostfmt[] = "niiii"; char const SpellShapeshiftEntryfmt[] = "niiiix"; -char const SpellShapeshiftFormfmt[] = "nxxiixiiixxiiiiiiiixx"; +char const SpellShapeshiftFormfmt[] = "nxxiixiiixxiiiiiiiiix"; char const StableSlotPricesfmt[] = "ni"; char const SummonPropertiesfmt[] = "niiiii"; char const TalentEntryfmt[] = "niiiiiiiiixxixxxxxx"; diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 19e81a9c3e..042a9dce20 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -25267,31 +25267,6 @@ uint32 Player::CalculateTalentsPoints() const return uint32(talentPointsForLevel * sWorld->getRate(RATE_TALENT)); } -bool Player::CanFlyInZone(uint32 mapid, uint32 areaid) const -{ - // continent checked in SpellInfo::CheckLocation at cast and area update - bool can_fly = false; - switch (mapid) - { - case 0: // Eastern Kingdoms - case 1: // Kalimdor - case 646: // Deepholm - can_fly = HasSpell(90267); // Flight Master's License - break; - case 571: // Northrend - can_fly = HasSpell(54197); // Cold Weather Flying - break; - case 530: // Outland - // Draenei and blood elves starting zones belong to Outland map, but are not flyable - // These zones don't have flag AREA_FLAG_OUTLAND2 - if (sAreaTableStore.AssertEntry(areaid)->flags & AREA_FLAG_OUTLAND2) - can_fly = true; - default: - break; - } - return can_fly; -} - void Player::LearnSpellHighestRank(uint32 spellid) { LearnSpell(spellid, false); diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index 8be5ca484c..84bb34e7a7 100644 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -2318,8 +2318,6 @@ class TC_GAME_API Player : public Unit, public GridObject void SetFallInformation(uint32 time, float z); void HandleFall(MovementInfo const& movementInfo); - bool CanFlyInZone(uint32 mapid, uint32 zone) const; - void SetClientControl(Unit* target, bool allowMove); void SetMover(Unit* target); diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index 921de39e00..546b33d5a3 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -1752,18 +1752,12 @@ SpellCastResult SpellInfo::CheckLocation(uint32 map_id, uint32 zone_id, uint32 a switch (Effects[i].ApplyAuraName) { - case SPELL_AURA_FLY: + case SPELL_AURA_MOD_SHAPESHIFT: { - 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 - } - } + if (SpellShapeshiftFormEntry const* spellShapeshiftForm = sSpellShapeshiftFormStore.LookupEntry(Effects[i].MiscValue)) + if (uint32 mountType = spellShapeshiftForm->MountTypeID) + if (!player->GetMountCapability(mountType)) + return SPELL_FAILED_NOT_HERE; break; } case SPELL_AURA_MOUNTED: