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!

Buy item problem

Junior Spellweaver
Joined
Nov 20, 2017
Messages
146
Reaction score
19
Hey Ragezone,

It's been a while since my test server has this error!
2qzHwlJ - Buy item problem - RaGEZONE Forums

Some items I can usually buy, but others appear this message!

I saw some posts saying it's something in the database (dbo.Item), but what do I do to fix this error? Will I have to rewrite it item by item?

thank you if anyone can help me :love:
 

Attachments

You must be registered for see attachments list
I'm retired, I'm already
Banned
Joined
Oct 3, 2011
Messages
832
Reaction score
155
It is not necessary to add them, I do not have any element added to the table dbo.Item and I can buy, look at this procedure to see how.

PHP:
USE [GunzDB]
GO
/****** Object:  StoredProcedure [dbo].[spBuyBountyItem?back2]    Script Date: 01/08/2018 00:51:10 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO


ALTER PROC [dbo].[spBuyBountyItem?back2]
-- ALTER PROC dbo.spBuyBountyItem
    [USER=369615]Cid[/USER]                INT,  
    @ItemID                INT,
    @ItemCount            INT,
    [USER=828510]price[/USER]                INT,
    @IsSpendableItem    INT,
    [USER=2000189957]Ren[/USER]tHourPeriod        INT = NULL    
AS BEGIN
    SET NOCOUNT ON
    
    DECLARE @Bounty INT;
    DECLARE [USER=518004]Order[/USER]CIID INT;
    DECLARE @Cnt INT;
    
    IF( [USER=2000189957]Ren[/USER]tHourPeriod IS NULL ) BEGIN
        SET [USER=2000189957]Ren[/USER]tHourPeriod = 0;
    END
    
    DECLARE @CurDate DATETIME;
    SET @CurDate = GETDATE();


    BEGIN TRAN ----------------------------    
    
        -- Àܾװ˻ç => Bounty °¨¼Ò      
        UPDATE    dbo.Character 
        SET        BP = BP - [USER=828510]price[/USER] 
        WHERE    CID = [USER=369615]Cid[/USER] 
        AND        (BP - [USER=828510]price[/USER] > 0);
        
        IF( 0 <> @@ERROR OR 0 = @@ROWCOUNT ) BEGIN      
            ROLLBACK TRAN
            SELECT -1 AS 'Ret'
            RETURN;
        END              
        
        IF( @IsSpendableItem = 1 ) BEGIN
                    
            -- ÀÌ¹Ì °®°í ÀÖ´ÂÁö È®ÀÎÇغ»´Ù.
            SELECT    [USER=518004]Order[/USER]CIID = CIID 
            FROM    CharacterItem(NOLOCK) 
            WHERE    CID = [USER=369615]Cid[/USER] 
            AND        ItemID = @ItemID;
        
            -- ÀÌ¹Ì °®°í ÀÖÁö ¾Ê´Ù¸é »õ·Î Ãß°¡ÇØÁØ´Ù.
            IF( [USER=518004]Order[/USER]CIID IS NOT NULL ) BEGIN
            
                UPDATE    dbo.CharacterItem                -- Item Ãß°¡
                SET        Cnt = Cnt + @ItemCount
                WHERE    CIID = [USER=518004]Order[/USER]CIID
                AND        CID = [USER=369615]Cid[/USER];
                
                IF( 0 <> @@ERROR OR 0 = @@ROWCOUNT ) BEGIN      
                    ROLLBACK TRAN
                    SELECT -2 AS 'Ret'
                    RETURN;
                END
                                        
            END ELSE BEGIN
            
                INSERT INTO CharacterItem (CID, ItemID, RegDate, RentDate, RentHourPeriod, Cnt)
                Values  [USER=369615]Cid[/USER], @ItemID, @CurDate, @CurDate, [USER=2000189957]Ren[/USER]tHourPeriod, @ItemCount)
                
                IF( 0 <> @@ERROR OR 0 = @@ROWCOUNT ) BEGIN      
                    ROLLBACK TRAN
                    SELECT -3 AS 'Ret'
                    RETURN;
                END
                
                SELECT [USER=518004]Order[/USER]CIID = @@IDENTITY;    
            END
                        
        END
        ELSE BEGIN
                
            INSERT dbo.CharacterItem (CID, ItemID, RegDate, RentDate, RentHourPeriod, Cnt)
            Values  [USER=369615]Cid[/USER], @ItemID, @CurDate, @CurDate, [USER=2000189957]Ren[/USER]tHourPeriod, @ItemCount)
            
            SELECT [USER=518004]Order[/USER]CIID = @@IDENTITY;    
            
            IF( 0 <> @@ERROR OR 0 = @@ROWCOUNT ) BEGIN      
                ROLLBACK TRAN
                SELECT -4 AS 'Ret'
                RETURN;
            END
                        
        END 
        
        -- Item ±¸¸Å·Î±× Ãß°¡      
        INSERT INTO ItemPurchaseLogByBounty (ItemID, CID, Date, Bounty, CharBounty, Type)
        VALUES (@ItemID, [USER=369615]Cid[/USER], @CurDate, [USER=828510]price[/USER], @Bounty, '±¸ÀÔ')
        
        IF( 0 <> @@ERROR OR 0 = @@ROWCOUNT ) BEGIN      
            ROLLBACK TRAN
            SELECT -5 AS 'Ret'
            RETURN;
        END
        
    COMMIT TRAN ----------------------------
        
    SELECT 0 AS 'Ret', [USER=518004]Order[/USER]CIID AS 'ORDERCIID'
END

If you are trying to add the VIP stores in the game it would be another procedure code, if so, let me know to help you out.
 
Upvote 0
I'm retired, I'm already
Banned
Joined
Oct 3, 2011
Messages
832
Reaction score
155
Specify well which are the articles and model pose here the xml code of the article.
 
Upvote 0
Junior Spellweaver
Joined
Nov 20, 2017
Messages
146
Reaction score
19
I've added item by item, now everything is normal!
 
Upvote 0
Experienced Elementalist
Joined
Oct 14, 2015
Messages
290
Reaction score
83
Open your db go in dbo.item remove Set Primary Key.
 
Upvote 0
Back
Top