AutoUseTaskManager should take in consideration abnormal type.

Contributed by Index.
This commit is contained in:
MobiusDevelopment
2022-04-08 22:02:08 +00:00
parent 44b198a652
commit aaccf247b5
10 changed files with 40 additions and 10 deletions

View File

@ -379,7 +379,10 @@ public class AutoUseTaskManager implements Runnable
}
final BuffInfo buffInfo = playableTarget.getEffectList().getBuffInfoBySkillId(skill.getId());
return (buffInfo == null) || (buffInfo.getTime() <= REUSE_MARGIN_TIME) || (buffInfo.getSkill().getLevel() < skill.getLevel());
final BuffInfo abnormalBuffInfo = playableTarget.getEffectList().getFirstBuffInfoByAbnormalType(skill.getAbnormalType());
return ((buffInfo == null) && (abnormalBuffInfo == null)) //
|| ((buffInfo != null) && (abnormalBuffInfo.getSkill().getId() == buffInfo.getSkill().getId()) && ((buffInfo.getTime() <= REUSE_MARGIN_TIME) || (buffInfo.getSkill().getLevel() < skill.getLevel()))) //
|| (abnormalBuffInfo.getSkill().getAbnormalLevel() < skill.getAbnormalLevel());
}
private boolean canUseMagic(Player player, WorldObject target, Skill skill)