[Request Help]SOS Item Scroll

02/09/2019 21:31 alexrap2010#1
I have this procedure for SOS item box

Currently,the player get a SOS item 100% but I want to change the probability of 20- 25 % of getting a SOS

Code:
IF operation = 41 
BEGIN
    IF (@ItemRefID = 61462) -- RefObjCommon ID

   begin
declare charname62 varchar(64) 
Select charname62=CharName16 from SRO_VT_SHARD.dbo._Char where CharID = ChariD 
declare lotteryAvatar2 varchar(129)
set lotteryAvatar2 = (SELECT TOP 1 WEAPON FROM SRO_Primary.dbo._LotteryITEMsystem ORDER BY NEWID())
    exec SRO_VT_SHARD.dbo._ADD_ITEM_EXTERN charname62 lotteryAvatar2,1,0
   end
   end
02/10/2019 01:25 NagySandor96#2
hey.
1) create another table, with 100 rows. fill the rows with number between 1 and 100.
2)extend your procedure by adding a line which finds a number randomly in your table

let NUMBER_RAND := (the number you got after the random line),
let CONDITION := (the probability)

so, somehow like this:

IF (NUMBER_RAND <= CONDITION)
BEGIN
EXEC (IDK WHAT IS THE PROC WHICHS GIVE YOU ANY ITEM)
cheers