Package com.l2jfrozen.gameserver.templates

Examples of com.l2jfrozen.gameserver.templates.L2Item


      {
        RewardItem item = new RewardItem(drop.items[Rnd.get(drop.items.length)], Rnd.get(drop.min, drop.max));

        if(Config.AUTO_LOOT)
        {
          L2Item item_templ = ItemTable.getInstance().getTemplate(item.getItemId());
         
          if(!player.getInventory().validateCapacity(item_templ))
            DropItem(player, item);
          else
            player.doAutoLoot(this, item); // Give this or these Item(s) to the L2PcInstance that has killed the L2Attackable
View Full Code Here


    return crops;
  }

  public int getSeedBasicPrice(int seedId)
  {
    L2Item seedItem = ItemTable.getInstance().getTemplate(seedId);

    if(seedItem != null)
      return seedItem.getReferencePrice();
    return 0;
  }
View Full Code Here

    return 0;
  }

  public int getCropBasicPrice(int cropId)
  {
    L2Item cropItem = ItemTable.getInstance().getTemplate(cropId);

    if(cropItem != null)
      return cropItem.getReferencePrice();
    return 0;
  }
View Full Code Here

  {
    int tradeListID = Integer.parseInt(args[1]);
    int itemID = Integer.parseInt(args[2]);

    L2TradeList tradeList = TradeController.getInstance().getBuyList(tradeListID);
    L2Item item = ItemTable.getInstance().getTemplate(itemID);

    if(tradeList.getPriceForItemId(itemID) < 0)
      return;

    if(args.length > 3)
    {
      int price = Integer.parseInt(args[3]);
      int order = findOrderTradeList(itemID, tradeList.getPriceForItemId(itemID), tradeListID);

      tradeList.replaceItem(itemID, Integer.parseInt(args[3]));
      updateTradeList(itemID, price, tradeListID, order);

      activeChar.sendMessage("Updated price for " + item.getName() + " in Trade List " + tradeListID);
      showShopList(activeChar, tradeListID, 1);
      return;
    }

    NpcHtmlMessage adminReply = new NpcHtmlMessage(5);

    TextBuilder replyMSG = new TextBuilder();
    replyMSG.append("<html><title>Merchant Shop Item Edit</title>");
    replyMSG.append("<body>");
    replyMSG.append("<br>Edit an entry in merchantList.");
    replyMSG.append("<br>Editing Item: " + item.getName());
    replyMSG.append("<table>");
    replyMSG.append("<tr><td width=100>Property</td><td width=100>Edit Field</td><td width=100>Old Value</td></tr>");
    replyMSG.append("<tr><td><br></td><td></td></tr>");
    replyMSG.append("<tr><td>Price</td><td><edit var=\"price\" width=80></td><td>" + tradeList.getPriceForItemId(itemID) + "</td></tr>");
    replyMSG.append("</table>");
View Full Code Here

    TextBuilder replyMSG = new TextBuilder("<html><title>NPC: " + npcData.name + "(" + npcData.npcId + ") 's drop manage</title>");
    replyMSG.append("<body>");
    replyMSG.append("<br>Notes: click[drop_id]to show the detail of drop data,click[del] to delete the drop data!");
    replyMSG.append("<table>");
    replyMSG.append("<tr><td>npc_id itemId category</td><td>item[id]</td><td>type</td><td>del</td></tr>");
    L2Item itemTemplate;
    for(L2DropCategory cat : npcData.getDropData())
    {
      for(L2DropData drop : cat.getAllDrops())
      {
        itemTemplate = ItemTable.getInstance().getTemplate(drop.getItemId());
        if (itemTemplate == null)
        {
          _log.warning(getClass().getSimpleName() + ": Unkown item Id: " + drop.getItemId() + " for NPC: " + npcData.npcId);
          continue;
        }
        replyMSG.append("<tr><td><a action=\"bypass -h admin_edit_drop " + npcData.npcId + " " + drop.getItemId() + " " + cat.getCategoryType() + "\">" + npcData.npcId + " " + drop.getItemId() + " " + cat.getCategoryType() + "</a></td>" + "<td>" + itemTemplate.getName() + "[" + drop.getItemId() + "]" + "</td><td>" + (drop.isQuestDrop() ? "Q" : cat.isSweep() ? "S" : "D") + "</td><td>" + "<a action=\"bypass -h admin_del_drop " + npcData.npcId + " " + drop.getItemId() + " " + cat.getCategoryType() + "\">del</a></td></tr>");
      }
    }

    npcData = null;
View Full Code Here

                                continue; // Do not yet add this adena amount to the list as taxIngredient adena might be entered later (order not guaranteed)
                        }
                        // If it is an armor/weapon, modify the enchantment level appropriately, if necessary
                        else if (maintainEnchantment)
                        {
                                L2Item tempItem = ItemTable.getInstance().createDummyItem(newIngredient.getItemId()).getItem();
                                if (tempItem instanceof L2Armor || tempItem instanceof L2Weapon)
                                {
                                        newIngredient.setEnchantmentLevel(enchantLevel);
                                        hasIngredient = true;
                                }
                        }

                        // finally, add this ingredient to the entry
                        newEntry.addIngredient(newIngredient);
                }
                // Next add the adena amount, if any
                if (totalAdenaCount > 0)
                {
                        newEntry.addIngredient(new MultiSellIngredient(57, totalAdenaCount, false, false));
                }

                // Now modify the enchantment level of products, if necessary
                for (MultiSellIngredient ing : templateEntry.getProducts())
                {
                        // Load the ingredient from the template
                        MultiSellIngredient newIngredient = new MultiSellIngredient(ing);

                        if (maintainEnchantment && hasIngredient)
                        {
                                // If it is an armor/weapon, modify the enchantment level appropriately
                                // (note, if maintain enchantment is "false" this modification will result to a +0)
                                L2Item tempItem = ItemTable.getInstance().createDummyItem(newIngredient.getItemId()).getItem();

                                if (tempItem instanceof L2Armor || tempItem instanceof L2Weapon)
                                {
                                        if (enchantLevel==0 && maintainEnchantment)
                                                enchantLevel = ing.getEnchantmentLevel();
View Full Code Here

  {
    L2Weapon weaponItem = null;
    if(classId >= 0x00 && classId <= 0x09)
    {
      //human fighter fists
      L2Item temp = ItemTable.getInstance().getTemplate(246);
      weaponItem = (L2Weapon) temp;
      temp = null;
    }
    else if(classId >= 0x0a && classId <= 0x11)
    {
      //human mage fists
      L2Item temp = ItemTable.getInstance().getTemplate(251);
      weaponItem = (L2Weapon) temp;
      temp = null;
    }
    else if(classId >= 0x12 && classId <= 0x18)
    {
      //elven fighter fists
      L2Item temp = ItemTable.getInstance().getTemplate(244);
      weaponItem = (L2Weapon) temp;
      temp = null;
    }
    else if(classId >= 0x19 && classId <= 0x1e)
    {
      //elven mage fists
      L2Item temp = ItemTable.getInstance().getTemplate(249);
      weaponItem = (L2Weapon) temp;
      temp = null;
    }
    else if(classId >= 0x1f && classId <= 0x25)
    {
      //dark elven fighter fists
      L2Item temp = ItemTable.getInstance().getTemplate(245);
      weaponItem = (L2Weapon) temp;
      temp = null;
    }
    else if(classId >= 0x26 && classId <= 0x2b)
    {
      //dark elven mage fists
      L2Item temp = ItemTable.getInstance().getTemplate(250);
      weaponItem = (L2Weapon) temp;
      temp = null;
    }
    else if(classId >= 0x2c && classId <= 0x30)
    {
      //orc fighter fists
      L2Item temp = ItemTable.getInstance().getTemplate(248);
      weaponItem = (L2Weapon) temp;
      temp = null;
    }
    else if(classId >= 0x31 && classId <= 0x34)
    {
      //orc mage fists
      L2Item temp = ItemTable.getInstance().getTemplate(252);
      weaponItem = (L2Weapon) temp;
      temp = null;
    }
    else if(classId >= 0x35 && classId <= 0x39)
    {
      //dwarven fists
      L2Item temp = ItemTable.getInstance().getTemplate(247);
      weaponItem = (L2Weapon) temp;
      temp = null;
    }

    return weaponItem;
View Full Code Here

    L2ItemInstance weapon = getSecondaryWeaponInstance();

    if(weapon == null)
      return getFistsWeaponItem();

    L2Item item = weapon.getItem();

    if(item instanceof L2Weapon)
      return (L2Weapon) item;

    weapon = null;
View Full Code Here

            pk.broadcastUserInfo();
           
            if (Config.DM_ENABLE_KILL_REWARD)
            {
             
              L2Item reward = ItemTable.getInstance().getTemplate(Config.DM_KILL_REWARD_ID);
              pk.getInventory().addItem("DM Kill Reward", Config.DM_KILL_REWARD_ID, Config.DM_KILL_REWARD_AMOUNT, this, null);
              pk.sendMessage("You have earned " + Config.DM_KILL_REWARD_AMOUNT + " item(s) of ID " + reward.getName() + ".");
             
            }
           
            sendMessage("You will be revived and teleported to spot in 20 seconds!");
            ThreadPoolManager.getInstance().scheduleGeneral(new Runnable()
View Full Code Here

        if (targetPlayer.getKarma() > 0 || targetPlayer.getPvpFlag() > 0) // killing target pk or in pvp
        {
          if (Config.PVP_REWARD_ENABLED)
          {
            int item = Config.PVP_REWARD_ID;
            L2Item reward = ItemTable.getInstance().getTemplate(item);
           
            int amount = Config.PVP_REWARD_AMOUNT;
           
            getInventory().addItem("Winning PvP", Config.PVP_REWARD_ID, Config.PVP_REWARD_AMOUNT, this, null);
            sendMessage("You have earned " + amount + " item(s) of " + reward.getName() + ".");
          }
         
          if (!Config.FORCE_INVENTORY_UPDATE)
          {
            InventoryUpdate iu = new InventoryUpdate();
            iu.addItem(_inventory.getItemByItemId(Config.PVP_REWARD_ID));
            sendPacket(iu);
            iu = null;
          }
        }
        else
        // target is not pk and not in pvp ---> PK KILL
        {
          if (Config.PK_REWARD_ENABLED)
          {
            int item = Config.PK_REWARD_ID;
            L2Item reward = ItemTable.getInstance().getTemplate(item);
            int amount = Config.PK_REWARD_AMOUNT;
            getInventory().addItem("Winning PK", Config.PK_REWARD_ID, Config.PK_REWARD_AMOUNT, this, null);
            sendMessage("You have earned " + amount + " item(s) of " + reward.getName() + ".");
          }
         
          if (!Config.FORCE_INVENTORY_UPDATE)
          {
            InventoryUpdate iu = new InventoryUpdate();
View Full Code Here

TOP

Related Classes of com.l2jfrozen.gameserver.templates.L2Item

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.