Ejemplo n.º 1
0
  /**
   * Modify current Intention and actions if the target is lost.<br>
   * <br>
   * <B><U> Actions</U> : <I>If the target is lost</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
   */
  protected boolean checkTargetLost(L2Object target) {
    // check if player is fakedeath
    if (target instanceof L2Player) {
      L2Player target2 = (L2Player) target; // convert object to chara

      if (target2.isFakeDeath()) {
        target2.stopFakeDeath(true);
        return false;
      }
    }
    if (target == null) {
      // Set the Intention of this AbstractAI to AI_INTENTION_ACTIVE
      setIntention(AI_INTENTION_ACTIVE);
      return true;
    }
    return false;
  }