aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Entities/Player/Player.cpp22
-rw-r--r--src/server/game/Globals/ObjectMgr.cpp4
2 files changed, 17 insertions, 9 deletions
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
index f9caa99df51..180ce2558da 100644
--- a/src/server/game/Entities/Player/Player.cpp
+++ b/src/server/game/Entities/Player/Player.cpp
@@ -143,7 +143,9 @@
enum PlayerSpells
{
- SPELL_EXPERIENCE_ELIMINATED = 206662
+ SPELL_EXPERIENCE_ELIMINATED = 206662,
+ SPELL_APPRENTICE_RIDING = 33389,
+ SPELL_JOURNEYMAN_RIDING = 33391
};
static uint32 copseReclaimDelay[MAX_DEATH_COUNT] = { 30, 60, 120 };
@@ -24344,10 +24346,6 @@ void Player::LearnSkillRewardedSpells(uint32 skillId, uint32 skillValue, Races r
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.IsEmpty() && !ability->RaceMask.HasRace(race))
continue;
@@ -24356,8 +24354,18 @@ void Player::LearnSkillRewardedSpells(uint32 skillId, uint32 skillValue, Races r
if (ability->ClassMask && !(ability->ClassMask & classMask))
continue;
- // check level, skip class spells if not high enough
- if (GetLevel() < spellInfo->SpellLevel)
+ // Check level, skip class spells if not high enough
+ uint32 requiredLevel = std::max(spellInfo->SpellLevel, spellInfo->BaseLevel);
+
+ // riding special cases
+ if (skillId == SKILL_RIDING)
+ {
+ if (GetClassMask() & ((1 << (CLASS_DEATH_KNIGHT - 1)) | (1 << (CLASS_DEMON_HUNTER - 1)))
+ && (ability->Spell == SPELL_APPRENTICE_RIDING || ability->Spell == SPELL_JOURNEYMAN_RIDING))
+ requiredLevel = 0;
+ }
+
+ if (requiredLevel > GetLevel())
continue;
// need unlearn spell
diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp
index 18dbc889c7a..3030057f1dd 100644
--- a/src/server/game/Globals/ObjectMgr.cpp
+++ b/src/server/game/Globals/ObjectMgr.cpp
@@ -3962,9 +3962,9 @@ void ObjectMgr::LoadPlayerInfo()
for (SkillRaceClassInfoEntry const* rcInfo : sSkillRaceClassInfoStore)
if (rcInfo->Availability == 1)
for (uint32 raceIndex = RACE_HUMAN; raceIndex < MAX_RACES; ++raceIndex)
- if (rcInfo->RaceMask.HasRace(raceIndex))
+ if (rcInfo->RaceMask.IsEmpty() || rcInfo->RaceMask.HasRace(raceIndex))
for (uint32 classIndex = CLASS_WARRIOR; classIndex < MAX_CLASSES; ++classIndex)
- if (rcInfo->ClassMask == -1 || ((1 << (classIndex - 1)) & rcInfo->ClassMask))
+ if (rcInfo->ClassMask == -1 || rcInfo->ClassMask == 0 || ((1 << (classIndex - 1)) & rcInfo->ClassMask))
if (auto const& playerInfo = Trinity::Containers::MapGetValuePtr(_playerInfo, { Races(raceIndex), Classes(classIndex) }))
playerInfo->get()->skills.push_back(rcInfo);