Core/Spells: Fixed shapeshift location check

This commit is contained in:
Ovalord committed 2017-12-13 22:51:32 +01:00
1 parent 1c38825f0a
commit 175e469cb4
5 files changed
+7 -40

No files matched your search

+1 -1
View File
@@ -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
};
+1 -1
View File
@@ -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";
@@ -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);
-2
View File
@@ -2318,8 +2318,6 @@ class TC_GAME_API Player : public Unit, public GridObject<Player>
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);
+5 -11
View File
@@ -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: