private void startMoveTask() { NpcInstance npc = getActor(); _lastPoint++; if (_lastPoint >= _points.length) if (!npc.getReflection().isDefault()) { ((HeartInfinityDefence) npc.getReflection()).notifyWagonArrived(); npc.deleteMe(); return; } addTaskMove(Location.findPointToStay(_points[_lastPoint], 250, npc.getGeoIndex()), true); doTask(); }
@Override protected void onEvtAttacked(Creature attacker, int damage) { NpcInstance actor = getActor(); if (!_attacked) { for (int i = 0; i < 4; i++) { try { SimpleSpawner sp = new SimpleSpawner(NpcHolder.getInstance().getTemplate(18493)); sp.setLoc(Location.findPointToStay(actor, 150, 250)); sp.setReflection(actor.getReflection()); sp.doSpawn(true); sp.stopRespawn(); } catch (Exception e) { e.printStackTrace(); } } _attacked = true; } }