Package lineage2.gameserver.model

Examples of lineage2.gameserver.model.Spawner


  @Override
  public String onTalk(NpcInstance npc, QuestState st)
  {
    String htmltext = "noquest";
    int npcId = npc.getNpcId();
    Player player = st.getPlayer();
    int cond = st.getCond();
    if (npcId == TEPIOS)
    {
      if (cond == 0)
      {
        if (player.getLevel() >= 75)
        {
          if ((st.getQuestItemsCount(MARK_OF_KEUCEREUS_STAGE_1) > 0) || (st.getQuestItemsCount(MARK_OF_KEUCEREUS_STAGE_2) > 0))
          {
            htmltext = "tepios_q696_1.htm";
          }
View Full Code Here


    @Override
    public void onZoneEnter(Zone zone, Creature cha)
    {
      if (cha.isPlayer())
      {
        Player player = cha.getPlayer();
        if (!player.getVarB("@ti_present_video"))
        {
          QuestState qs = player.getQuestState(_10320_LetsGototheCentralSquare.class);
          if ((qs != null) && (qs.getCond() == 1))
          {
            player.showQuestMovie(SceneMovie.si_illusion_02_que);
          }
          else
          {
            player.showQuestMovie(SceneMovie.si_illusion_01_que);
          }
          player.setVar("@ti_present_video", "true", -1);
        }
      }
    }
View Full Code Here

    }
    final int s_energy_wave = 20;
    final int s_earth_quake = 20;
    final int s_group_hold = (actor.getCurrentHpPercents() > 50) ? 0 : 20;
    final int s_thunderbolt = (actor.getCurrentHpPercents() > 25) ? 0 : 20;
    Skill r_skill = null;
    if (actor.isMovementDisabled())
    {
      r_skill = thunderbolt;
    }
    else if (!Rnd.chance(100 - s_thunderbolt - s_group_hold - s_energy_wave - s_earth_quake))
    {
      final Map<Skill, Integer> d_skill = new HashMap<>();
      final double distance = actor.getDistance(target);
      addDesiredSkill(d_skill, target, distance, energy_wave);
      addDesiredSkill(d_skill, target, distance, earth_quake);
      if (s_group_hold > 0)
      {
        addDesiredSkill(d_skill, target, distance, group_hold);
      }
      if (s_thunderbolt > 0)
      {
        addDesiredSkill(d_skill, target, distance, thunderbolt);
      }
      r_skill = selectTopSkill(d_skill);
    }
    if (r_skill == null)
    {
      r_skill = baium_normal_attack;
    }
    else if (r_skill.getTargetType() == Skill.SkillTargetType.TARGET_SELF)
    {
      target = actor;
    }
    addTaskCast(target, r_skill);
    r_skill = null;
View Full Code Here

    for (Creature cha : around)
    {
      if (cha.isPlayer() && !cha.isDead() && Rnd.chance(SKILL_CHANCE))
      {
        int rnd = Rnd.get(SKILLS.length);
        Skill skill = SkillTable.getInstance().getInfo(SKILLS[rnd][0], SKILLS[rnd][1]);
        if (skill != null)
        {
          skill.getEffects(cha, cha, false, false);
        }
      }
    }
  }
View Full Code Here

      {
        final int level = effect.get(0).getSkill().getLevel();
        if (level < 10)
        {
          effect.get(0).exit();
          final Skill skill = SkillTable.getInstance().getInfo(DeBuff, level + 1);
          skill.getEffects(actor, attacker, false, false);
        }
      }
      else
      {
        final Skill skill = SkillTable.getInstance().getInfo(DeBuff, 1);
        if (skill != null)
        {
          skill.getEffects(actor, attacker, false, false);
        }
        else
        {
          System.out.println("Skill " + DeBuff + " is null, fix it.");
        }
View Full Code Here

  protected void onEvtAttacked(Creature attacker, int damage)
  {
    final NpcInstance actor = getActor();
    if ((attacker != null) && attacker.isPlayer())
    {
      final Skill skill = SkillTable.getInstance().getInfo(5423, 12);
      skill.getEffects(actor, attacker, false, false);
      return;
    }
    if (attacker.isPet())
    {
      super.onEvtAttacked(attacker, damage);
View Full Code Here

  protected void onEvtAggression(Creature attacker, int aggro)
  {
    final NpcInstance actor = getActor();
    if ((attacker != null) && attacker.isPlayer())
    {
      final Skill skill = SkillTable.getInstance().getInfo(5423, 12);
      skill.getEffects(actor, attacker, false, false);
      return;
    }
  }
View Full Code Here

              }
            }
          }
          for (NpcInstance work : works)
          {
            Spawner spawn = work.getSpawn();
            if (spawn == null)
            {
              continue;
            }
            spawn.decreaseScheduledCount();
            if (spawn.isDoRespawn())
            {
              spawn.respawnNpc(work);
            }
          }
        }
        catch (Exception e)
        {
View Full Code Here

    List<CMGSiegeClanObject> attackers = miniGameEvent.getObjects(SiegeEvent.ATTACKERS);
    int index = attackers.indexOf(_winner);
    String arenaName = "arena_" + index;
    miniGameEvent.spawnAction(arenaName, false);
    SpawnExObject spawnEx = miniGameEvent.getFirstObject(arenaName);
    Spawner spawner = spawnEx.getSpawns().get(0);
    Location loc = (Location) spawner.getCurrentSpawnRange();
    miniGameEvent.removeBanishItems();
    final NpcInstance npc = NpcUtils.spawnSingle(35600, loc.x, loc.y, loc.z, 0);
    ThreadPoolManager.getInstance().schedule(new RunnableImpl()
    {
      @Override
View Full Code Here

   * Method updateStatusDb.
   * @param id int
   */
  private void updateStatusDb(int id)
  {
    Spawner spawner = _spawntable.get(id);
    if (spawner == null)
    {
      return;
    }
    StatsSet info = _storedInfo.get(id);
    if (info == null)
    {
      _storedInfo.put(id, info = new StatsSet());
    }
    NpcInstance raidboss = spawner.getFirstSpawned();
    if (raidboss instanceof ReflectionBossInstance)
    {
      return;
    }
    if (raidboss != null)
    {
      info.set("current_hp", raidboss.getCurrentHp());
      info.set("current_mp", raidboss.getCurrentMp());
      info.set("respawn_delay", 0);
    }
    else
    {
      info.set("current_hp", 0);
      info.set("current_mp", 0);
      info.set("respawn_delay", spawner.getRespawnTime());
    }
    Connection con = null;
    PreparedStatement statement = null;
    try
    {
View Full Code Here

TOP

Related Classes of lineage2.gameserver.model.Spawner

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.