mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-13 09:17:18 +00:00
fix(Core/GO): failed attempt (#4036)
Co-authored-by: Yehonal <yehonal.azeroth@gmail.com>
This commit is contained in:
@@ -5925,12 +5925,6 @@ SpellCastResult Spell::CheckCast(bool strict)
|
||||
if (ReqValue > skillValue)
|
||||
return SPELL_FAILED_LOW_CASTLEVEL;
|
||||
|
||||
// chance for fail at orange skinning attempt
|
||||
if ((m_selfContainer && (*m_selfContainer) == this) &&
|
||||
skillValue < sWorld->GetConfigMaxSkillValue() &&
|
||||
(ReqValue < 0 ? 0 : ReqValue) > irand(skillValue - 25, skillValue + 37))
|
||||
return SPELL_FAILED_TRY_AGAIN;
|
||||
|
||||
break;
|
||||
}
|
||||
case SPELL_EFFECT_OPEN_LOCK:
|
||||
@@ -5992,15 +5986,15 @@ SpellCastResult Spell::CheckCast(bool strict)
|
||||
if (res != SPELL_CAST_OK)
|
||||
return res;
|
||||
|
||||
// chance for fail at orange mining/herb/LockPicking gathering attempt
|
||||
// chance for fail at lockpicking attempt
|
||||
// second check prevent fail at rechecks
|
||||
if (skillId != SKILL_NONE && (!m_selfContainer || ((*m_selfContainer) != this)))
|
||||
{
|
||||
bool canFailAtMax = skillId != SKILL_HERBALISM && skillId != SKILL_MINING;
|
||||
|
||||
// chance for failure in orange gather / lockpick (gathering skill can't fail at maxskill)
|
||||
if ((canFailAtMax || skillValue < sWorld->GetConfigMaxSkillValue()) && reqSkillValue > irand(skillValue - 25, skillValue + 37))
|
||||
// chance for failure in orange lockpick
|
||||
if (skillId == SKILL_LOCKPICKING && reqSkillValue > irand(skillValue - 25, skillValue + 37))
|
||||
{
|
||||
return SPELL_FAILED_TRY_AGAIN;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user