Package net.sf.l2j.gameserver.templates

Examples of net.sf.l2j.gameserver.templates.L2Armor


    // Get highest ID of item in armor FastMap, then in weapon FastMap, and finally in etcitem FastMap
    for (Iterator<Integer> iter = _armors.keySet().iterator(); iter.hasNext();)
    {
      Integer id = iter.next();
      L2Armor item = _armors.get(id);
      if (item.getItemId() > highestId)
      {
        highestId = item.getItemId();
      }
    }
    for (Iterator<Integer> iter = _weapons.keySet().iterator(); iter.hasNext();)
    {

      Integer id = iter.next();
      L2Weapon item = _weapons.get(id);
      if (item.getItemId() > highestId)
      {
        highestId = item.getItemId();
      }
    }
    for (Iterator<Integer> iter = _etcItems.keySet().iterator(); iter.hasNext();)
    {
      Integer id = iter.next();
      L2EtcItem item = _etcItems.get(id);
      if (item.getItemId() > highestId)
      {
        highestId = item.getItemId();
      }
    }

    // Create a FastLookUp Table called _allTemplates of size : value of the highest item ID
    if (Config.DEBUG) _log.fine("highest item id used:" + highestId);
    _allTemplates = new L2Item[highestId +1];

    // Insert armor item in Fast Look Up Table
    for (Iterator<Integer> iter = _armors.keySet().iterator(); iter.hasNext();)
    {
      Integer id = iter.next();
      L2Armor item = _armors.get(id);
      assert _allTemplates[id.intValue()] == null;
      _allTemplates[id.intValue()] = item;
    }

    // Insert weapon item in Fast Look Up Table
View Full Code Here


    // armor resistances vs dagger. daggerWpnRes could also be used if a skill
    // was given to all classes. The values here try to be a compromise.
    // They were originally added in a late C4 rev (2289).
    if (target instanceof L2PcInstance)
    {
      L2Armor armor = ((L2PcInstance)target).getActiveChestArmorItem();
      if (armor != null)
      {
        if(((L2PcInstance)target).isWearingHeavyArmor())
          damage /= 1.2; // 2
        //if(((L2PcInstance)target).isWearingLightArmor())
View Full Code Here

    }

    private void makeItem()
    {
        if (_currentItem.item != null) return;
        if (_currentItem.type instanceof L2ArmorType) _currentItem.item = new L2Armor(
            (L2ArmorType) _currentItem.type, _currentItem.set);
        else if (_currentItem.type instanceof L2WeaponType) _currentItem.item = new L2Weapon(
            (L2WeaponType) _currentItem.type, _currentItem.set);
        else if (_currentItem.type instanceof L2EtcItemType) _currentItem.item = new L2EtcItem(
            (L2EtcItemType) _currentItem.type, _currentItem.set);
View Full Code Here

TOP

Related Classes of net.sf.l2j.gameserver.templates.L2Armor

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.