Package lineage2.gameserver.templates.npc

Examples of lineage2.gameserver.templates.npc.NpcTemplate


  /**
   * Method TakeAdventurersArmorCoupon.
   */
  public void TakeAdventurersArmorCoupon()
  {
    final Player player = getSelf();
    if (player == null)
    {
      return;
    }
    if (!Config.ALT_ALLOW_SHADOW_WEAPONS)
    {
      show(new CustomMessage("common.Disabled", player), player);
      return;
    }
    if ((player.getLevel() > 39) || (player.getClassLevel() > 2))
    {
      show("Your level is too high!", player);
      return;
    }
    if ((player.getLevel() < 20) || (player.getClassLevel() < 2))
    {
      show("Your level is too low!", player);
      return;
    }
    if (player.getVarB("newbiearmor"))
    {
      show("Your already got your newbie weapon!", player);
      return;
    }
    addItem(player, 7833, 1);
    player.setVar("newbiearmor", "true", -1);
  }
View Full Code Here


  /**
   * Method enter_dc.
   */
  public void enter_dc()
  {
    final Player player = getSelf();
    final NpcInstance npc = getNpc();
    if ((player == null) || (npc == null))
    {
      return;
    }
    if (!NpcInstance.canBypassCheck(player, npc))
    {
      return;
    }
    player.setVar("DCBackCoords", player.getLoc().toXYZString(), -1);
    player.teleToLocation(-114582, -152635, -6742);
  }
View Full Code Here

  /**
   * Method exit_dc.
   */
  public void exit_dc()
  {
    final Player player = getSelf();
    final NpcInstance npc = getNpc();
    if ((player == null) || (npc == null))
    {
      return;
    }
    if (!NpcInstance.canBypassCheck(player, npc))
    {
      return;
    }
    final String var = player.getVar("DCBackCoords");
    if ((var == null) || var.isEmpty())
    {
      player.teleToLocation(new Location(43768, -48232, -800), 0);
      return;
    }
    player.teleToLocation(Location.parseLoc(var), 0);
    player.unsetVar("DCBackCoords");
  }
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

    final int y = Integer.parseInt(param[1]);
    final int z = Integer.parseInt(param[2]);
    final int castleId = (param.length > 4) ? Integer.parseInt(param[3]) : 0;
    if (player.getReflection().isDefault())
    {
      final Castle castle = (castleId > 0) ? ResidenceHolder.getInstance().getResidence(Castle.class, castleId) : null;
      if ((castle != null) && castle.getSiegeEvent().isInProgress())
      {
        player.sendPacket(Msg.YOU_CANNOT_TELEPORT_TO_A_VILLAGE_THAT_IS_IN_A_SIEGE);
        return;
      }
    }
View Full Code Here

   * Method enter_dc.
   */
  public void enter_dc()
  {
    final Player player = getSelf();
    final NpcInstance npc = getNpc();
    if ((player == null) || (npc == null))
    {
      return;
    }
    if (!NpcInstance.canBypassCheck(player, npc))
View Full Code Here

   * Method exit_dc.
   */
  public void exit_dc()
  {
    final Player player = getSelf();
    final NpcInstance npc = getNpc();
    if ((player == null) || (npc == null))
    {
      return;
    }
    if (!NpcInstance.canBypassCheck(player, npc))
View Full Code Here

   * @return boolean
   */
  @Override
  protected boolean thinkActive()
  {
    final NpcInstance actor = getActor();
    if (actor == null)
    {
      return true;
    }
    for (Player player : World.getAroundPlayers(actor, 200, 200))
View Full Code Here

   * @param damage int
   */
  @Override
  protected void onEvtAttacked(Creature attacker, int damage)
  {
    final NpcInstance actor = getActor();
    if (_firstTimeAttacked)
    {
      _firstTimeAttacked = false;
      if (Rnd.chance(25))
      {
View Full Code Here

   * @param damage int
   */
  @Override
  protected void onEvtAttacked(Creature attacker, int damage)
  {
    final NpcInstance actor = getActor();
    if ((attacker == null) || (attacker.getPlayer() == null))
    {
      return;
    }
    if ((System.currentTimeMillis() - _lastAction) > 15000)
    {
      _lastAction = System.currentTimeMillis();
      Functions.npcSayCustomMessage(actor, "scripts.ai.FieldMachine." + actor.getNpcId());
      final List<NpcInstance> around = actor.getAroundNpc(1500, 300);
      if ((around != null) && !around.isEmpty())
      {
        for (NpcInstance npc : around)
        {
          if (npc.isMonster() && (npc.getNpcId() >= 22656) && (npc.getNpcId() <= 22659))
View Full Code Here

TOP

Related Classes of lineage2.gameserver.templates.npc.NpcTemplate

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.