Jump to content
V3ct0r

How to increase temporary bag capacity

Recommended Posts

This is what looks like if you change the source:

 

Untitled.jpg

 

GameServer: Just 1 line needs to be changed: String2KitbagTmpData initializes the temp inventory. Originally it's set to 16, but I set to defMAX_KBITEM_NUM_PER_TYPE, which is the definite maximum amount of items any inventory can contain (including bank - it's the default value for banks!). Max inventory can't be haxed easily: 22 different places it appear + some allocations.

 

Client source requires no changes (only lua changes are necessary - as per guide).

Edited by deguix
  • Like 2

Share this post


Link to post
Share on other sites

image.png.ea3e51bf87177ead57fd5deac2539db4.png

 

 

frmTempBag = UI_CreateForm( "frmTempBag", FALSE, 200, 232, 0, 0, TRUE, FALSE )
UI_ShowForm( frmTempBag, FALSE )
UI_AddFormToTemplete( frmTempBag, FORM_MAIN )
UI_FormSetIsEscClose( frmTempBag, TRUE )
UI_SetIsDrag( frmTempBag,FALSE)
UI_SetFormStyle( frmTempBag,1)

UI_FormSetHotKey( frmTempBag, ALT_KEY, HOTKEY_D )

--加载背景图片
imgBakTop = UI_CreateCompent( frmTempBag, IMAGE_TYPE, "imgBakTop", 200, 232, 0, 0 )
UI_LoadImage( imgBakTop, "texture/ui/tempbag.tga", NORMAL, 198, 232, 0, 0 )

--Title
labTitle = UI_CreateCompent( frmTempBag, LABELEX_TYPE, "labTitle", 400, 150, 10, 5 )
UI_SetCaption( labTitle, "Temporary Bag")
UI_SetTextColor( labTitle, COLOR_BLACK )

UI_SetLabelExFont( labTitle, DEFAULT_FONT, TRUE, COLOR_WHITE )
--创建关闭按钮
btnClose = UI_CreateCompent( frmTempBag, BUTTON_TYPE, "btnClose", 14, 14, 178, 3 )
UI_LoadButtonImage( btnClose, "texture/ui/PublicC.tga", 14, 14, 116, 175, TRUE )
UI_SetButtonModalResult( btnClose, BUTTON_CLOSE )

--创建物品表格
grdTempBag = UI_CreateCompent( frmTempBag, GOODS_GRID_TYPE, "grdTempBag", 184, 305, 7, 36 ) 
UI_SetGridSpace( grdTempBag, 4, 4 )
UI_SetGridContent( grdTempBag, 4, 4 )
UI_SetGridUnitSize( grdTempBag, 32, 32 )
UI_SetMargin( grdTempBag, 21, 4, 0, 0 )

scrollid = UI_GetScroll( grdTempBag )
UI_SetSize( scrollid, 11, 1 )
UI_LoadImage( scrollid, "texture/ui/PublicC.tga", COMPENT_BACK, 11, 1, 194, 13 )

id = UI_GetScrollObj( scrollid, SCROLL_UP )
UI_LoadButtonImage( id, "texture/ui/PublicC.tga", 11, 9, 166, 0, TRUE )
UI_SetSize( id, 11, 9 )

 id = UI_GetScrollObj( scrollid, SCROLL_SCROLL )
UI_LoadImage( id, "texture/ui/PublicC.tga", COMPENT_BACK, 9, 43, 166, 10 )
UI_SetSize( id, 9, 43 )


id = UI_GetScrollObj( scrollid, SCROLL_DOWN )
UI_LoadButtonImage( id, "texture/ui/PublicC.tga", 11, 9, 166, 0, TRUE )
UI_SetSize( id, 11, 9 )

add the line to the client but I don't see the bar

Share this post


Link to post
Share on other sites

Hello @dragontechi!

 

Make sure that paths to textures are correct. Also check coordinates for textures, because my sample was for xDesign GUI, not for original one.

  • Like 1

Share this post


Link to post
Share on other sites
On 3/19/2016 at 1:09 AM, V3ct0r said:

How to increase temporary bag capacity

a8288260467f.png

In the guide I will show how to increase capacity of temporary bag from 16 up to 48 items.

1. Server Side

Open GameServer.exe in any HEX-editor. Go to address:


0x000C0B0D - 1.36 GameServer.exe
0x000C809D - 1.38 GameServer.exe
0x0012E447 - 2.4  GameServer.exe

4689fbb6e7d7t.jpg

Image for 1.38 GameServer.exe

1016 = 1610

0x10 it is capacity of temporary bag by default (16 in decimal). You can change it up to 48 items.


Dec        Hex
-------------------
24 items = 0x18
32 items = 0x20
40 items = 0x28
48 items = 0x30

Let's increase capacity to 32 items for example. So, you have to change 0x10 to 0x20:

2cc9bf016bdft.jpg

Then save GameServer.exe. Ok, now characters will be created with a temporary bag in 32 items by default.

2. Client Side

You also have to increase temporary bag form in the client. You can add scroll bar (a) or stretch the form (b). 

73da1bff2f77.pngURL]d934a966a0e7.png

      a - form with scroll bar                    b - stretched form

For example, I will show how to add scroll bar.

Open main.clu (Client\scripts\lua\forms) and find scripts for frmTempBag. Add scroll bar:


-----------------------------------------------------------------------
-- Temporary bag
-----------------------------------------------------------------------

-- THERE IS SCRIPTS FOR Temporary bag FORM ...

-- ADD SCROLL BAR
scrollid = UI_GetScroll( grdTempBag )
UI_SetSize( scrollid, 11, 1 )
UI_LoadImage( scrollid, "texture/ui/xDesign/PublicC.tga", COMPENT_BACK, 11, 1, 194, 13 )

id = UI_GetScrollObj( scrollid, SCROLL_UP )
UI_LoadButtonImage( id, "texture/ui/xDesign/PublicC.tga", 11, 9, 166, 0, TRUE )
UI_SetSize( id, 11, 9 )

 id = UI_GetScrollObj( scrollid, SCROLL_SCROLL )
UI_LoadImage( id, "texture/ui/xDesign/PublicC.tga", COMPENT_BACK, 9, 43, 166, 10 )
UI_SetSize( id, 9, 43 )


id = UI_GetScrollObj( scrollid, SCROLL_DOWN )
UI_LoadButtonImage( id, "texture/ui/xDesign/PublicC.tga", 11, 9, 166, 0, TRUE )
UI_SetSize( id, 11, 9 )

 

The result you can see above. That's all!

Vector this still working?, i cant find the addres at hex-editor (gameserver 1.36)

 

Share this post


Link to post
Share on other sites
On 12/11/2023 at 7:01 AM, StaffEN said:

Vector this still working?, i cant find the addres at hex-editor (gameserver 1.36)

Send your GameServer.exe please if still relevant.


Share this post


Link to post
Share on other sites
22 hours ago, StaffEN said:

https://file.io/KsCkUWqF27Ks

i cant see the images in this topic, idk if those images explain some codes or something

It says the file is deleted.


Share this post


Link to post
Share on other sites
On 1/12/2024 at 8:44 AM, StaffEN said:

 

image.png

 

Address is 0x000C809D

 

In your GameServer.exe the size of the temporary bag has been increased to 32 items:

20(hex) = 32(dec)

 

  • Thanks 1

Share this post


Link to post
Share on other sites

but can be increased to 48, need to change 20 to 30, right?, and i was looking for the normal size, thats why i cant find that, thanks for your time

Share this post


Link to post
Share on other sites
13 minutes ago, StaffEN said:

but can be increased to 48, need to change 20 to 30, right?, and i was looking for the normal size, thats why i cant find that, thanks for your time

That's right, you need to change 20 to 30.

  • Thanks 1

Share this post


Link to post
Share on other sites
59 minutes ago, V3ct0r said:

That's right, you need to change 20 to 30.

excuse me sir, another thing about tempo bag, theres some way to make an item to move items from inventory to tempo bag, or tempo bag like bank (to save those items)?

Edited by StaffEN

Share this post


Link to post
Share on other sites
18 hours ago, StaffEN said:

excuse me sir, another thing about tempo bag, theres some way to make an item to move items from inventory to tempo bag, or tempo bag like bank (to save those items)?

There is a function GiveItemX(), it works exactly the same as GiveItem(), but the only difference is that it adds the item to a temporary bag:

 


Share this post


Link to post
Share on other sites
7 hours ago, V3ct0r said:

There is a function GiveItemX(), it works exactly the same as GiveItem(), but the only difference is that it adds the item to a temporary bag:

 

Yes, iknow about the giveitemx, but i want to move the items from the inventory to the tempo bag, something like:
if item x is in 2nd slot inventory then
take amount of item id
giveitemx amount of item id
else

systemnotice ("need to put some item on the 2nd slot inventory")
end

or something like that, i have the idea to make that function but didnt know how to make it work perfectly

Share this post


Link to post
Share on other sites
7 hours ago, StaffEN said:

Yes, iknow about the giveitemx, but i want to move the items from the inventory to the tempo bag, something like:
if item x is in 2nd slot inventory then
take amount of item id
giveitemx amount of item id
else

systemnotice ("need to put some item on the 2nd slot inventory")
end

or something like that, i have the idea to make that function but didnt know how to make it work perfectly

 

look for the path \resource\script\MisSdk the file MissionSdk.lua look for a function like this

		elseif actions[i].func == GiveItem then
			PRINT( "ActionProc:GiveItem, p1 = , p2 = , p3 = ", actions[i].p1, actions[i].p2, actions[i].p3 )
			local ret = GiveItem( character, npc, actions[i].p1, actions[i].p2, actions[i].p3 )
			if ret ~= LUA_TRUE then
				PRINT( "ActionProc: GiveItem failed!" )
				SystemNotice( character, "ActionProc: give character item failed!" )
				return LUA_FALSE
			end

and below place

		elseif actions[i].func == GiveItemX then
			PRINT( "ActionProc:GiveItemX, p1 = , p2 = , p3 = ", actions[i].p1, actions[i].p2, actions[i].p3 )
			local ret = GiveItemX( character, npc, actions[i].p1, actions[i].p2, actions[i].p3 )
			if ret ~= LUA_TRUE then
				PRINT( "ActionProc: GiveItemX failed!" )
				SystemNotice( character, "ActionProc: giveX character item failed!" )
				return LUA_FALSE
			end

create an npc something like this or use this same one, the credits go to @Dan just make the modifications so that it can be sent directly to temp bag

function beta_bracelet ()

	Text( 1, "Transfer the bracelet to the temporary bag", JumpPage, 3)
	Text( 1, "Transfer the Handguard to the temporary bag", JumpPage, 4)
	Text( 1, "Transfer the Belt to the temporary bag", JumpPage, 5)

	InitTrigger()
	TriggerCondition( 1, HasItem, 6912, 1 )
	TriggerAction( 1, TakeItem, 6912, 1 )
	TriggerAction( 1, GiveItemX, 6912, 1, 4 )
	TriggerAction( 1, JumpPage, 3 )
	TriggerFailure( 1, JumpPage, 9 )
	Talk( 3, "Exchange Bracelet into Bracelet Chest" )
	Text( 3, "Exchange", MultiTrigger, GetMultiTrigger(), 1 )
	--------------炮制醒神花茶
	InitTrigger()
	TriggerCondition( 1, HasItem, 6913, 1 )
	TriggerAction( 1, TakeItem, 6913, 1 )
	TriggerAction( 1, GiveItemX, 6913, 1, 4 )
	TriggerAction( 1, JumpPage, 4 )
	TriggerFailure( 1, JumpPage, 9 )
	Talk( 4, "Exchange Handguard into Handguard Chest" )
	Text( 4, "Exchange", MultiTrigger, GetMultiTrigger(), 1 )
	-------------------合成秘制奇异膏
	InitTrigger()
	TriggerCondition( 1, HasItem, 6914, 1 )
	TriggerAction( 1, TakeItem, 6914, 1 )
	TriggerAction( 1, GiveItemX, 6914, 1, 4 )
	TriggerAction( 1, JumpPage, 5 )
	TriggerFailure( 1, JumpPage, 9 )
	Talk( 5, "Exchange Belt into Belt Chest" )
	Text( 5, "Exchange", MultiTrigger, GetMultiTrigger(), 1 )
	
	Talk( 8, "Exchanger: Money first. This is what you wanted. Keep it well." )
	Talk( 9, "You don't have the correct item, please check again." )
	
end


Check the video if you don't understand something and remember to enter the ID of the item you want to send to the temp bag. I don't know if this is exactly what you are looking for.
 

 

  • Thanks 1

Share this post


Link to post
Share on other sites
16 hours ago, StaffEN said:

Yes, iknow about the giveitemx, but i want to move the items from the inventory to the tempo bag, something like:
if item x is in 2nd slot inventory then
take amount of item id
giveitemx amount of item id
else

systemnotice ("need to put some item on the 2nd slot inventory")
end

or something like that, i have the idea to make that function but didnt know how to make it work perfectly

--[[
-----------------------------------------------------------------------------------------------
- Transferir ítem al Temp Bag mediante el slot escogido
- Desarrollado por Techi para PKODev
-----------------------------------------------------------------------------------------------
--]]

-- Definir la tabla de ítems permitidos con sus nombres
local allowed_items = {
    {id = 6912, name = "[Bracelet]", description = "Bracelet description"},
    {id = 6913, name = "[Handguard]", description = "Handguard description"},
    {id = 6914, name = "[Belt]", description = "Belt description"},
    {id = 885, name = "[Belt]", description = "Belt description"},
    -- Agregar más ítems según sea necesario
}

-- Función para enviar ítems al bolso temporal
function SendItemsToTempBag(ignore, role, freq, time)
    local targetSlot = 47 -- Número de slot objetivo

    for _, item_info in ipairs(allowed_items) do
        local item_id = item_info.id
        local item_name = item_info.name

        -- Obtener el ítem en el slot
        local item_in_slot = GetChaItem(role, 2, targetSlot)
        local slot_item_id = GetItemID(item_in_slot)

        if slot_item_id == item_id then
            -- Eliminar el ítem al bolso temporal
            TakeItem(role, 0, item_id, 1)
            -- Enviar el ítem al bolso temporal
            GiveItemX(role, 0, item_id, 1, 4)
            
            -- Mostrar mensaje de envío
            BickerNotice(role, item_name .. " enviado al Temp Bag")
            return 1
        end
    end
end

-- Agregar hook
Hook:AddPostHook("cha_timer", SendItemsToTempBag)

See which one suits you best. This one can now be modified for any type of item. Remember that items that have gems and things like that will be restored if they are added using the current method to the temp bag. It needs modifications so that it is delivered with the same statistics as I also had it, I would like to continue modifying it but I had to go to bed

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites

Thanks alot man, both systems will help me alot, if someday u make modifications to transfer item with gems and those stuffs, and want to share it, that will help and ill appreciate it :D

Share this post


Link to post
Share on other sites
4 hours ago, StaffEN said:

Thanks alot man, both systems will help me alot, if someday u make modifications to transfer item with gems and those stuffs, and want to share it, that will help and ill appreciate it :D

@StaffEN I was having the same problem in my files and I never stopped to solve it but I'll let you know something. The first system is 100% safe since it is a simple npc but the second one I didn't have much time to test it because I did it in a while. Test first, it implements well. different methods
 

 

1 hour ago, Andy said:

is this safe from DUPE?

@AndyI am not sure about the 2nd method, it does not perform all the corresponding tests. As soon as I do it, I will confirm if you want to use it.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...