Originally Posted by
awesomenoob
Yes I tested the gfx and it's like fire,
Try changing this:
Code:
CycleEventHandler.getSingleton().addEvent(c, new CycleEvent() {
@Override
public void execute(CycleEventContainer container) {
NPCHandler.npcs[c.npcIndex].gfx100(1167);
NPCHandler.npcs[c.npcIndex].handleHitMask(damage, 0, 2);
NPCHandler.npcs[c.npcIndex].HP -= damage;
container.stop();
}
@Override
public void stop() {
}
}, 3);
}
}
To this:
Code:
CycleEventHandler.getSingleton().addEvent(c, new CycleEvent() {
@Override
public void execute(CycleEventContainer container) {
try {
NPCHandler.npcs[c.npcIndex].gfx100(1167);
NPCHandler.npcs[c.npcIndex].handleHitMask(damage, 0, 2);
NPCHandler.npcs[c.npcIndex].HP -= damage;
} catch (Exception e) {
System.out.println("Error handling Npc Gfx");
}
container.stop();
}
@Override
public void stop() {
}
}, 3);
}
}
And let me know if that solves your problem. The System.out.println("Error handling Npc Gfx") is not mandatory so you can remove if you would like, it's just a way to know when the error occurs.
You can also try this instead:
Code:
CycleEventHandler.getSingleton().addEvent(c, new CycleEvent() {
@Override
public void execute(CycleEventContainer container) {
if(c.npcIndex > 0) {
NPCHandler.npcs[c.npcIndex].gfx100(1167);
NPCHandler.npcs[c.npcIndex].handleHitMask(damage, 0, 2);
NPCHandler.npcs[c.npcIndex].HP -= damage;
}
container.stop();
}
@Override
public void stop() {
}
}, 3);
}
}