Code:
/**
* Get's The player's weapon animation
* @param p The source of the animation
*/
public static int getCombatAnim(Player p) {
try {
int id = p.getEquipment().get(Equipment.SLOT_WEAPON).getId();
int fightStyle = 1;
final int[][][] ATK_ANIM = {{{1307, 1309, 1311, 1313, 1314, 1315, 1317, 1319, 11694, 11696, 11698, 11700, 11730}, {7041, 7041, 7048, 7049}},
{{4151}, {1658, 1658, 1658}}, {{10887}, {5685, 5685, 5685, 5685}}, {{806, 807, 808, 809, 810, 811, 3093, 11230}, {582, 582, 582}},
{{863, 864, 865, 866, 867, 868, 869}, {0x326, 0x326, 0x326}}};
for(int i = 0; i < ATK_ANIM.length; i++) {
for(int f = 0; f < ATK_ANIM[i][0].length; f++) {
if(id == ATK_ANIM[i][0][f]) {
return ATK_ANIM[i][1][fightStyle-1];
}
}
}
return 451;
} catch(Exception e) {
return 451;
}
}
Usage: {{wep1, wep2}, {fightstyle1, fightstyle2, fightstyle 3, fightstyle4}}