Examples of WeaponTemplate


Examples of lineage2.gameserver.templates.item.WeaponTemplate

            else
            {
              set.set("class", ItemTemplate.ItemClass.WEAPON);
            }
          }
          template = new WeaponTemplate(set);
        }
      }
      catch (Exception e)
      {
        warn("Fail create item: " + set.get("item_id"), e);
View Full Code Here

Examples of lineage2.gameserver.templates.item.WeaponTemplate

    Fishing fishing = player.getFishing();
    if ((fishing == null) || !fishing.isInCombat())
    {
      return;
    }
    WeaponTemplate weaponItem = player.getActiveWeaponItem();
    int SS = player.getChargedFishShot() ? 2 : 1;
    int pen = 0;
    double gradebonus = 1 + (weaponItem.getCrystalType().ordinal() * 0.1);
    int dmg = (int) (getPower() * gradebonus * SS);
    if (player.getSkillLevel(1315) < (getLevel() - 2))
    {
      player.sendPacket(Msg.SINCE_THE_SKILL_LEVEL_OF_REELING_PUMPING_IS_HIGHER_THAN_THE_LEVEL_OF_YOUR_FISHING_MASTERY_A_PENALTY_OF_S1_WILL_BE_APPLIED);
      pen = 50;
View Full Code Here

Examples of lineage2.gameserver.templates.item.WeaponTemplate

    if ((playable == null) || !playable.isPlayer())
    {
      return false;
    }
    final Player player = (Player) playable;
    final WeaponTemplate weaponItem = player.getActiveWeaponItem();
    final ItemInstance weaponInst = player.getActiveWeaponInstance();
    final int SoulshotId = item.getItemId();
    boolean isAutoSoulShot = false;
    if (player.getAutoSoulShot().contains(SoulshotId))
    {
      isAutoSoulShot = true;
    }
    if (weaponInst == null)
    {
      if (!isAutoSoulShot)
      {
        player.sendPacket(Msg.CANNOT_USE_SOULSHOTS);
      }
      return false;
    }
    if (weaponInst.getChargedSoulshot() != ItemInstance.CHARGED_NONE)
    {
      return false;
    }
    final int grade = weaponItem.getCrystalType().externalOrdinal;
    int soulShotConsumption = weaponItem.getSoulShotCount();
    if (soulShotConsumption == 0)
    {
      if (isAutoSoulShot)
      {
        player.removeAutoSoulShot(SoulshotId);
        player.sendPacket(new ExAutoSoulShot(SoulshotId, false), new SystemMessage(SystemMessage.THE_AUTOMATIC_USE_OF_S1_WILL_NOW_BE_CANCELLED).addItemName(SoulshotId));
        return false;
      }
      player.sendPacket(Msg.CANNOT_USE_SOULSHOTS);
      return false;
    }
    if (((grade == 0) && (SoulshotId != 5789) && (SoulshotId != 1835)) || ((grade == 1) && (SoulshotId != 1463) && (SoulshotId != 22082) && (SoulshotId != 13037)) || ((grade == 2) && (SoulshotId != 1464) && (SoulshotId != 22083) && (SoulshotId != 13045)) || ((grade == 3) && (SoulshotId != 1465) && (SoulshotId != 22084)) || ((grade == 4) && (SoulshotId != 1466) && (SoulshotId != 22085) && (SoulshotId != 13055)) || ((grade == 5) && (SoulshotId != 1467) && (SoulshotId != 22086)) || ((grade == 6) && (SoulshotId != 17754) && (SoulshotId != 33780)))
    {
      if (isAutoSoulShot)
      {
        return false;
      }
      player.sendPacket(Msg.SOULSHOT_DOES_NOT_MATCH_WEAPON_GRADE);
      return false;
    }
    if ((weaponItem.getItemType() == WeaponType.BOW) || (weaponItem.getItemType() == WeaponType.CROSSBOW))
    {
      final int newSS = (int) player.calcStat(Stats.SS_USE_BOW, soulShotConsumption, null, null);
      if ((newSS < soulShotConsumption) && Rnd.chance(player.calcStat(Stats.SS_USE_BOW_CHANCE, soulShotConsumption, null, null)))
      {
        soulShotConsumption = newSS;
View Full Code Here

Examples of lineage2.gameserver.templates.item.WeaponTemplate

    if (player.getAutoSoulShot().contains(FishshotId))
    {
      isAutoSoulShot = true;
    }
    final ItemInstance weaponInst = player.getActiveWeaponInstance();
    final WeaponTemplate weaponItem = player.getActiveWeaponItem();
    if ((weaponInst == null) || (weaponItem.getItemType() != WeaponType.ROD))
    {
      if (!isAutoSoulShot)
      {
        player.sendPacket(Msg.CANNOT_USE_SOULSHOTS);
      }
      return false;
    }
    if (weaponInst.getChargedFishshot())
    {
      return false;
    }
    if (item.getCount() < 1)
    {
      if (isAutoSoulShot)
      {
        player.removeAutoSoulShot(FishshotId);
        player.sendPacket(new ExAutoSoulShot(FishshotId, false), new SystemMessage(SystemMessage.THE_AUTOMATIC_USE_OF_S1_WILL_NOW_BE_CANCELLED).addString(item.getName()));
        return false;
      }
      player.sendPacket(Msg.NOT_ENOUGH_SPIRITSHOTS);
      return false;
    }
    final int grade = weaponItem.getCrystalType().externalOrdinal;
    if (((grade == 0) && (FishshotId != 6535)) || ((grade == 1) && (FishshotId != 6536)) || ((grade == 2) && (FishshotId != 6537)) || ((grade == 3) && (FishshotId != 6538)) || ((grade == 4) && (FishshotId != 6539)) || ((grade == 5) && (FishshotId != 6540)))
    {
      if (isAutoSoulShot)
      {
        return false;
View Full Code Here

Examples of lineage2.gameserver.templates.item.WeaponTemplate

   * @return int
   */
  @Override
  public int getRandomDamage()
  {
    WeaponTemplate weaponItem = getActiveWeaponItem();
    if (weaponItem == null)
    {
      return getTemplate().getBaseRandDam();
    }
    return weaponItem.getRandomDamage();
  }
View Full Code Here

Examples of lineage2.gameserver.templates.item.WeaponTemplate

    {
      return false;
    }
    final Player player = (Player) playable;
    final ItemInstance weaponInst = player.getActiveWeaponInstance();
    final WeaponTemplate weaponItem = player.getActiveWeaponItem();
    final int SoulshotId = item.getItemId();
    boolean isAutoSoulShot = false;
    if (player.getAutoSoulShot().contains(SoulshotId))
    {
      isAutoSoulShot = true;
    }
    if (weaponInst == null)
    {
      if (!isAutoSoulShot)
      {
        player.sendPacket(Msg.CANNOT_USE_SPIRITSHOTS);
      }
      return false;
    }
    if (weaponInst.getChargedSpiritshot() == ItemInstance.CHARGED_BLESSED_SPIRITSHOT)
    {
      return false;
    }
    final int spiritshotId = item.getItemId();
    final int grade = weaponItem.getCrystalType().externalOrdinal;
    final int blessedsoulSpiritConsumption = weaponItem.getSpiritShotCount();
    if (blessedsoulSpiritConsumption == 0)
    {
      if (isAutoSoulShot)
      {
        player.removeAutoSoulShot(SoulshotId);
View Full Code Here

Examples of lineage2.gameserver.templates.item.WeaponTemplate

    {
      return false;
    }
    final Player player = (Player) playable;
    final ItemInstance weaponInst = player.getActiveWeaponInstance();
    final WeaponTemplate weaponItem = player.getActiveWeaponItem();
    final int SoulshotId = item.getItemId();
    boolean isAutoSoulShot = false;
    if (player.getAutoSoulShot().contains(SoulshotId))
    {
      isAutoSoulShot = true;
    }
    if (weaponInst == null)
    {
      if (!isAutoSoulShot)
      {
        player.sendPacket(Msg.CANNOT_USE_SPIRITSHOTS);
      }
      return false;
    }
    if (weaponInst.getChargedSpiritshot() != ItemInstance.CHARGED_NONE)
    {
      return false;
    }
    final int SpiritshotId = item.getItemId();
    final int grade = weaponItem.getCrystalType().externalOrdinal;
    final int soulSpiritConsumption = weaponItem.getSpiritShotCount();
    final long count = item.getCount();
    if (soulSpiritConsumption == 0)
    {
      if (isAutoSoulShot)
      {
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.