Reward Scroll.

07/20/2014 21:39 *C0RE#1
Hi.
I am trying to do a reward scroll which would give you a random item when you click on it...
I think it can be done setting right params on _refObjItem table but I just cant find the right params.

I've do some researchs and tests on my testserver and I've figured out that param [UIU] is for item usage, [UIL] is for item loads, [USU] for skill usage.. but I havent find any param that creates another item once the scroll is used..

Anyone have an idea how it can be done?
07/20/2014 22:45 Eslam Galull#2
Giving you a hint

Quote:
Originally Posted by @$$ View Post
Random SIlk

IF(@JobID= '787879')
BEGIN
DECLARE @USERJID int = (SELECT USERJID FROM SRO_VT_SHARD.dbo._USER WHERE CHARID = @CharID);
DECLARE @Random INT;
DECLARE @Upper INT;
DECLARE @Lower INT;

SET @Lower = 100 -- The lowest random number
SET @Upper = 10000 -- The highest random number
SET @Random = ROUND(((@Upper - @Lower -1) * RAND() + @Lower), 0)

IF (SELECT COUNT(*) FROM SRO_VT_ACCOUNT.dbo.SK_SILK WHERE JID = @USERJID) > 0
UPDATE SRO_VT_ACCOUNT.dbo.SK_Silk SET SILK_OWN = SILK_OWN + @Random WHERE JID = @USERJID;

IF (SELECT COUNT(*) FROM SRO_VT_ACCOUNT.dbo.SK_SILK WHERE JID = @USERJID) = 0
INSERT INTO SRO_VT_ACCOUNT.dbo.SK_Silk (JID,silk_gift,silk_own,silk_point)
values (@USERJID,0,@Random,0);
END

this is a random silk amount !

edits : its a timejob huh !!