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!

Grab pets days!

Joined
Feb 27, 2013
Messages
1,430
Reaction score
201
Screen will explain what i mean i just want to make inventory like rental period...
RenePunik - Grab pets days! - RaGEZONE Forums

And this is my _AddNewCOS stored procedure
Code:
USE [SRO_VT_SHARD]
GO
/****** Object:  StoredProcedure [dbo].[_AddNewCOS]    Script Date: 1/29/2015 1:52:23 PM ******/
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER ON
GO


ALTER PROCEDURE [dbo].[_AddNewCOS]
    @[I][B][URL="http://forum.ragezone.com/members/334703.html"]Own[/URL][/B][/I]erCharID    int,
    @[I][B][URL="http://forum.ragezone.com/members/18171.html"]ReF[/URL][/B][/I]ObjID    int,
    @[I][B][URL="http://forum.ragezone.com/members/501312.html"]level[/URL][/B][/I]        int,
    @HP        int,
    @MP        int,
    @HGP        int,
    @[I][B][URL="http://forum.ragezone.com/members/481856.html"]keeper[/URL][/B][/I]NPC    int,
    @State        int,
    @[I][B][URL="http://forum.ragezone.com/members/31337.html"]inventor[/URL][/B][/I]ySize  int,
    @itemID        int,
    @PickItemConfig tinyint,
    @RentEndTime     smalldatetime
as


begin tran


    declare @COS_ID    int
--@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
--        pet_skill_item (ÃÖ¼±È£)        
--@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@


    declare @[I][B][URL="http://forum.ragezone.com/members/2000008437.html"]Maxin[/URL][/B][/I]ventorySize tinyint
    select @[I][B][URL="http://forum.ragezone.com/members/2000008437.html"]Maxin[/URL][/B][/I]ventorySize = InventorySize
    from _RefObjCommon, _RefObjChar
    where _RefObjCommon.ID = @[I][B][URL="http://forum.ragezone.com/members/18171.html"]ReF[/URL][/B][/I]ObjID and _RefObjCommon.Link = _RefObjChar.ID
    
    if( @@rowcount = 0 or @[I][B][URL="http://forum.ragezone.com/members/2000008437.html"]Maxin[/URL][/B][/I]ventorySize < @[I][B][URL="http://forum.ragezone.com/members/31337.html"]inventor[/URL][/B][/I]ySize )
    begin
        rollback tran
        return -5
    end


    insert into _CharCOS values  @[I][B][URL="http://forum.ragezone.com/members/334703.html"]Own[/URL][/B][/I]erCharID, @[I][B][URL="http://forum.ragezone.com/members/18171.html"]ReF[/URL][/B][/I]ObjID, @HP, @MP, @[I][B][URL="http://forum.ragezone.com/members/481856.html"]keeper[/URL][/B][/I]NPC, @State, NULL, @[I][B][URL="http://forum.ragezone.com/members/501312.html"]level[/URL][/B][/I], 0, @HGP, @PickItemConfig, @RentEndTime)
--@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
--@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
    set @COS_ID = @@identity
    if (@COS_ID = 0 OR @@error <> 0)
    begin
        rollback tran
        return -1
    end


--@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
--        pet_skill_item (ÃÖ¼±È£)        
--@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
    if  @[I][B][URL="http://forum.ragezone.com/members/2000008437.html"]Maxin[/URL][/B][/I]ventorySize > 0)
--@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
--@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
    begin
        declare @[I][B][URL="http://forum.ragezone.com/members/558012.html"]slot[/URL][/B][/I]  int
        set @[I][B][URL="http://forum.ragezone.com/members/558012.html"]slot[/URL][/B][/I] = 0
--@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
--        pet_skill_item (ÃÖ¼±È£)        
--@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
        while  @[I][B][URL="http://forum.ragezone.com/members/558012.html"]slot[/URL][/B][/I] < @[I][B][URL="http://forum.ragezone.com/members/2000008437.html"]Maxin[/URL][/B][/I]ventorySize)
--@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
--@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
        begin
            insert into _InvCOS values(@COS_ID, @[I][B][URL="http://forum.ragezone.com/members/558012.html"]slot[/URL][/B][/I], 0)
            if (@@error <> 0)
            begin
                -- Àκ¥Å丮 »ý¼º ½ÇÆÐ!
                rollback tran
                return -2
            end    
        
            set @[I][B][URL="http://forum.ragezone.com/members/558012.html"]slot[/URL][/B][/I] = @[I][B][URL="http://forum.ragezone.com/members/558012.html"]slot[/URL][/B][/I] + 1
        end
    end
    
/*    --´õ ÀÌ»ó ÀÌ Ä÷³¿¡´Â µ¥ÀÌÅ͸¦ ³ÖÁö ¾Ê´Â´Ù!
    UPDATE _Char SET EngagedCOS = @COS_ID WHERE CharID = @[I][B][URL="http://forum.ragezone.com/members/334703.html"]Own[/URL][/B][/I]erCharID
    IF (@@ERROR <> 0 OR @@ROWCOUNT = 0)
    BEGIN
        ROLLBACK TRANSACTION
        RETURN -3
    END
*/
    if( @itemID <> 0 )
    begin
        update _Items set Data = @COS_ID where ID64 = @itemID
        if( @@error <> 0 or @@rowcount = 0 )
        begin
            rollback transaction
            return -4
        end
        
        --BEGIN ADDITIONAL 112 SLOT IN GRAB PETS FOR 7684 DAYS
        declare @[I][B][URL="http://forum.ragezone.com/members/445157.html"]serial[/URL][/B][/I]64 bigint
        select @[I][B][URL="http://forum.ragezone.com/members/445157.html"]serial[/URL][/B][/I]64 = Serial64 from _Items where Data = @COS_ID
        exec _AddTimedJobForPet @COS_ID,5,22926,1992999999,1111708465,1,28,0,0,0,0,0 @[I][B][URL="http://forum.ragezone.com/members/445157.html"]serial[/URL][/B][/I]64
        --BEGIN ADDITIONAL 112 SLOT IN GRAB PETS FOR 7684 DAYS
        
    end


    commit tran


return @COS_ID
 
kaju
Joined
Nov 8, 2011
Messages
833
Reaction score
96
you cant make from this procedure to add 28 day. but you can make a skill who add 28 day but will give d/c and when they log will have 28 day.
 
Last edited:
Upvote 0
kaju
Joined
Nov 8, 2011
Messages
833
Reaction score
96
as i remember there is a item who give slot for pet name was wilt agol and you can edit item and make an item like agol..
 
Upvote 0
Retired
Joined
Oct 28, 2013
Messages
536
Reaction score
103
So, no thanks means no support. If anyone wants the script, PM me instead.
People should learn how to "thank and distribute to the community, hence I won't post my stuff anymore.
 
Last edited:
Upvote 0
Back
Top