Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

Procedure to show items list from characters inventory

Junior Spellweaver
Joined
Jan 24, 2013
Messages
183
Reaction score
80
Stored procedure to get list of items from character inventory. Like this
Capture.PNG - Procedure to show items list from characters inventory - RaGEZONE Forums
In order to get it working you will need this item list table
Code:
USE [Server01]
GO
CREATE TABLE Cabal_ItemList (ID int, Name varchar(100))

It should look something like this
Capture.PNG - Procedure to show items list from characters inventory - RaGEZONE Forums

STORED PROCEDURE:
Code:
USE [Server01]
GO
/****** Object:  StoredProcedure [dbo].[cabal_sp_Get_CabalItemList]    Script Date: 2/25/2017 11:27:19 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[cabal_sp_Get_CabalItemList]
(
    [USER=551894]Char[/USER]IDX int
)
AS
BEGIN
    /****** Script for SelectTopNRows command from SSMS  ******/
DECLARE @InvData varbinary(512), [USER=836714]counter[/USER] int, @ItemData varbinary(18), @ItemID int, @ItemName Varchar(100)
DECLARE [USER=1333447295]Out[/USER]put TABLE (ID INT, Name Varchar(50))


SELECT @InvData = [Data]
  FROM [Server01].[dbo].[cabal_Inventory_table] WHERE CharacterIdx = [USER=551894]Char[/USER]IDX


  SELECT [USER=836714]counter[/USER] = 1
  WHILE  [USER=836714]counter[/USER] < LEN(@InvData)
    BEGIN
        SELECT @ItemData = SUBSTRING(@InvData, [USER=836714]counter[/USER], 18)
            SELECT @ItemID = dbo.BinToInt(SUBSTRING(@ItemData, 1, 2)) & 0xFFF


                    SELECT @ItemName = Name FROM Cabal_ItemList WHERE ID = @ItemID
                            INSERT INTO [USER=1333447295]Out[/USER]put (Id, Name)
                            VALUES (@ItemID, @ItemName );


                

        SELECT [USER=836714]counter[/USER]  = [USER=836714]counter[/USER] + 18
    END

    SELECT Id, Name
        FROM   [USER=1333447295]Out[/USER]put ORDER BY ID ASC;

END
 

Attachments

You must be registered for see attachments list
Last edited:
Skilled Illusionist
Joined
Apr 17, 2010
Messages
323
Reaction score
23
NULL on Name. how to solve it? thanks!
null - Procedure to show items list from characters inventory - RaGEZONE Forums

it means need to enter the id and name manually in Cabal_ItemList?



Thanks it works for dbo.cabal_equipment_table and dbo.cabal_warehouse_table
 

Attachments

You must be registered for see attachments list
Last edited:
Junior Spellweaver
Joined
Dec 19, 2013
Messages
183
Reaction score
37
I can only view, not edit?

You're gonna have to apply various changes to the code posted up above,
in order to be able to edit item data "properly".
I'd help out if I actually had the required procedure myself,
but I didn't even attempt doing that yet as it simply wasn't needed yet.
I recommend to check the other threads that are about the item binary data,
but make sure to not forget about upgrade, options etc..
Would love to give it a try myself, if I had the time to do so.
 
Junior Spellweaver
Joined
Dec 19, 2013
Messages
183
Reaction score
37
The script contains:
CREATE PROCEDURE [dbo].[cabal_sp_Get_CabalItemList]
(
@CharIDX int
)

So you should be able to just run that using the char idx to view the items,
didn't try it but that's what I see if looking into it.
 
Back
Top