From 02022d3cd65f072874e9f5de061e0b158b6eb634 Mon Sep 17 00:00:00 2001 From: Mihapro Date: Thu, 28 Dec 2017 22:34:33 +0000 Subject: [PATCH] Core/Player: Automatically learn riding spells for certain race/class combinations * Paladins, Warlocks, Druids and Worgens automatically learn Apprentice Riding at level 20 * Death Knights start with Journeyman Riding * Demon Hunters start with Artisian Riding + Flight Master's License --- src/server/game/Entities/Player/Player.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 35f768c8338..6983f0b8c49 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -23965,11 +23965,6 @@ void Player::LearnQuestRewardedSpells() void Player::LearnSkillRewardedSpells(uint32 skillId, uint32 skillValue) { - // bad hack to work around data being suited only for the client - AcquireMethod == SKILL_LINE_ABILITY_LEARNED_ON_SKILL_LEARN for riding - // client uses it to show riding in spellbook as trainable - if (skillId == SKILL_RIDING) - return; - uint32 raceMask = getRaceMask(); uint32 classMask = getClassMask(); for (uint32 j = 0; j < sSkillLineAbilityStore.GetNumRows(); ++j) @@ -23985,6 +23980,10 @@ void Player::LearnSkillRewardedSpells(uint32 skillId, uint32 skillValue) if (ability->AcquireMethod != SKILL_LINE_ABILITY_LEARNED_ON_SKILL_VALUE && ability->AcquireMethod != SKILL_LINE_ABILITY_LEARNED_ON_SKILL_LEARN) continue; + // AcquireMethod == 2 && NumSkillUps == 1 --> automatically learn riding skill spell, else we skip it (client shows riding in spellbook as trainable). + if (skillId == SKILL_RIDING && (ability->AcquireMethod != SKILL_LINE_ABILITY_LEARNED_ON_SKILL_LEARN || ability->NumSkillUps != 1)) + continue; + // Check race if set if (ability->RaceMask && !(ability->RaceMask & raceMask)) continue;