I can't compile or anything on this computer, so can someone tell me if this would work properly?
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 = p.getCombat().getFightStyle();
/* Format: {id, anim} / {id, style1anim, style2anim} /
{id, style1anim, style2anim, style3anim} /
{id, style1anim, style2anim, style3anim, style4anim} */
final int[][] ATK_ANIM = {{11230, 582}, {868, 0x326}, {4718, 2067, 2066}, {11694, 7075, 7074, 7073, 7072}};
for(int i = 0; i < ATK_ANIM.length; i++) {
if(id == ATK_ANIM[i][0]) {
if(ATK_ANIM[i].length == 2)
return ATK_ANIM[i][1];
else if(ATK_ANIM[i].length > 2) {
if(fightStyle == 1)
return ATK_ANIM[i][1];
else if(fightStyle == 2 && ATK_ANIM[i].length > 3)
return ATK_ANIM[i][2];
else if(fightStyle == 3 && ATK_ANIM[i].length > 4)
return ATK_ANIM[i][3];
else
return ATK_ANIM[i][ATK_ANIM.length-1];
}
}
}
} catch(Exception e) {
return 451;
}
}