Package l2p.gameserver.templates

Examples of l2p.gameserver.templates.L2Weapon


  /**
   * Returns true in case of fatal blow success
   */
  public static boolean calcBlow(L2Character activeChar, L2Character target,
      L2Skill skill) {
    L2Weapon weapon = activeChar.getActiveWeaponItem();
    double base_weapon_crit = weapon == null ? 4. : weapon.getCritical();
    double dex_bonus = DEXbonus[activeChar.getDEX()];
    double clamped_dz = Math.min(25,
        Math.max(-25, target.getZ() - activeChar.getZ()));
    double crit_height_bonus = 0.008 * clamped_dz + 1.1;
    double buffs_mult = activeChar.calcStat(Stats.FATALBLOW_RATE, target,
View Full Code Here


      super(Stats.POWER_ATTACK_RANGE, 0x20, null);
    }

    @Override
    public void calc(Env env) {
      L2Weapon weapon = env.character.getActiveWeaponItem();
      if (weapon != null) {
        env.value += weapon.getAttackRange();
      }
    }
View Full Code Here

            else if (enchlvl > 11)
                chance = 1;
            else {
                // Выборка базового шанса
                if (itemType == L2Item.TYPE2_WEAPON) {
                    L2Weapon wepToEnchant = (L2Weapon) itemToEnchant.getItem();
                    boolean magewep = itemType == L2Item.TYPE2_WEAPON && crystaltype.cry >= L2Item.CRYSTAL_C && wepToEnchant.getPDamage() - wepToEnchant.getMDamage() <= wepToEnchant.getPDamage() * 0.4;
                    chance = !magewep ? Config.ENCHANT_CHANCE_WEAPON_PVP : Config.ENCHANT_CHANCE_MAGE_WEAPON_PVP;

                    // Штраф на двуручное оружие(немагическое)
                    if (itemToEnchant.getItem().getBodyPart() == L2Item.SLOT_LR_HAND && itemToEnchant.getItem().getItemType() == L2Weapon.WeaponType.BLUNT && !magewep)
                        chance -= Config.ENCHANT_PENALTY_FOR_BLUNT;
View Full Code Here

    }
    _log.info("ItemTable: Loaded " + _etcItems.size() + " Items.");
    new File("log/game/unimplemented_sa.txt").delete();
    for(Entry<Integer, Item> e : weaponData.entrySet())
    {
      _weapons.put(e.getKey(), new L2Weapon((WeaponType) e.getValue().type, e.getValue().set));
    }
    _log.info("ItemTable: Loaded " + _weapons.size() + " Weapons.");
    buildFastLookupTable();
    _item_idx = new HashMap<Integer, Integer>();
    loadExtendedWeaponsTable();
View Full Code Here

      assert _allTemplates[id.intValue()] == null;
      _allTemplates[id.intValue()] = item;
    }
    for(Integer id : _weapons.keySet())
    {
      L2Weapon item = _weapons.get(id);
      assert _allTemplates[id.intValue()] == null;
      _allTemplates[id.intValue()] = item;
    }
    for(Integer id : _etcItems.keySet())
    {
View Full Code Here

      {
        player.sendPacket(Msg.YOU_CANT_FISH_HERE);
        return false;
      }
    }
    L2Weapon weaponItem = player.getActiveWeaponItem();
    if(weaponItem == null || weaponItem.getItemType() != WeaponType.ROD)
    {
      //Fishing poles are not installed
      player.sendPacket(Msg.FISHING_POLES_ARE_NOT_INSTALLED);
      return false;
    }
View Full Code Here

    {
      return;
    }
    L2Player player = (L2Player) playable;
    L2ItemInstance weaponInst = player.getActiveWeaponInstance();
    L2Weapon weaponItem = player.getActiveWeaponItem();
    int SoulshotId = item.getItemId();
    boolean isAutoSoulShot = false;
    L2Item itemTemplate = ItemTable.getInstance().getTemplate(item.getItemId());
    if(player.getAutoSoulShot().contains(SoulshotId))
    {
      isAutoSoulShot = true;
    }
    if(weaponInst == null)
    {
      if(!isAutoSoulShot)
      {
        player.sendPacket(Msg.CANNOT_USE_SPIRITSHOTS);
      }
      return;
    }
    // spiritshot is already active
    if(weaponInst.getChargedSpiritshot() != L2ItemInstance.CHARGED_NONE)
    {
      return;
    }
    int SpiritshotId = item.getItemId();
    int grade = weaponItem.getCrystalType().externalOrdinal;
    int soulSpiritConsumption = weaponItem.getSpiritShotCount();
    long count = item.getCount();
    if(soulSpiritConsumption == 0)
    {
      // Can't use Spiritshots
      if(isAutoSoulShot)
View Full Code Here

  {
    if(env.target == null)
    {
      return false;
    }
    L2Weapon item = env.target.getActiveWeaponItem();
    if(item == null)
    {
      return false;
    }
    return (item.getItemType().mask() & _weaponMask) != 0;
  }
View Full Code Here

TOP

Related Classes of l2p.gameserver.templates.L2Weapon

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.