Exemplo n.º 1
0
 @Override
 protected void onEvtScriptEvent(String event, Object arg1, Object arg2) {
   super.onEvtScriptEvent(event, arg1, arg2);
   if (event.equalsIgnoreCase("TEREDOR_DIE")) {
     diedTeredor++;
   }
 }
Exemplo n.º 2
0
 @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);
         }
       }
     }
   }
 }
Exemplo n.º 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);
  }
Exemplo n.º 4
0
 @Override
 protected void onEvtDead(Creature killer) {
   _firstTimeAttacked = true;
   super.onEvtDead(killer);
 }
Exemplo n.º 5
0
 @Override
 protected void onEvtArrived() {
   startMoveTask();
   super.onEvtArrived();
 }