示例#1
0
 @Override
 public void runImpl() {
   NpcInstance actor = getActor();
   int event_id = actor.getAISpawnParam();
   MonasteryFurnaceEvent furnace =
       EventHolder.getInstance().getEvent(EventType.MAIN_EVENT, event_id);
   furnace.spawnAction(MonasteryFurnaceEvent.PROTECTOR_ROOM, true);
 }
示例#2
0
  @Override
  protected void onEvtAttacked(Creature attacker, int damage) {
    NpcInstance actor = getActor();
    if (actor == null) {
      return;
    }

    int event_id = actor.getAISpawnParam();
    MonasteryFurnaceEvent furnace =
        EventHolder.getInstance().getEvent(EventType.MAIN_EVENT, event_id);

    if (_firstTimeAttacked && !furnace.isInProgress()) {
      _firstTimeAttacked = false;
      attacker.setTarget(null);
      actor.setTargetable(false, false);
      actor.setNpcState((byte) 1);
      Functions.npcShout(actor, NpcString.FURN1);
      furnace.registerActions();
      ThreadPoolManager.getInstance().schedule(new ScheduleTimerTask(), 15000);
    }

    super.onEvtAttacked(attacker, damage);
  }