Treasure chest

    
  1. Atsijungęs

    regetojas

    Pranešimai: 0

    Sveiki. Toks neeilinis klausimas. Ar imanoma pakeisti itemo ( chesto ) - Big Black Treasure Box ( id - 6518 ) rewarda? Nes dabar sis chestas duoda 6 fish oil ar kazkas panasaus.
    14 Lapkričio 2016 - 16:54 / #1
  2. 
  3. Atsijungęs

    povis111

    Pranešimai: 0

    laisvai
    Jūsų praneš per trumpas.
    14 Lapkričio 2016 - 18:24 / #2
  4. 
  5. Atsijungęs

    regetojas

    Pranešimai: 0

    Kur tai tiksliai butu galima padaryti? P.S Pamirsau kaip mana potion pakeisti, kad duotu ne 400, o daugiau
    14 Lapkričio 2016 - 18:30 / #3
  6. 
  7. Atsijungęs

    povis111

    Pranešimai: 0

    ant frozeno data/extractable_items.csv
    ant acis xml/items susirandi itema tada ten irasyts skils bun, susirandi ta skila ir jame rasa ka duos
    14 Lapkričio 2016 - 19:58 / #4
  8. 
  9. Atsijungęs

    iitmtii

    Pranešimai: 0

    o kaip padaryt, kad ekstraktinant deze reiktu rakto ar siaip kokio kito item??
    17 Lapkričio 2016 - 16:32 / #5
  10. 
  11. Atsijungęs

    povis111

    Pranešimai: 0

    parasyt specifinej vietoj source kode jei neturi itemo kad neitu extraktint
    17 Lapkričio 2016 - 20:37 / #6
  12. 
  13. Atsijungęs

    iitmtii

    Pranešimai: 0

    povis111,
    o tiksliau galima?
    Paskutinį kartą redagavo: iitmtii 18 Lapkričio 2016 - 13:46
    18 Lapkričio 2016 - 13:46 / #7
  14. 
  15. Atsijungęs

    povis111

    Pranešimai: 0

    tai gal bent nurodysi kuri packa naudoji? ar jie tau visi vienodi?
    18 Lapkričio 2016 - 13:50 / #8
  16. 
  17. Atsijungęs

    iitmtii

    Pranešimai: 0

    Naudoju frozen 1132 rev. :)
    18 Lapkričio 2016 - 23:43 / #9
  18. 
  19. Atsijungęs

    povis111

    Pranešimai: 0

    frozen 1081
    com.l2jfrozen.gameserver.handler.itemhandlers ExtractableItems
    public void doExtract(final L2PlayableInstance playable, final L2ItemInstance item, int count)
    	{
    		if (!(playable instanceof L2PcInstance))
    			return;
    		final L2PcInstance activeChar = (L2PcInstance) playable;
    		final int itemID = item.getItemId();
    		
    		if (count > item.getCount())
    			return;
    		while (count-- > 0)
    		{
    			L2ExtractableItem exitem = ExtractableItemsData.getInstance().getExtractableItem(itemID);
    			if (exitem == null)
    				return;
    			int createItemID = 0, createAmount = 0;
    			final int rndNum = Rnd.get(100);
    			int chanceFrom = 0;
    			for (final L2ExtractableProductItem expi : exitem.getProductItems())
    			{
    				final int chance = expi.getChance();
    				
    				if (rndNum >= chanceFrom && rndNum <= chance + chanceFrom)
    				{
    					createItemID = expi.getId();
    					createAmount = expi.getAmmount();
    					break;
    				}
    				
    				chanceFrom += chance;
    			}
    			
    			exitem = null;
    			
    			if (createItemID == 0)
    			{
    				activeChar.sendMessage("Nothing happened.");
    				return;
    			}
    			
    			if (createItemID > 0)
    			{
    				if (ItemTable.getInstance().createDummyItem(createItemID) == null)
    				{
    					LOGGER.warn("createItemID " + createItemID + " doesn't have template!");
    					activeChar.sendMessage("Nothing happened.");
    					return;
    				}
    				
    				if (ItemTable.getInstance().createDummyItem(createItemID).isStackable())
    				{
    					activeChar.addItem("Extract", createItemID, createAmount, item, false);
    				}
    				else
    				{
    					for (int i = 0; i < createAmount; i++)
    					{
    						activeChar.addItem("Extract", createItemID, 1, item, false);
    					}
    				}
    				SystemMessage sm;
    				
    				if (createAmount > 1)
    				{
    					sm = new SystemMessage(SystemMessageId.EARNED_S2_S1_S);
    					sm.addItemName(createItemID);
    					sm.addNumber(createAmount);
    				}
    				else
    				{
    					sm = new SystemMessage(SystemMessageId.EARNED_ITEM);
    					sm.addItemName(createItemID);
    				}
    				activeChar.sendPacket(sm);
    				sm = null;
    			}
    			else
    			{
    				activeChar.sendMessage("Item failed to open"); // TODO: Put a more proper message here.
    			}
    			
    			activeChar.destroyItemByItemId("Extract", itemID, 1, activeChar.getTarget(), true);
    		}
    	}

    keisi i sita. 1234 tavo rakto id, 6518 tavo dezes id
    public void doExtract(final L2PlayableInstance playable, final L2ItemInstance item, int count)
    	{
    		if (!(playable instanceof L2PcInstance))
    			return;
    		final L2PcInstance activeChar = (L2PcInstance) playable;
    		final int itemID = item.getItemId(), raktoID = 1234;
    		
    		if (count > item.getCount())
    			return;
    		else if(itemID == 6518 && activeChar.getItemCount(raktoID, 0) < count)
    		{
    			activeChar.sendMessage("You do not have enough keys");
    			return;
    		}
    		while (count-- > 0)
    		{
    			L2ExtractableItem exitem = ExtractableItemsData.getInstance().getExtractableItem(itemID);
    			if (exitem == null)
    				return;
    			int createItemID = 0, createAmount = 0;
    			final int rndNum = Rnd.get(100);
    			int chanceFrom = 0;
    			for (final L2ExtractableProductItem expi : exitem.getProductItems())
    			{
    				final int chance = expi.getChance();
    				
    				if (rndNum >= chanceFrom && rndNum <= chance + chanceFrom)
    				{
    					createItemID = expi.getId();
    					createAmount = expi.getAmmount();
    					break;
    				}
    				
    				chanceFrom += chance;
    			}
    			
    			exitem = null;
    			
    			if (createItemID == 0)
    			{
    				activeChar.sendMessage("Nothing happened.");
    				return;
    			}
    			
    			if (createItemID > 0)
    			{
    				if (ItemTable.getInstance().createDummyItem(createItemID) == null)
    				{
    					LOGGER.warn("createItemID " + createItemID + " doesn't have template!");
    					activeChar.sendMessage("Nothing happened.");
    					return;
    				}
    				
    				if (ItemTable.getInstance().createDummyItem(createItemID).isStackable())
    				{
    					activeChar.addItem("Extract", createItemID, createAmount, item, false);
    				}
    				else
    				{
    					for (int i = 0; i < createAmount; i++)
    					{
    						activeChar.addItem("Extract", createItemID, 1, item, false);
    					}
    				}
    				SystemMessage sm;
    				
    				if (createAmount > 1)
    				{
    					sm = new SystemMessage(SystemMessageId.EARNED_S2_S1_S);
    					sm.addItemName(createItemID);
    					sm.addNumber(createAmount);
    				}
    				else
    				{
    					sm = new SystemMessage(SystemMessageId.EARNED_ITEM);
    					sm.addItemName(createItemID);
    				}
    				activeChar.sendPacket(sm);
    				sm = null;
    			}
    			else
    			{
    				activeChar.sendMessage("Item failed to open"); // TODO: Put a more proper message here.
    			}
    			
    			activeChar.destroyItem("Raktas", raktoID, 1, activeChar.getTarget(), true);
    			activeChar.destroyItemByItemId("Extract", itemID, 1, activeChar.getTarget(), true);
    		}
    	}
    19 Lapkričio 2016 - 11:40 / #10