Ejemplo n.º 1
0
  /**
   * Modify current Intention and actions if the target is lost or dead.<br>
   * <br>
   * <B><U> Actions</U> : <I>If the target is lost or dead</I></B><br>
   * <br>
   * <li>Stop the actor auto-attack client side by sending Server->Client packet AutoAttackStop
   *     (broadcast)
   * <li>Stop the actor movement server side AND client side by sending Server->Client packet
   *     StopMove/StopRotation (broadcast)
   * <li>Set the Intention of this AbstractAI to AI_INTENTION_ACTIVE<br>
   *     <br>
   *     <B><U> Example of use </U> :</B><br>
   *     <br>
   * <li>L2PLayerAI, L2SummonAI<br>
   *     <br>
   *
   * @param target The targeted L2Object
   * @return True if the target is lost or dead (false if fakedeath)
   */
  protected boolean checkTargetLostOrDead(L2Character target) {
    if (target == null || target.isAlikeDead()) {
      // check if player is fakedeath
      if (target != null && target.isFakeDeath()) {
        target.stopFakeDeath(true);
        return false;
      }

      // Set the Intention of this AbstractAI to AI_INTENTION_ACTIVE
      setIntention(AI_INTENTION_ACTIVE);
      return true;
    }
    return false;
  }