Core/Skills: Fix rogue's lock picking

Fixes #12677
Closes #13111
This commit is contained in:
DDuarte
2014-09-12 18:11:19 +01:00
parent b7865a3eb5
commit dcba0106d6

View File

@@ -3807,7 +3807,8 @@ bool Player::AddSpell(uint32 spellId, bool active, bool learning, bool dependent
if (!pSkill)
continue;
if (_spell_idx->second->AutolearnType == SKILL_LINE_ABILITY_LEARNED_ON_SKILL_LEARN && !HasSkill(pSkill->id))
///@todo: confirm if rogues start with lockpicking skill at level 1 but only receive the spell to use it at level 16
if ((_spell_idx->second->AutolearnType == SKILL_LINE_ABILITY_LEARNED_ON_SKILL_LEARN && !HasSkill(pSkill->id)) || (pSkill->id == SKILL_LOCKPICKING && _spell_idx->second->max_value == 0))
LearnDefaultSkill(pSkill->id, 0);
if (pSkill->id == SKILL_MOUNTS && !Has310Flyer(false))
@@ -23146,6 +23147,8 @@ void Player::LearnDefaultSkill(uint32 skillId, uint16 rank)
skillValue = std::min(std::max<uint16>({ 1, uint16((getLevel() - 1) * 5) }), maxValue);
else if (skillId == SKILL_FIST_WEAPONS)
skillValue = std::max<uint16>(1, GetSkillValue(SKILL_UNARMED));
else if (skillId == SKILL_LOCKPICKING)
skillValue = std::max<uint16>(1, GetSkillValue(SKILL_LOCKPICKING));
SetSkill(skillId, 0, skillValue, maxValue);
break;