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
This commit is contained in:
Mihapro
2017-12-28 22:34:33 +00:00
committed by Shauren
parent 071b23d606
commit 02022d3cd6

View File

@@ -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;