|
|
@ -982,66 +982,66 @@ public enum CombatManager { |
|
|
|
if (wb == null) |
|
|
|
if (wb == null) |
|
|
|
return 75; |
|
|
|
return 75; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ItemTemplate template = ItemTemplate.itemTemplates.get(wb.getUUID()); |
|
|
|
|
|
|
|
|
|
|
|
if (mainHand) { |
|
|
|
if (mainHand) { |
|
|
|
if (wb.getAnimations().size() > 0) { |
|
|
|
if (template.weapon_attack_anim_right.size() > 0) { |
|
|
|
|
|
|
|
|
|
|
|
int animation; |
|
|
|
int animation; |
|
|
|
|
|
|
|
|
|
|
|
int random = ThreadLocalRandom.current().nextInt(wb.getAnimations().size()); |
|
|
|
int random = ThreadLocalRandom.current().nextInt(template.weapon_attack_anim_right.size()); |
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
try { |
|
|
|
animation = wb.getAnimations().get(random); |
|
|
|
animation = template.weapon_attack_anim_right.get(random)[0]; |
|
|
|
return animation; |
|
|
|
return animation; |
|
|
|
} catch (Exception e) { |
|
|
|
} catch (Exception e) { |
|
|
|
Logger.error(e.getMessage()); |
|
|
|
Logger.error(e.getMessage()); |
|
|
|
return wb.getAnimations().get(0); |
|
|
|
return template.weapon_attack_anim_right.get(0)[0]; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} else if (wb.getOffHandAnimations().size() > 0) { |
|
|
|
} else if (template.weapon_attack_anim_left.size() > 0) { |
|
|
|
|
|
|
|
|
|
|
|
int animation; |
|
|
|
int animation; |
|
|
|
int random = ThreadLocalRandom.current().nextInt(wb.getOffHandAnimations().size()); |
|
|
|
int random = ThreadLocalRandom.current().nextInt(template.weapon_attack_anim_left.size()); |
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
try { |
|
|
|
animation = wb.getOffHandAnimations().get(random); |
|
|
|
animation = template.weapon_attack_anim_left.get(random)[0]; |
|
|
|
return animation; |
|
|
|
return animation; |
|
|
|
} catch (Exception e) { |
|
|
|
} catch (Exception e) { |
|
|
|
Logger.error(e.getMessage()); |
|
|
|
Logger.error(e.getMessage()); |
|
|
|
return wb.getOffHandAnimations().get(0); |
|
|
|
return template.weapon_attack_anim_right.get(0)[0]; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
if (wb.getOffHandAnimations().size() > 0) { |
|
|
|
if (template.weapon_attack_anim_left.size() > 0) { |
|
|
|
int animation; |
|
|
|
int animation; |
|
|
|
int random = ThreadLocalRandom.current().nextInt(wb.getOffHandAnimations().size()); |
|
|
|
int random = ThreadLocalRandom.current().nextInt(template.weapon_attack_anim_left.size()); |
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
try { |
|
|
|
animation = wb.getOffHandAnimations().get(random); |
|
|
|
animation = template.weapon_attack_anim_left.get(random)[0]; |
|
|
|
return animation; |
|
|
|
return animation; |
|
|
|
} catch (Exception e) { |
|
|
|
} catch (Exception e) { |
|
|
|
Logger.error(e.getMessage()); |
|
|
|
Logger.error(e.getMessage()); |
|
|
|
return wb.getOffHandAnimations().get(0); |
|
|
|
return template.weapon_attack_anim_right.get(0)[0]; |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} else if (wb.getAnimations().size() > 0) { |
|
|
|
} else if (template.weapon_attack_anim_left.size() > 0) { |
|
|
|
|
|
|
|
|
|
|
|
int animation; |
|
|
|
int animation; |
|
|
|
int random = ThreadLocalRandom.current().nextInt(wb.getAnimations().size()); |
|
|
|
int random = ThreadLocalRandom.current().nextInt(template.weapon_attack_anim_left.size()); |
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
try { |
|
|
|
animation = wb.getAnimations().get(random); |
|
|
|
animation = template.weapon_attack_anim_left.get(random)[0]; |
|
|
|
return animation; |
|
|
|
return animation; |
|
|
|
} catch (Exception e) { |
|
|
|
} catch (Exception e) { |
|
|
|
Logger.error(e.getMessage()); |
|
|
|
Logger.error(e.getMessage()); |
|
|
|
return wb.getAnimations().get(0); |
|
|
|
return template.weapon_attack_anim_right.get(0)[0]; |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
ItemTemplate template = ItemTemplate.itemTemplates.get(wb.getUUID()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String required = template.item_skill_used; |
|
|
|
String required = template.item_skill_used; |
|
|
|
String mastery = wb.getMastery(); |
|
|
|
String mastery = wb.getMastery(); |
|
|
|
|
|
|
|
|
|
|
|