Examples of NpcInstance


Examples of lineage2.gameserver.model.instances.NpcInstance

    return startAttack();
  }

  private boolean startAttack()
  {
    NpcInstance actor = getActor();
    if(target == null)
    {
      List<NpcInstance> around = actor.getAroundNpc(3000, 150);
      if(around != null && !around.isEmpty())
      {
        for(NpcInstance npc : around)
        {
          if(checkTarget(npc))
          {
            if(target == null || actor.getDistance3D(npc) < actor.getDistance3D(target))
              target = npc;
          }
        }
      }
    }

    if(target != null && !actor.isAttackingNow() && !actor.isCastingNow() && !target.isDead() && GeoEngine.canSeeTarget(actor, target, false) && target.isVisible())
    {
      actor.getAI().notifyEvent(CtrlEvent.EVT_AGGRESSION, target, 1);
      return true;
    }

    if(target != null && (!target.isVisible() || target.isDead() || !GeoEngine.canSeeTarget(actor, target, false)))
    {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.