fix(Core/Spells): basepoints of spell 'Pick Lock' being wrongly added to player's lockpicking skill when evaluating if a lock can be opened (#8072)

This commit is contained in:
Skjalf
2021-10-04 10:45:06 -03:00
committed by GitHub
parent de8d0b49f8
commit 99f8634361

View File

@@ -7832,8 +7832,11 @@ SpellCastResult Spell::CanOpenLock(uint32 effIndex, uint32 lockId, SkillType& sk
// skill bonus provided by casting spell (mostly item spells)
// add the effect base points modifier from the spell casted (cheat lock / skeleton key etc.)
if (m_spellInfo->Effects[effIndex].TargetA.GetTarget() == TARGET_GAMEOBJECT_ITEM_TARGET || m_spellInfo->Effects[effIndex].TargetB.GetTarget() == TARGET_GAMEOBJECT_ITEM_TARGET)
if ((m_spellInfo->Effects[effIndex].TargetA.GetTarget() == TARGET_GAMEOBJECT_ITEM_TARGET || m_spellInfo->Effects[effIndex].TargetB.GetTarget() == TARGET_GAMEOBJECT_ITEM_TARGET)
&& !m_spellInfo->IsAbilityOfSkillType(SKILL_LOCKPICKING))
{
skillValue += m_spellInfo->Effects[effIndex].CalcValue();
}
if (skillValue < reqSkillValue)
return SPELL_FAILED_LOW_CASTLEVEL;