Moved reference item check in skill mastery calculation.

This commit is contained in:
MobiusDevelopment
2019-10-29 09:32:53 +00:00
parent 4ee0ce7d76
commit 6072ca6a28
30 changed files with 210 additions and 60 deletions

View File

@@ -251,7 +251,7 @@ public class SkillCaster implements Runnable
int reuseDelay = caster.getStat().getReuseTime(_skill);
if (reuseDelay > 10)
{
if (Formulas.calcSkillMastery(caster, _skill) && !(_skill.getReferenceItemId() > 0))
if (Formulas.calcSkillMastery(caster, _skill))
{
reuseDelay = 100;
caster.sendPacket(SystemMessageId.A_SKILL_IS_READY_TO_BE_USED_AGAIN);

View File

@@ -943,10 +943,20 @@ public class Formulas
return false;
}
public static boolean calcSkillMastery(Creature actor, Skill sk)
public static boolean calcSkillMastery(Creature actor, Skill skill)
{
// Static Skills are not affected by Skill Mastery.
if (sk.isStatic() || !actor.isPlayer())
// Non players are not affected by Skill Mastery.
if (!actor.isPlayer())
{
return false;
}
// Static skills are not affected by Skill Mastery.
if (skill.isStatic())
{
return false;
}
// Item skills are not affected by Skill Mastery.
if (skill.getReferenceItemId() > 0)
{
return false;
}