• Unfortunately, we have experienced significant hard drive damage that requires urgent maintenance and rebuilding. The forum will be a state of read only until we install our new drives and rebuild all the configurations needed. Please follow our Facebook page for updates, we will be back up shortly! (The forum could go offline at any given time due to the nature of the failed drives whilst awaiting the upgrades.) When you see an Incapsula error, you know we are in the process of migration.

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