Package l2p.gameserver.model.instances

Examples of l2p.gameserver.model.instances.L2SiegeGuardInstance


  }

  @Override
  public void checkAggression(L2Character target)
  {
    L2SiegeGuardInstance actor = getActor();
    if(actor == null || target == null || !target.isPlayable() || !actor.isAutoAttackable(target))
    {
      return;
    }
    super.checkAggression(target);
  }
View Full Code Here


  }

  @Override
  protected void onEvtAttacked(L2Character attacker, int damage)
  {
    L2SiegeGuardInstance actor = getActor();
    if(actor != null && attacker != null && attacker.getPlayer() != null)
    {
      L2Clan clan = attacker.getPlayer().getClan();
      if(clan != null && SiegeManager.getSiege(actor, true) == clan.getSiege() && clan.isDefender())
      {
View Full Code Here

  }

  @Override
  protected void onEvtAggression(L2Character target, int aggro)
  {
    L2SiegeGuardInstance actor = getActor();
    if(actor != null && target != null && target.getPlayer() != null)
    {
      L2Player player = target.getPlayer();
      L2Clan clan = player.getClan();
      if(clan != null && SiegeManager.getSiege(actor, true) == clan.getSiege() && clan.isDefender())
      {
        return;
      }
      Castle castle = actor.getCastle();
      if(player.getTerritorySiege() > -1 && castle != null && player.getTerritorySiege() == castle.getId())
      {
        return;
      }
    }
View Full Code Here

    }
    else if(_globalAggro > 0)
    {
      _globalAggro--;
    }
    L2SiegeGuardInstance actor = getActor();
    if(actor == null || actor.isDead())
    {
      return true;
    }
    if(_def_think)
    {
      doTask();
      return true;
    }
    actor.setRunning();
    actor.setAttackTimeout(Long.MAX_VALUE);
    Location sloc = actor.getSpawnedLoc();
    int homeX = actor.getX() - sloc.x;
    int homeY = actor.getY() - sloc.y;
    // Проверка на расстояние до точки спауна
    if(homeX * homeX + homeY * homeY > 10000)
    {
      teleportHome(true);
      return true;
View Full Code Here

  }

  @Override
  protected void thinkAttack()
  {
    L2SiegeGuardInstance actor = getActor();
    if(actor == null)
    {
      return;
    }
    actor.setRunning();
    actor.setAttackTimeout(Long.MAX_VALUE);
    Location sloc = actor.getSpawnedLoc();
    int homeX = actor.getX() - sloc.x;
    int homeY = actor.getY() - sloc.y;
    // Проверка на расстояние до точки спауна
    if(homeX * homeX + homeY * homeY > 9000000)
    {
      teleportHome(true);
      return;
View Full Code Here

    super.thinkAttack();
  }

  private L2Character getMostHated()
  {
    L2SiegeGuardInstance actor = getActor();
    if(actor == null)
    {
      return null;
    }
    GArray<AggroInfo> aggroList = actor.getAggroList();
    AggroInfo mosthated1 = null;
    for(AggroInfo ai : aggroList)
    {
      if(mosthated1 == null || mosthated1.attacker == null)
      {
        mosthated1 = ai;
      }
      else if(ai.attacker != null && actor.getDistance(ai.attacker) < actor.getDistance(mosthated1.attacker))
      {
        mosthated1 = ai;
      }
    }
    AggroInfo mosthated2 = null;
View Full Code Here

  }

  @Override
  protected L2Character prepareTarget()
  {
    L2SiegeGuardInstance actor = getActor();
    if(actor == null)
    {
      return null;
    }
    // Новая цель исходя из агрессивности
View Full Code Here

TOP

Related Classes of l2p.gameserver.model.instances.L2SiegeGuardInstance

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.