Package lineage2.gameserver.model.instances

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


    for (SeedRegion sr : _regionsData)
    {
      NpcTemplate template = NpcHolder.getInstance().getTemplate(ANNIHILATION_FURNACE);
      for (int i = 0; i < sr.af_spawns.length; i++)
      {
        NpcInstance npc = template.getNewInstance();
        npc.setCurrentHpMp(npc.getMaxHp(), npc.getMaxMp());
        npc.spawnMe(new Location(sr.af_spawns[i][0], sr.af_spawns[i][1], sr.af_spawns[i][2], sr.af_spawns[i][3]));
        npc.setNpcState(sr.activeBuff);
        sr.af_npcs[i] = npc;
      }
      chanceZoneActive(sr.buff_zone_pc[sr.activeBuff - 1], true);
      chanceZoneActive(sr.buff_zone_npc[sr.activeBuff - 1], true);
    }
View Full Code Here

    return startAttack();
  }

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

    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

    {
      addSpawnWithoutRespawn(KartiaWatchman, new Location(-110648, -10424, -11891), 0);
      addSpawnWithoutRespawn(KartiaWatchman, new Location(-110664, -10520, -11888), 0);
      addSpawnWithoutRespawn(KartiaWatchman, new Location(-110664, -10472, -11883), 0);
      addSpawnWithoutRespawn(KartiaWatchman, new Location(-110664, -10360, -11883), 0);
      NpcInstance sixstagestagemobv = addSpawnWithoutRespawn(DimensionalWatchman, new Location(-110664, -10360, -11883), 0);
      sixstagestagemobv.addListener(_deathListener);
    }
View Full Code Here

    if(target.isPlayer())
      return true;
     
    if(target.isNpc())
    {
      NpcInstance npc = (NpcInstance) target;
      int _id = npc.getNpcId();
     
      if(_id == 27430 || _id == 27431 || _id == 27432 || _id == 27433 || _id == 27434 || _id == 27425 || _id == 33416)
        return false;     
    }
    return true;
View Full Code Here

  }

  @Override
  protected boolean thinkActive()
  {
    NpcInstance actor = getActor();
   
    if(Rnd.chance(3))
      Functions.npcSay(actor, NpcString.DID_SOMEONE_CRY_MEDIC_HERE_BE_HEALED);       
    return startAttack();
  }
View Full Code Here

    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

   * @return boolean
   */
  @Override
  protected boolean thinkActive()
  {
    final NpcInstance actor = getActor();
    final Creature following = actor.getFollowTarget();
    if ((following == null) || !actor.isFollow)
    {
      final Player master = getMaster();
      if (master != null)
      {
        actor.setFollowTarget(master);
        actor.setRunning();
        actor.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, master, Config.FOLLOW_RANGE);
      }
    }
    super.thinkActive();
    return false;
  }
View Full Code Here

   * Method onEvtThink.
   */
  @Override
  protected void onEvtThink()
  {
    final NpcInstance actor = getActor();
    if (_thinking || actor.isActionsDisabled() || actor.isAfraid() || actor.isDead() || actor.isMovementDisabled())
    {
      return;
    }
    _thinking = true;
    try
View Full Code Here

  }

  @Override
  protected boolean thinkActive()
  {
    NpcInstance actor = getActor();
   
    if(Rnd.chance(3))
    {
      switch(actor.getNpcId())
      {
        case 33172:
          Functions.npcSay(actor, NpcString.THE_ONLY_GOOD_SHILEN_CREATURE_IS_A_DEAD_ONE)
          break;
        case 33170
View Full Code Here

TOP

Related Classes of lineage2.gameserver.model.instances.NpcInstance

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.