Register for your free account! | Forgot your password?

You last visited: Today at 13:46

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Lucky Box

Discussion on Lucky Box within the SRO Private Server forum part of the Silkroad Online category.

Reply
 
Old   #1
 
ILowe's Avatar
 
elite*gold: 0
Join Date: Mar 2012
Posts: 677
Received Thanks: 29
Lucky Box

Hello

i want to make a lucky box
but as this% chance

sample: Lucky Box

I want 50% successful 50% fail when pressed

will not give anything when it fails
ILowe is offline  
Old 02/16/2019, 00:45   #2
 
elite*gold: 0
Join Date: Aug 2017
Posts: 121
Received Thanks: 9
Channel discord
modyuasty3 is offline  
Old 02/16/2019, 02:00   #3
 
#HB's Avatar
 
elite*gold: 100
Join Date: Sep 2017
Posts: 1,097
Received Thanks: 889
Ain't hard to implement as an SQL side only.

Code:
declare $LinesCC int = (select count(*) from $MainTable where ScrollObjID = $ItemRefID)

if ($LinesCC > 0)
begin
	declare $idx int = 1
	declare $LuckTable table (ItemCode varchar(128), ItemCount int, ItemOptLevel int)

	while ($idx <= $LinesCC)
	begin
	declare $Ratio int = 0
	select $Ratio = Ratio from $MainTable where ScrollObjID = $ItemRefID and ID = $idx
	
	if ($Ratio > 0)
	begin
		INSERT INTO $LuckTable
		select MT.ItemCode, MT.ItemCount, MT.ItemOptLevel from $MainTable MT cross join
		(select top 100 ROW_NUMBER() over(order by (select 1)) from sys.columns ) D(n) --Max ratio: 100
		where ScrollObjID = $ItemRefID and ID = $idx and D.n <= MT.Ratio;
	end

	set $idx = $idx + 1
	end

	if ((select count(*) from $LuckTable) > 0)
	begin
		declare $RandomItemCode varchar(128), $RandomItemCount int, $RandomItemOptLevel int
		select TOP 1 $RandomItemCode = LT.ItemCode, $RandomItemCount = LT.ItemCount, $RandomItemOptLevel = LT.ItemOptLevel from $LuckTable LT order by NEWID();

		-- reward
	end
end
While:
Code:
$MainTable table (ID int IDENTITY(1,1) NOT NULL, ScrollObjID int, ItemCode varchar(128), ItemCount int, ItemOptLevel int, Ratio int)
Hope Microsoft won't come to complain about my code, I am not an SQL coder, I am just giving this guy a hint to implement that thing.
#HB is offline  
Old 02/16/2019, 07:52   #4
 
ILowe's Avatar
 
elite*gold: 0
Join Date: Mar 2012
Posts: 677
Received Thanks: 29
Thank you

I tried but still 100%
I want to fail or successful
will give nothing if it fails

Sample :

Box open > Items in premium > successful
10% chance premium give after using

Box open > Items in premium > fail
Box disappears and nothing gets lost

ILowe is offline  
Old 02/16/2019, 10:41   #5
 
#HB's Avatar
 
elite*gold: 100
Join Date: Sep 2017
Posts: 1,097
Received Thanks: 889
Just think about it, put an item at your main table with a code like a fail code, item code example: "Failed", so this part will be like:
Code:
if ((select count(*) from $LuckTable) > 0)
	begin
		declare $RandomItemCode varchar(128), $RandomItemCount int, $RandomItemOptLevel int
		select TOP 1 $RandomItemCode = LT.ItemCode, $RandomItemCount = LT.ItemCount, $RandomItemOptLevel = LT.ItemOptLevel from $LuckTable LT where LT.ItemCode not in ('Failed') order by NEWID();

		-- reward
	end
Also, you can make a condition to check if the random item is an actual item in your database.
#HB is offline  
Thanks
1 User
Old 02/17/2019, 03:57   #6
 
ILowe's Avatar
 
elite*gold: 0
Join Date: Mar 2012
Posts: 677
Received Thanks: 29
Thank you all for <3
ILowe is offline  
Reply


Similar Threads Similar Threads
[Request] Hack for lucky streak/ lucky mode
03/27/2011 - Perfect World - 3 Replies
Is it possible to hack pwi, and give your self a lucky streak? To get it the hard way you have to find Duke Blacke, keep talking to him until he tells u a certain gem merchant is feeling lucky. You go and trade with gem merchant, and then u have a chance to get a lucky streak. Some people say that there's a 5% chance that will happen, but im not sure about the credibility. Also the lucky streak lasts untill u log off, and it will crit all lucky packs u get and stuff. I was just thinking it...
[Lucky Box] Hilfe
01/13/2011 - Flyff Private Server - 0 Replies
Hey ich und nen Freund machen uns im moment just for fun nen pserver für flyff für uns beide erstmal und wollen wissen wo das gespeichert ist was in den lucky boxen gesaugt wird.Bzw wie man die chancen von den items ändern kann die man saugt Über eine antworte wäre ich sehr erfreut euer diablo3333
[Request]A Lucky Box Item.
09/18/2010 - EO PServer Hosting - 7 Replies
i thought of making a Pack that Gives 1 item out of 7 with same chances, that it randomly choose it, i will be called Lucky Box, if anyone have the idea of making it please let me know PM me if you wont make it Public. Thank you.
Lucky Time HACK, for when u get lucky time
10/24/2006 - CO2 Exploits, Hacks & Tools - 6 Replies
when u go sit in guys thing given lucky time, light off firecracker to do another emotion becuse when doing it, it wont let, so lightfirecracker, then sit, when he leaves, ull still be getting lucky time



All times are GMT +2. The time now is 13:46.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.