@Override
 protected void onEvtScriptEvent(String event, Object arg1, Object arg2) {
   super.onEvtScriptEvent(event, arg1, arg2);
   if (event.equalsIgnoreCase("TEREDOR_DIE")) {
     diedTeredor++;
   }
 }
 @Override
 protected void onEvtThink() {
   super.onEvtThink();
   if (!getActor().getAggroList().isEmpty()) {
     List<Creature> chars = World.getAroundCharacters(getActor());
     CollectionUtils.eqSort(chars, _nearestTargetComparator);
     for (Creature cha : chars) {
       if (getActor().getAggroList().get(cha) != null && checkAggression(cha)) {
         Skill sk = SkillTable.getInstance().getInfo(SKILL_ID, 1);
         if (lastCastTime + sk.getHitTime() + sk.getReuseDelay() <= System.currentTimeMillis()) {
           lastCastTime = System.currentTimeMillis();
           addTaskCast(cha, sk);
         }
       }
     }
   }
 }
Example #3
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);
  }
Example #4
0
 @Override
 protected void onEvtDead(Creature killer) {
   _firstTimeAttacked = true;
   super.onEvtDead(killer);
 }
Example #5
0
 @Override
 protected void onEvtArrived() {
   startMoveTask();
   super.onEvtArrived();
 }