• Unfortunately, we have experienced significant hard drive damage that requires urgent maintenance and rebuilding. The forum will be a state of read only until we install our new drives and rebuild all the configurations needed. Please follow our Facebook page for updates, we will be back up shortly! (The forum could go offline at any given time due to the nature of the failed drives whilst awaiting the upgrades.) When you see an Incapsula error, you know we are in the process of migration.

[TIP] add items to inventory

Junior Spellweaver
Joined
Jan 21, 2008
Messages
126
Reaction score
0
WARNING gm tools does the same!

i searched but didn`t find anything which would help my to add items to my character inventory, maybe i am blind but still i created a simple sql query.


Code:
/****** Object:  Stored Procedure dbo.cabal_tools_additem    Script Date: 2008.07.10  ******/
/****** Copyright (c) ZeRo                                                                                               *****/

create procedure [dbo].[cabal_tools_additem ] (@charid int, @itemid int, @itemopt int, @slot int)
as
begin
  SET NOCOUNT ON

  declare @data varbinary(4096)
select
  @data = A.data 
FROM
  cabal_inventory_table A
WHERE
  A.characteridx =@charid

set @data = @data +
    dbo.wordtobin(@itemid) + 
    dbo.int2bin(0) + 
    dbo.int2bin(@itemopt) +
    dbo.wordtobin(@slot) +
    dbo.int2bin(0)

UPDATE
  dbo.cabal_inventory_table
SET
  data = @data
WHERE
  characteridx = @charid
  
  SET NOCOUNT OFF  
end
GO

1. first of all, open your mssql enterprise manager.
2. select database GAMEDB
3. On "Stored procedures" right click -> "New stored procedure..."
4. Paste the code (overwriting everything that is in text area)
5. Hit Ok. All done

Usage:
1. Open "SQL query analyzer" (from mssql enterprise manager TOOLS-> sql query analyzer)
2. Select Dd "GAMEDB"
3. in text area write: exec dbo.cabal_tools_additem character_id, item_id, item_opt, place_in_inventory

for example exec dbo.cabal_tools_additem 2, 3, 5, 12

that will add lvl1 healing potion (id = 3) quantity of 5 (itemOpt = 5) to character no 2, in 12 square in inventory ;)

to see what character id u need to add look at db GAMEDB : table cabal_character_table : field characteridx ;) of character u want to add item to

one problem is when u add an item to your ch inventory, u need to rejoin the channel (esc -> select character) and after that u will see your added item, but i will try to fix it (and added item will apear instantly in inventory)

Hope it will be usefull to someone. Sorry for my bad English ;)
 
Last edited:
Newbie Spellweaver
Joined
Feb 2, 2006
Messages
78
Reaction score
9
Thx a lot man.

Trying to edit your procedure for add item in the page 4 of the Wharehouse account :)
 
Junior Spellweaver
Joined
Jan 21, 2008
Messages
126
Reaction score
0
post changes if u succeed, so everyone could use it ;)
 
Junior Spellweaver
Joined
Jan 21, 2008
Messages
126
Reaction score
0
it will be nice, when it will auto refresh the inventory after adding an item. Now its just better then nothing ;)
 
Junior Spellweaver
Joined
Jan 21, 2008
Messages
126
Reaction score
0
well when i used gm tools not one item appeared to my inventory :) or as i said i was blind or dont know where to look for that item ;) , so made this script, and it adds items to me ;)
 
Junior Spellweaver
Joined
Jan 21, 2008
Messages
126
Reaction score
0
Basically does the same then.
The "Gm Tools" takes the item to appear but if you change your character appears immediately

Ohh its the same then i didn`t figure it out in time :) thanks darkxl.

And everyone just ignore this ;)
 
Back
Top