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!

Simple "Random" Procedures

Newbie Spellweaver
Joined
Aug 22, 2014
Messages
68
Reaction score
19
Random Silk:
Code:
USE SRO_VT_SHARD

--//////////AddRandomSilk V1.0 By Syloxx\\\\\\\\\
CREATE PROCEDURE _AddRandomSilk @[I][B][URL="http://forum.ragezone.com/members/551894.html"]Char[/URL][/B][/I]ID                    INT
AS

    DECLARE @[I][B][URL="http://forum.ragezone.com/members/37563.html"]mINs[/URL][/B][/I]ilk    INT = 100,
            @[I][B][URL="http://forum.ragezone.com/members/693815.html"]maxs[/URL][/B][/I]ilk    INT = 100000,
            @[I][B][URL="http://forum.ragezone.com/members/11573.html"]random[/URL][/B][/I]Silk    INT,
            @[I][B][URL="http://forum.ragezone.com/members/820632.html"]JiD[/URL][/B][/I]        INT

    SELECT @[I][B][URL="http://forum.ragezone.com/members/11573.html"]random[/URL][/B][/I]Silk = ROUND(( @[I][B][URL="http://forum.ragezone.com/members/693815.html"]maxs[/URL][/B][/I]ilk - @[I][B][URL="http://forum.ragezone.com/members/37563.html"]mINs[/URL][/B][/I]ilk -1) * RAND() + @[I][B][URL="http://forum.ragezone.com/members/37563.html"]mINs[/URL][/B][/I]ilk), 0)
        
    SELECT    @[I][B][URL="http://forum.ragezone.com/members/820632.html"]JiD[/URL][/B][/I] = UserJID
    FROM    SRO_VT_SHARD.._User
    WHERE    CharID = @[I][B][URL="http://forum.ragezone.com/members/551894.html"]Char[/URL][/B][/I]ID
        
        
    IF NOT EXISTS (SELECT @[I][B][URL="http://forum.ragezone.com/members/820632.html"]JiD[/URL][/B][/I] FROM SRO_VT_ACCOUNT..SK_Silk)
        BEGIN
            INSERT INTO SRO_VT_ACCOUNT..SK_Silk
            VALUES    (
                    @[I][B][URL="http://forum.ragezone.com/members/820632.html"]JiD[/URL][/B][/I],
                    @[I][B][URL="http://forum.ragezone.com/members/11573.html"]random[/URL][/B][/I]Silk,
                    0,
                    0
                    )
        END
        ELSE
        BEGIN
            UPDATE    SRO_VT_ACCOUNT..SK_Silk
            SET        silk_gift += @[I][B][URL="http://forum.ragezone.com/members/11573.html"]random[/URL][/B][/I]Silk
            WHERE    JID = @[I][B][URL="http://forum.ragezone.com/members/820632.html"]JiD[/URL][/B][/I]
        END

Random SP:
Code:
USE SRO_VT_SHARD

--//////////AddRandomSP V1.0 By Syloxx\\\\\\\\\
CREATE PROCEDURE _AddRandomSP @[I][B][URL="http://forum.ragezone.com/members/551894.html"]Char[/URL][/B][/I]ID                INT
AS

    DECLARE @[I][B][URL="http://forum.ragezone.com/members/37563.html"]mINs[/URL][/B][/I]P INT = 100,
            @[I][B][URL="http://forum.ragezone.com/members/693815.html"]maxs[/URL][/B][/I]P INT = 100000,
            @[I][B][URL="http://forum.ragezone.com/members/11573.html"]random[/URL][/B][/I]SP INT

    SELECT @[I][B][URL="http://forum.ragezone.com/members/11573.html"]random[/URL][/B][/I]SP = ROUND(( @[I][B][URL="http://forum.ragezone.com/members/693815.html"]maxs[/URL][/B][/I]P - @[I][B][URL="http://forum.ragezone.com/members/37563.html"]mINs[/URL][/B][/I]P -1) * RAND() + @[I][B][URL="http://forum.ragezone.com/members/37563.html"]mINs[/URL][/B][/I]P), 0)
            
    UPDATE    _Char
    SET        RemainSkillPoint += @[I][B][URL="http://forum.ragezone.com/members/11573.html"]random[/URL][/B][/I]SP
    WHERE    CharID = @[I][B][URL="http://forum.ragezone.com/members/551894.html"]Char[/URL][/B][/I]ID

Random Gold:
Code:
USE SRO_VT_SHARD

--//////////AddRandomGold V1.0 By Syloxx\\\\\\\\\
CREATE PROCEDURE _AddRandomGold @[I][B][URL="http://forum.ragezone.com/members/551894.html"]Char[/URL][/B][/I]ID                INT
AS

    DECLARE @[I][B][URL="http://forum.ragezone.com/members/2000076345.html"]mingo[/URL][/B][/I]ld INT = 100,
            @[I][B][URL="http://forum.ragezone.com/members/447213.html"]Max[/URL][/B][/I]Gold INT = 100000,
            @[I][B][URL="http://forum.ragezone.com/members/11573.html"]random[/URL][/B][/I]Gold INT

    SELECT @[I][B][URL="http://forum.ragezone.com/members/11573.html"]random[/URL][/B][/I]Gold = ROUND(( @[I][B][URL="http://forum.ragezone.com/members/447213.html"]Max[/URL][/B][/I]Gold - @[I][B][URL="http://forum.ragezone.com/members/2000076345.html"]mingo[/URL][/B][/I]ld -1) * RAND() + @[I][B][URL="http://forum.ragezone.com/members/2000076345.html"]mingo[/URL][/B][/I]ld), 0)
            
    UPDATE    _Char
    SET        RemainGold += @[I][B][URL="http://forum.ragezone.com/members/11573.html"]random[/URL][/B][/I]Gold
    WHERE    CharID = @[I][B][URL="http://forum.ragezone.com/members/551894.html"]Char[/URL][/B][/I]ID
 
Back
Top