Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- 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;
- }
- next;
- select "Exchange Points";
- 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, 0, 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", goldPoint)) {
- mes "[ ^C6A518Gold Room Assistant^000000 ]";
- mes "Sorry, you can't carry these gold bars.";
- close;
- }
- getitem "Gold", .@gpoint;
- goldPoint -= .@gpoint;
- close;
- case 3:
- .@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$, .@ppk);
- if (!.@nb) {
- mes "[ ^C6A518Gold Room Assistant^000000 ]";
- mes "No ranking yet";
- close;
- }
- for (.@i = 0; .@i < .@nb; ++.@i)
- mes "[ ^C6A518Gold Room Assistant^000000 ]";
- mes (.@i +1)+". "+ .@name$[.@i] +" - "+ .@ppk[.@i] +" Kills";
- close;
- case 4:
- .@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$, .@ppk);
- if (!.@nb) {
- mes "[ ^C6A518Gold Room Assistant^000000 ]";
- mes "No ranking yet";
- close;
- }
- for (.@i = 0; .@i < .@nb; ++.@i)
- mes "[ ^C6A518Gold Room Assistant^000000 ]";
- mes "You have "+ .@ppk[.@i] +" Kills";
- 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(PC_MAP) == "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
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement