[Help]About Rent_Period and RentPeriodRemainder

Results 1 to 11 of 11
  1. #1
    GameLife's 4dmin kelvin2005 is offline
    MemberRank
    Jul 2005 Join Date
    MalaysiaLocation
    445Posts

    [Help]About Rent_Period and RentPeriodRemainder

    i saw dbo.items have RentPeriodReminder , i hard-coded inside the table to 1[default is NULL] , i login into game and i found that, the item have a Limitation. "0 hours 1 mins" .. it does counting till 0 hours 0 mins and Expired. The Problem is , System didnt take away those expired cloth or restrict the player to wear the expired cloth. yet , the timer goes negative. Every time i login, the item show me "0 hours 1 mins". so, if we want to fix this, we need a trigger\proc.

    And i saw that the NPC will dropitem in Quest Mode, there is a Rent_Period="168" , so, i put in the code into my Shop.xml like this "BUY Item id="5000001" Rent_Period="168" /" , but it's not working. Perhaps someone could write it out ^^


  2. #2
    The beer?? Its here !!! Rotana is offline
    MemberRank
    Jan 2007 Join Date
    The NetherlandsLocation
    1,733Posts

    Re: [Help]About Rent_Period and RentPeriodRemainder

    For this you need an stored procedure named DeleteExpiredAccountItem the matchserver calls this one, You need to make it you own i dont have it.

    Maybe someone else wanna share it with you

  3. #3
    GameLife's 4dmin kelvin2005 is offline
    MemberRank
    Jul 2005 Join Date
    MalaysiaLocation
    445Posts

    Re: [Help]About Rent_Period and RentPeriodRemainder

    set ANSI_NULLS ON
    set QUOTED_IDENTIFIER ON
    GO
    CREATE PROCEDURE [dbo].[spDeleteExpiredAccountItem]
    @nCID INT,
    @nItemID INT,
    @nCIID INT,
    @nRentPeriodRemainder INT
    AS
    BEGIN
    SET NOCOUNT ON;

    DELETE FROM Items
    WHERE RentPeriodRemainder = 0

    Select 1 Ret
    END

    I test the code, it work. if RentPeriodRemainder = 0, it will show you the expired item as a notice but it does not auto delete the item. Do i need a Trigger or something to monitor it?
    What how to let RentPeriodRemainder have a counting procedure?

  4. #4
    The beer?? Its here !!! Rotana is offline
    MemberRank
    Jan 2007 Join Date
    The NetherlandsLocation
    1,733Posts

    Re: [Help]About Rent_Period and RentPeriodRemainder

    I'm working on a solution for an trigger/procedure when an Rentperiod is null to remove it. But now is the problem what if there are account items that dont have any rent period, like items buyd or won for ever?

    And The count down is not working correctly.

    If you need help or something else add me on msn herman1@live.nl

  5. #5
    GameLife's 4dmin kelvin2005 is offline
    MemberRank
    Jul 2005 Join Date
    MalaysiaLocation
    445Posts

    Re: [Help]About Rent_Period and RentPeriodRemainder

    you can try to make this
    DELETE FROM Items
    WHERE RentPeriodRemainder = 0

    So, you motify the shop.xml -> BUY <ItemID="500001" Rent_Period="120" /> so it could add the rent_period when player buy item. i saw that dbo.spBuyBountyItem , it only insert the CID ItemID CIID -> Values(@nCID,@nItemID,NULL) . so, if you declare @nRentPeriodRemainder and motify like this
    CID ItemID CIID RentPeriodRemainder-> Values(@nCID,@nItemID,NULL,@nRent_Period) , it might work but after i edited it, i cant buy item ..lol

    i dont know what procedure to ready the Rent_Period from the shop.xml . what i did is, i put 0 in the RentPeriodRemainder instead of NULL, when i join game, it showing me that my items are expired but it never delete them from database even the procedure is there.. perhaps we need a Trigger to detect then delete. my MSN kelvin_lai72@hotmail.com .

    Nice to meet ya, bro

  6. #6
    GameLife's 4dmin kelvin2005 is offline
    MemberRank
    Jul 2005 Join Date
    MalaysiaLocation
    445Posts

    Re: [Help]About Rent_Period and RentPeriodRemainder

    Rotana , i think i got the trigger already, this idea is from Pokky's [TuT's Make NPC drop Normal item] . the trigger should be

    USE [GunzDB]
    GO
    /****** Object: Trigger [dbo].[ItemUpdate] Script Date: 01/01/2002 14:09:47 ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    -- =============================================
    -- Author: <Author,,Name>
    -- Create date: <Create Date,,>
    -- Description: <Description,,>
    -- =============================================
    ALTER TRIGGER [dbo].[ItemDelete]
    ON [dbo].[Items]
    AFTER update,insert
    AS
    BEGIN
    -- SET NOCOUNT ON added to prevent extra result sets from
    -- interfering with SELECT statements.
    SET NOCOUNT ON;

    update Items
    delete from items
    where RentPeriodRemainder=0

    END


    Help me verify the code..lol!

  7. #7

    Re: [Help]About Rent_Period and RentPeriodRemainder

    Quote Originally Posted by kelvin2005 View Post
    set ANSI_NULLS ON
    set QUOTED_IDENTIFIER ON
    GO
    CREATE PROCEDURE [dbo].[spDeleteExpiredAccountItem]
    @nCID INT,
    @nItemID INT,
    @nCIID INT,
    @nRentPeriodRemainder INT
    AS
    BEGIN
    SET NOCOUNT ON;

    DELETE FROM Items
    WHERE RentPeriodRemainder = 0

    Select 1 Ret
    END

    I test the code, it work. if RentPeriodRemainder = 0, it will show you the expired item as a notice but it does not auto delete the item. Do i need a Trigger or something to monitor it?
    What how to let RentPeriodRemainder have a counting procedure?
    You didn't program the code properly. MatchServer will just delete the item. You didn't ask it to update the item.

  8. #8
    The beer?? Its here !!! Rotana is offline
    MemberRank
    Jan 2007 Join Date
    The NetherlandsLocation
    1,733Posts

    Re: [Help]About Rent_Period and RentPeriodRemainder

    Quote Originally Posted by kelvin2005 View Post
    Rotana , i think i got the trigger already, this idea is from Pokky's [TuT's Make NPC drop Normal item] . the trigger should be

    USE [GunzDB]
    GO
    /****** Object: Trigger [dbo].[ItemUpdate] Script Date: 01/01/2002 14:09:47 ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    -- =============================================
    -- Author: <Author,,Name>
    -- Create date: <Create Date,,>
    -- Description: <Description,,>
    -- =============================================
    ALTER TRIGGER [dbo].[ItemDelete]
    ON [dbo].[Items]
    AFTER update,insert
    AS
    BEGIN
    -- SET NOCOUNT ON added to prevent extra result sets from
    -- interfering with SELECT statements.
    SET NOCOUNT ON;

    update Items
    delete from items
    where RentPeriodRemainder=0

    END


    Help me verify the code..lol!
    I need to test it first, mine database doesn't update or countdown the rentperiodremainder.

  9. #9
    GameLife's 4dmin kelvin2005 is offline
    MemberRank
    Jul 2005 Join Date
    MalaysiaLocation
    445Posts

    Re: [Help]About Rent_Period and RentPeriodRemainder

    Dont mofity the Items table. i was thinking to modify the table and give an identity to RentPeriodRemainder so it can count it self.

  10. #10
    Proficient Member Pokky is offline
    MemberRank
    Aug 2004 Join Date
    156Posts

    Re: [Help]About Rent_Period and RentPeriodRemainder

    In the case Store Procedures not work, i think u should try a trigger
    Code:
    USE [GunzDB]
    GO
    /****** Object:  Trigger [dbo].[DeleteItem]    Script Date: 05/13/2007 03:22:42 ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    -- =============================================
    -- Author:		<Author,,Name>
    -- Create date: <Create Date,,>
    -- Description:	<Description,,>
    -- =============================================
    ALTER TRIGGER [dbo].[DeleteItem] 
       ON  [dbo].[Items] 
       AFTER update
    AS 
    BEGIN
    	-- SET NOCOUNT ON added to prevent extra result sets from
    	-- interfering with SELECT statements.
    	SET NOCOUNT ON;
    
        DELETE FROM [GunzDB].[dbo].[Items]
          WHERE RentPeriodRemainder<=0
    
    END
    But i think we miss some Store Procedures to make the RentPeriodRemainder count down, so the RentPeriodRemainder will always be the number u set ^^
    Anyway, have fun ;)

  11. #11
    GameLife's 4dmin kelvin2005 is offline
    MemberRank
    Jul 2005 Join Date
    MalaysiaLocation
    445Posts

    Re: [Help]About Rent_Period and RentPeriodRemainder

    We knew it, now rotana is working on how to make it "Counting down". i will try to rip some code from some other database and make this complete. We got the Store Procedures and trigger, what we need is the counting system ^^



Advertisement