Created
October 1, 2020 13:55
-
-
Save AnnieRuru/88e558b500a6e4afe00b559e7dcacd1b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
create table gold_room_ranking ( | |
char_id int primary key, | |
gold_point int, | |
key(`gold_point`) | |
) engine = innodb; | |
*/ | |
prontera,165,155,3 script Gold Room#tst 1_F_MARIA,{ | |
mes "[ ^C6A518Gold Room Assistant^000000 ]"; | |
mes "Whats up,basic people! I know you"; | |
mes "want to become rich! Well i have a"; | |
mes "place where you can find a very"; | |
mes "rare Birds"; | |
next; | |
mes "[ ^C6A518Gold Room Assistant^000000 ]"; | |
mes "And if you kill those birds you"; | |
mes "will gain a random amounth of Gold"; | |
mes "Points or GP and you can TRADE it"; | |
mes "into real GOLD!"; | |
next; | |
mes "[ ^C6A518Gold Room Assistant^000000 ]"; | |
mes "But there is something you should"; | |
mes "know... There are guardians that"; | |
mes "lurking around the map and they are strong!!"; | |
mes "^FF0000All of your points will lose when you die!^000000"; | |
next; | |
switch(select("~ Enter to Gold Room:~ Convert My Gold Points:~ Gold Room Ranking:~ My Ranking:~ Cancel")) { | |
case 1: | |
mes "[ ^C6A518Gold Room Assistant^000000 ]"; | |
mes "Sorry to disturb you,but I need to"; | |
mes "check if you're a bot."; | |
mes "Please type the correct captcha:"; | |
mes "FEE: ^FF0000"+ F_InsertComma(.zeny) +" Zeny^000000"; | |
for (.@i = 0; .@i < .strLen; ++.@i) | |
.@str$ += charat(.charSet$, rand(0, getstrlen(.charSet$))); | |
mes "Captcha: ^C6A518"+ .@str$ +"^000000"; | |
next; | |
input .@txt$; | |
if (.@txt$ != .@str$) { | |
mes "You have not inputted Correct."; | |
mes "Captcha"; | |
next; | |
atcommand "@kick "+ strcharinfo(0); | |
end; | |
} | |
if (Zeny < .zeny) { | |
mes "Sorry, but you can't enter the room."; | |
close; | |
} | |
Zeny -= .zeny; | |
warp "ordeal_1-2",151,154; | |
end; | |
case 2: | |
if (!goldPoint) { | |
mes "[ ^C6A518Gold Room Assistant^000000 ]"; | |
mes "Sorry, you don't have any Gold Points!"; | |
dispbottom "Gold Points: 0"; | |
close; | |
} | |
mes "[ ^C6A518Gold Room Assistant^000000 ]"; | |
mes "You got "+ goldPoint +" Gold Point."; | |
mes "How many points do you want to"; | |
mes "exchange in Gold?"; | |
mes " "; | |
mes "Each points are equivalent to ^FF00001^000000 Gold. "; | |
next; | |
if (input(.@gpoint, 1, 30000)) | |
close; | |
if (.@gpoint > goldPoint) { | |
mes "[ ^C6A518Gold Room Assistant^000000 ]"; | |
mes "Sorry, you don't have any Gold Points!"; | |
close; | |
} | |
mes "[ ^C6A518Gold Room Assistant^000000 ]"; | |
mes "Gained ^FF0000"+ .@gpoint +"^000000 x Gold."; | |
if (!checkweight("Gold", .@gpoint)) { | |
mes "[ ^C6A518Gold Room Assistant^000000 ]"; | |
mes "Sorry, you can't carry these gold bars."; | |
close; | |
} | |
getitem "Gold", .@gpoint; | |
goldPoint -= .@gpoint; | |
close; | |
case 3: | |
mes "[ ^C6A518Gold Room Assistant^000000 ]"; | |
.@nb = query_sql("select char_id as aaa, (select name from `char` where char_id = aaa), gold_point from gold_room_ranking where gold_point > 0 order by 3 desc limit 10", .@cid, .@name$, .@points); | |
if (!.@nb) { | |
mes "No ranking yet"; | |
close; | |
} | |
for (.@i = 0; .@i < .@nb; ++.@i) | |
mes (.@i +1)+". "+ .@name$[.@i] +" - "+ .@points[.@i] +" Points"; | |
close; | |
case 4: | |
mes "[ ^C6A518Gold Room Assistant^000000 ]"; | |
if (!query_sql("SELECT `gold_point`, 1+(SELECT COUNT(1) FROM `gold_room_ranking` t1 WHERE t1.`gold_point` > t2.`gold_point`) FROM `gold_room_ranking` t2 WHERE `char_id` = "+ getcharid(0), .@points, .@rank)) { | |
mes "You haven't made any kill"; | |
close; | |
} | |
mes "You are currently rank No."+ .@rank; | |
mes "You have "+ .@points +" Points"; | |
close; | |
default: | |
mes "[ ^C6A518Gold Room Assistant^000000 ]"; | |
mes "Goodbye~"; | |
close; | |
} | |
end; | |
OnInit: | |
.charSet$ = "0123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNOPQRSTUVWXYZ"; | |
.strLen = 4; // Sets how many characters for the generated confirmation code. | |
.zeny = 200000; // Entrance FEE for the room | |
monster "ordeal_1-2", 0,0, "Golden Peco", 1369, 500, strnpcinfo(0)+"::OnKilled"; | |
end; | |
OnKilled: | |
.@ppk = rand(1,3); // Points per kill | |
goldPoint += .@ppk; | |
dispbottom "You've earned "+ .@ppk +" Gold Point(s).[ Total:"+ goldPoint +" ]"; | |
monster "ordeal_1-2", 0,0, "Golden Peco", 1369, 1, strnpcinfo(0)+"::OnKilled"; | |
query_sql "insert into gold_room_ranking values ( "+ getcharid(0) +", "+ .@ppk +") on duplicate key update gold_point = gold_point +"+ .@ppk; | |
end; | |
OnPCDieEvent: | |
if (strcharinfo(3) == "ordeal_1-2") { | |
goldPoint = 0; | |
dispbottom "Sorry, but all of the Gold Points you have earned has vanished."; | |
} | |
end; | |
} | |
ordeal_1-2,153,154,4 script Exit 1_F_MARIA,{ | |
mes "[ ^C6A518Goldy^000000 ]"; | |
mes "Go back to Main Town?"; | |
if (select("Yes:No") == 2) close; | |
warp "SavePoint",0,0; | |
end; | |
} | |
//============Spawns================= | |
ordeal_1-2,0,0,0,0 monster Sword Guardian 1829,10,0,0,0 | |
ordeal_1-2,0,0,0,0 monster Sword Guardian 1829,10,0,0,0 | |
ordeal_1-2 mapflag nobranch | |
ordeal_1-2 mapflag noloot | |
ordeal_1-2 mapflag noexp | |
ordeal_1-2 mapflag nodrop | |
ordeal_1-2 mapflag noskill | |
ordeal_1-2 mapflag novending | |
ordeal_1-2 mapflag noreturn | |
ordeal_1-2 mapflag nowarp | |
ordeal_1-2 mapflag nowarpto | |
ordeal_1-2 mapflag nomemo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment