forked from MagicBane/Server
animation combat cleanup
This commit is contained in:
@@ -476,114 +476,20 @@ public enum CombatManager {
|
|||||||
|
|
||||||
int token = 0;
|
int token = 0;
|
||||||
|
|
||||||
if (dpj != null)
|
if (dpj != null) {
|
||||||
token = (dpj.getPower() != null) ? dpj.getPower().getToken() : 0;
|
token = (dpj.getPower() != null) ? dpj.getPower().getToken() : 0;
|
||||||
|
|
||||||
if (token == 563721004) //kick animation
|
if (token == 563721004) //kick animation
|
||||||
return 79;
|
return 79;
|
||||||
|
}
|
||||||
|
|
||||||
if (wb == null)
|
if (wb == null)
|
||||||
return 75;
|
return 75;
|
||||||
|
|
||||||
ItemTemplate template = wb;
|
if(mainHand){
|
||||||
|
return wb.weapon_attack_anim_right.get(0)[0];
|
||||||
if (mainHand) {
|
} else{
|
||||||
if (template.weapon_attack_anim_right.size() > 0) {
|
return wb.weapon_attack_anim_left.get(0)[0];
|
||||||
|
|
||||||
int animation;
|
|
||||||
|
|
||||||
int random = ThreadLocalRandom.current().nextInt(template.weapon_attack_anim_right.size());
|
|
||||||
|
|
||||||
try {
|
|
||||||
animation = template.weapon_attack_anim_right.get(random)[0];
|
|
||||||
return animation;
|
|
||||||
} catch (Exception e) {
|
|
||||||
Logger.error(e.getMessage());
|
|
||||||
return template.weapon_attack_anim_right.get(0)[0];
|
|
||||||
}
|
|
||||||
|
|
||||||
} else if (template.weapon_attack_anim_left.size() > 0) {
|
|
||||||
|
|
||||||
int animation;
|
|
||||||
int random = ThreadLocalRandom.current().nextInt(template.weapon_attack_anim_left.size());
|
|
||||||
|
|
||||||
try {
|
|
||||||
animation = template.weapon_attack_anim_left.get(random)[0];
|
|
||||||
return animation;
|
|
||||||
} catch (Exception e) {
|
|
||||||
Logger.error(e.getMessage());
|
|
||||||
return template.weapon_attack_anim_right.get(0)[0];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (template.weapon_attack_anim_left.size() > 0) {
|
|
||||||
|
|
||||||
int animation;
|
|
||||||
int random = ThreadLocalRandom.current().nextInt(template.weapon_attack_anim_left.size());
|
|
||||||
|
|
||||||
try {
|
|
||||||
animation = template.weapon_attack_anim_left.get(random)[0];
|
|
||||||
return animation;
|
|
||||||
} catch (Exception e) {
|
|
||||||
Logger.error(e.getMessage());
|
|
||||||
return template.weapon_attack_anim_right.get(0)[0];
|
|
||||||
|
|
||||||
}
|
|
||||||
} else if (template.weapon_attack_anim_left.size() > 0) {
|
|
||||||
|
|
||||||
int animation;
|
|
||||||
int random = ThreadLocalRandom.current().nextInt(template.weapon_attack_anim_left.size());
|
|
||||||
|
|
||||||
try {
|
|
||||||
animation = template.weapon_attack_anim_left.get(random)[0];
|
|
||||||
return animation;
|
|
||||||
} catch (Exception e) {
|
|
||||||
Logger.error(e.getMessage());
|
|
||||||
return template.weapon_attack_anim_right.get(0)[0];
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
String required = template.item_skill_used;
|
|
||||||
String mastery = wb.item_skill_mastery_used;
|
|
||||||
|
|
||||||
if (required.equals("Unarmed Combat"))
|
|
||||||
return 75;
|
|
||||||
else if (required.equals("Sword")) {
|
|
||||||
|
|
||||||
if (ItemManager.isTwoHanded(template))
|
|
||||||
return 105;
|
|
||||||
else
|
|
||||||
return 98;
|
|
||||||
|
|
||||||
} else if (required.equals("Staff") || required.equals("Pole Arm")) {
|
|
||||||
return 85;
|
|
||||||
} else if (required.equals("Spear")) {
|
|
||||||
return 92;
|
|
||||||
} else if (required.equals("Hammer") || required.equals("Axe")) {
|
|
||||||
if (ItemManager.isTwoHanded(template)) {
|
|
||||||
return 105;
|
|
||||||
} else if (mastery.equals("Throwing")) {
|
|
||||||
return 115;
|
|
||||||
} else {
|
|
||||||
return 100;
|
|
||||||
}
|
|
||||||
} else if (required.equals("Dagger")) {
|
|
||||||
if (mastery.equals("Throwing")) {
|
|
||||||
return 117;
|
|
||||||
} else {
|
|
||||||
return 81;
|
|
||||||
}
|
|
||||||
} else if (required.equals("Crossbow")) {
|
|
||||||
return 110;
|
|
||||||
} else if (required.equals("Bow")) {
|
|
||||||
return 109;
|
|
||||||
} else if (ItemManager.isTwoHanded(template)) {
|
|
||||||
return 105;
|
|
||||||
} else {
|
|
||||||
return 100;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user