Package lineage2.gameserver.model.instances

Examples of lineage2.gameserver.model.instances.NpcInstance


    {
      if (npdId == 32919)
      {
        if (skill == null)
        {
          NpcInstance ni = getReflection().addSpawnWithoutRespawn(little_simpleAttackMobs[Rnd.get(little_simpleAttackMobs.length)], getLoc(), 150);
          ni.getAI().Attack(attacker, true, false);
          this.decayMe();
          this.doDie(attacker);
        }
        else
        {
          NpcInstance ni = getReflection().addSpawnWithoutRespawn(little_skillAttackMobs[Rnd.get(little_skillAttackMobs.length)], getLoc(), 150);
          ni.getAI().Attack(attacker, true, false);
          this.decayMe();
          this.doDie(attacker);
        }
      }
      else if (skill == null)
      {
        for (int i = 0; i < 3; i++)
        {
          NpcInstance ni = getReflection().addSpawnWithoutRespawn(big_simpleAttackMobs[Rnd.get(big_simpleAttackMobs.length)], getLoc(), 150);
          ni.getAI().Attack(attacker, true, false);
        }
        this.decayMe();
        this.doDie(attacker);
      }
      else
      {
        for (int i = 0; i < 3; i++)
        {
          NpcInstance ni = getReflection().addSpawnWithoutRespawn(big_skillAttackMobs[Rnd.get(big_skillAttackMobs.length)], getLoc(), 150);
          ni.getAI().Attack(attacker, true, false);
        }
        this.decayMe();
        this.doDie(attacker);
     
      }
    }
    else if (npdId == 32919)
    {
      NpcInstance ni = getReflection().addSpawnWithoutRespawn(little_nightAttackMobs[Rnd.get(little_nightAttackMobs.length)], getLoc(), 150);
      ni.getAI().Attack(attacker, true, false);
      this.decayMe();
      this.doDie(attacker);
    }
    else
    {
      for (int i = 0; i < 3; i++)
      {
        NpcInstance ni = getReflection().addSpawnWithoutRespawn(big_nightAttackMobs[Rnd.get(big_nightAttackMobs.length)], getLoc(), 150);
        ni.getAI().Attack(attacker, true, false);
      }
      this.decayMe();
      this.doDie(attacker);
    }
  }
View Full Code Here


    public void runImpl() throws Exception
    {
      manageDamageZone(4, false);
      for(NpcInstance n : getNpcs())
        n.unblock();
      NpcInstance knightLeader = addSpawnWithoutRespawn(IceKnightLeaderNormal, new Location(114707, -114799, -11199, 15956), 0);
      knightLeader.addListener(_deathListener);
    }
View Full Code Here

   * @param damage int
   */
  @Override
  protected void onEvtAttacked(Creature attacker, int damage)
  {
    final NpcInstance actor = getActor();
    if ((System.currentTimeMillis() - lastFactionNotifyTime) > _minFactionNotifyInterval)
    {
      lastFactionNotifyTime = System.currentTimeMillis();
      for (NpcInstance npc : World.getAroundNpc(actor))
      {
View Full Code Here

      {
        p.sendPacket(new ExShowScreenMessage(NpcString.BEGIN_STAGE_3_FREYA, 6000, ScreenMessageAlign.TOP_CENTER, true, 1, -1, true));
        p.sendPacket(new ExChangeClientEffectInfo(2));
      }
      thirdStageGuardSpawn = ThreadPoolManager.getInstance().scheduleAtFixedRate(new GuardSpawnTask(3), 2000L, 30000L);
      NpcInstance freyaStand = addSpawnWithoutRespawn(FreyaStandNormal, new Location(114720, -117085, -11088, 15956), 0);
      freyaStand.addListener(_currentHpListener);
      freyaStand.addListener(_deathListener);
    }
View Full Code Here

   * @param damage int
   */
  @Override
  protected void onEvtAttacked(Creature attacker, int damage)
  {
    final NpcInstance actor = getActor();
    if (_notUsedUltimateDefense && (actor.getCurrentHpPercents() < 10))
    {
      _notUsedUltimateDefense = false;
      clearTasks();
      addTaskBuff(actor, ULTIMATE_DEFENSE_SKILL);
    }
View Full Code Here

   * @param killer Creature
   */
  @Override
  protected void onEvtDead(Creature killer)
  {
    final NpcInstance actor = getActor();
    _notUsedUltimateDefense = true;
    actor.getReflection().setReenterTime(System.currentTimeMillis());
    actor.getReflection().addSpawnWithoutRespawn(TELEPORTATION_CUBIC_ID, CUBIC_POSITION, 0);
    super.onEvtDead(killer);
  }
View Full Code Here

   * @return boolean
   */
  @Override
  protected boolean checkTarget(Creature target, int range)
  {
    final NpcInstance actor = getActor();
    if ((target != null) && !actor.isInRange(target, actor.getAggroRange()))
    {
      actor.getAggroList().remove(target, true);
      return false;
    }
    return super.checkTarget(target, range);
  }
View Full Code Here

   * @param damage int
   */
  @Override
  protected void onEvtAttacked(Creature attacker, int damage)
  {
    final NpcInstance actor = getActor();
    if ((actor.getCurrentHpPercents() < 70) && !summonsReleased)
    {
      summonsReleased = true;
      summon1 = NpcUtils.spawnSingle(18950, Location.findAroundPosition(actor, 150), actor.getReflection());
      summon2 = NpcUtils.spawnSingle(18951, Location.findAroundPosition(actor, 150), actor.getReflection());
    }
    super.onEvtAttacked(attacker, damage);
  }
View Full Code Here

    final Creature target = prepareTarget();
    if (target == null)
    {
      return false;
    }
    final NpcInstance actor = getActor();
    if (actor.isDead())
    {
      return false;
    }
    final double actor_hp_precent = actor.getCurrentHpPercents();
    switch (stage)
    {
      case 0:
        if (actor_hp_precent < 80)
        {
          spawnMobs();
          return true;
        }
        break;
      case 1:
        if (actor_hp_precent < 60)
        {
          spawnMobs();
          return true;
        }
        break;
      case 2:
        if (actor_hp_precent < 40)
        {
          spawnMobs();
          return true;
        }
        break;
      case 3:
        if (actor_hp_precent < 30)
        {
          spawnMobs();
          return true;
        }
        break;
      case 4:
        if (actor_hp_precent < 20)
        {
          spawnMobs();
          return true;
        }
        break;
      case 5:
        if (actor_hp_precent < 10)
        {
          spawnMobs();
          return true;
        }
        break;
      case 6:
        if (actor_hp_precent < 5)
        {
          spawnMobs();
          return true;
        }
        break;
    }
    final int rnd_per = Rnd.get(100);
    if (rnd_per < 5)
    {
      addTaskBuff(actor, Invincible);
      return true;
    }
    final double distance = actor.getDistance(target);
    if (!actor.isAMuted() && (rnd_per < 75))
    {
      return chooseTaskAndTargets(null, target, distance);
    }
    final Map<Skill, Integer> d_skill = new HashMap<>();
    addDesiredSkill(d_skill, target, distance, KechiDoubleCutter);
View Full Code Here

   * Method spawnMobs.
   */
  private void spawnMobs()
  {
    stage++;
    final NpcInstance actor = getActor();
    Functions.npcSay(actor, chat[Rnd.get(chat.length)]);
    for (int[] run : guard_run)
    {
      try
      {
        SimpleSpawner sp = new SimpleSpawner(NpcHolder.getInstance().getTemplate(run[0]));
        sp.setLoc(guard_spawn_loc);
        sp.setReflection(actor.getReflection());
        NpcInstance guard = sp.doSpawn(true);
        Location runLoc = new Location(run[1], run[2], run[3]);
        guard.setRunning();
        DefaultAI ai = (DefaultAI) guard.getAI();
        ai.addTaskMove(runLoc, true);
        ai.setGlobalAggro(0);
        Creature hated = actor.getAggroList().getRandomHated();
        if (hated != null)
        {
          guard.getAggroList().addDamageHate(hated, 0, Rnd.get(1, 100));
          ai.setAttackTimeout(getMaxAttackTimeout() + System.currentTimeMillis());
          ai.setAttackTarget(hated);
          ai.changeIntention(CtrlIntention.AI_INTENTION_ATTACK, hated, null);
          ai.addTaskAttack(hated);
        }
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.