public GuardiansSpawner(NpcInstance npc, QuestState st, int _count) {
      NpcTemplate template = NpcHolder.getInstance().getTemplate(Soul_of_Tree_Guardian);
      if (template == null) return;
      try {
        _spawn = new SimpleSpawner(template);
      } catch (Exception e) {
        e.printStackTrace();
      }
      for (int i = 0; i < _count; i++) {
        _spawn.setLoc(Location.findPointToStay(npc, 50, 200));
        _spawn.setHeading(Rnd.get(0, 0xFFFF));
        _spawn.setAmount(1);
        _spawn.doSpawn(true);

        agressor = st.getPlayer().getName();
        if (st.getPlayer().getSummonList().getPet() != null)
          agressors_pet = st.getPlayer().getSummonList().getPet().getName();
        if (st.getPlayer().getParty() != null) {
          agressors_party = new ArrayList<String>();
          for (Player _member : st.getPlayer().getParty().getPartyMembers())
            if (!_member.equals(st.getPlayer())) agressors_party.add(_member.getName());
        }
      }
      _spawn.stopRespawn();
      updateAgression();
    }
Exemple #2
0
 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();
 }
Exemple #3
0
  @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;
    }
  }