Range combat doesn't load
CombatFactory class:
Code:
public static CombatMethod getMethod(Character attacker) {
if (attacker.isPlayer()) {
Player p = attacker.getAsPlayer();
// Check if player is maging..
if (p.getCombat().getCastSpell() != null || p.getCombat().getAutocastSpell() != null) {
return MAGIC_COMBAT;
}
// Check special attacks..
if (p.getCombatSpecial() != null) {
if (p.isSpecialActivated()) {
return p.getCombatSpecial().getCombatMethod();
}
}
// Check if player is ranging..
if (p.getCombat().getRangedWeaponData() != null) {
return RANGED_COMBAT;
} else if(attacker.isNpc()) {
NPC npc = attacker.getAsNpc();
if(npc.getId() == 2918){
int rand = Misc.random(5);
switch(rand){
case 0:
npc.getDefinition().setAttackAnim(91);
break;
case 1:
npc.getDefinition().setAttackAnim(91);
break;
case 2:
npc.getDefinition().setAttackAnim(91);
break;
default:
npc.getDefinition().setAttackAnim(91);
break;
}
p.getPacketSender().sendMessage("Hi");
return MELEE_COMBAT;
}
This doesn't load whenever i'm fighting the id specified.
I still need this