well here is, im using it on my serv and works perfectlly, try to rework for your core,
add this onSPawn
npc.broadcastPacket(new AutoAttackStart(npc.getObjectId()));
ThreadPoolManager.getInstance().scheduleAi(new AttackTask(npc, TARGET_ON_WHICH_YOUR_NPC ATTACKS), Rnd.get(10, 1000));
private static final class AttackTask implements Runnable
{
private final L2Npc _attacker;
private final L2Npc _target;
public AttackTask(L2Npc attacker, L2Npc target)
{
_attacker = attacker;
_target = target;
}
@Override
public void run()
{
Broadcast.toPlayer(new Attack(_attacker, _target, false, 0, true), _attacker.getInstanceId());
ThreadPoolManager.getInstance().scheduleAi(new AttackTask(_attacker, _target), 1500);
}
}