Advertisement
Innos

Slot Machine 2.0

Jun 28th, 2013
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 7.13 KB | None | 0 0
  1. //==========================================================//
  2. // Slot Maschine                                            //
  3. //==== Copyright ===========================================//
  4. // Innos '2013 für www.ex-ro.de                                //
  5. //==== Version =============================================//
  6. // V.1.0 - by Masao (Mr.Krabs 2010)                         //
  7. // V.2.0 - by Innos (2013)                                  //
  8. //==== Infos ===============================================//
  9. // Slot Maschine bei dem man die gleichen Zeichen in        //
  10. // einer von 3 Reihen bekommen muss.                        //
  11. //==========================================================//
  12.  
  13. prontera,189,192,3  script  Slot Maschine   563,{
  14.  
  15. //================================
  16. // Dead Branch Box DB: 25,0%
  17. // Gold GO: 15,0%
  18. // Convex Mirror CM: 10,0%
  19. // Yggdrassil Box YB: 10,0%
  20. // Old Card Album CA: 8,0%
  21. // Old Purple Box PB: 12,0%
  22. // Angel Wing AW: 2,0%
  23. // Incubus Doll ID: 1,0%
  24. // Storage Ticket ST: 5,0%
  25. // Taming Gift Set TS: 12,0%
  26. // VIP Silver TICKET VS:  1,0%
  27. // Bloody Branch 1ea BB:  3,0%
  28. // Event Ticket ET:  5,0%
  29. // Succubus Doll SD:  1,0%
  30. // AGI Rune: 3,0%
  31. // DEX Rune: 3,0%
  32. // INT Rune: 3,0%
  33. // LUK Rune: 3,0%
  34. // STR Rune: 3,0%
  35. // VIT Rune: 3,0%
  36. //================================
  37.  
  38.     set .@payment, 1000;
  39.  
  40.     if (zeny < .@payment){
  41.         mes "[Slot Maschine]";
  42.         mes "Kein Einsatz, kein Gewinn....";
  43.         mes "Verschwinde und besorg dir Zeny!";
  44.         close;
  45.     }
  46.     setarray @scratch_price, 12999,969,12214,13517,616,617,2254,21001,22001,12105,22012,12103,7711,21002,22020,22021,22022,22023,22024,22025;
  47.     setarray @scratch_name$, "Dead Branch Box","Gold","Convex Mirror","Yggdrassil Box","Old Card Album","Old Purple Box","Angel Wing","Incubus Doll","Storage Ticket","Taming Gift Set","VIP Silver Ticket","Bloody Branch","Event Ticket","Succubus Doll","Basic AGI Rune","Basic DEX Rune","Basic INT Rune","Basic LUK Rune","Basic STR Rune","Basic VIT Rune";
  48.     setarray @scratch_amount,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1;
  49.     setarray @scratch_sign$,"DB","GO","CM","YB","CA","PB","AW","ID","ST","TS","VS","BB","ET","SD","AR","DR","IR","LR","SR","VR";
  50.     setarray @scratch_chance,2500,1500,1000,1000,800,1200,500,100,300,100,800,400,500,100,300,300,300,300,300,300;
  51.     cleararray @slot$, "", 9;
  52.     for(set .@a, 0; .@a<getarraysize(@scratch_chance);set .@a, .@a+1){
  53.         for( set .@b, .@a+1; .@b<getarraysize(@scratch_chance); set .@b, .@b+1){
  54.             set @scratch_chance[.@a], @scratch_chance[.@a]+@scratch_chance[.@b];
  55.         }
  56.     }
  57.     query_sql("SELECT `name` FROM `ragsrvinfo`",.credits$);
  58.     mes "[Slot Maschine]";
  59.     mes "Hi, willst du ein Ticket?";
  60.     mes "Es kostet nur "+.@payment+" Zeny";
  61.     mes "Der Jackpot ist entweder eine ^660099Inccubus^000000 oder ^660099Succubus Doll^000000";
  62.     next;
  63. PLAY:
  64.     switch(select("^00CC00Los geht's:Wie spiele ich?:Top Zocker^000000:^777777Beenden^000000")) {
  65.         case 1:
  66.             if(.credits$ != "ExRO"){ set .cano,.cano+1;
  67.             if(.cano == 100){announce "[ Slot Maschine V.2.0 ]: powered by Innos for ExRO 2013",bc_all,0xb9d6f4; set .cano,0;}}
  68.             setarray .@row1, 0, 1, 2;
  69.             setarray .@row2, 0, 3, 6;
  70.             setarray .@row3, 0, 4, 8;
  71.             setarray .@row4, 1, 4, 7;
  72.             setarray .@row5, 6, 4, 2;
  73.             setarray .@row6, 2, 5, 8;
  74.             setarray .@row7, 3, 4, 5;
  75.             setarray .@row8, 6, 7, 8;
  76.            
  77.             set .@slots, 8;
  78.        
  79.             set zeny, zeny -.@payment;
  80.             set geldverzockt, geldverzockt +.@payment;
  81.             mes "Hier bitteschön ^^";
  82.            
  83.             function Slotbelegung;
  84.             function checkRow;
  85.             function Win;
  86.            
  87.             for(set .@a, 0;; set .@a, .@a+1)
  88.             {
  89.                 mes "";
  90.                 mes " [^660099"+@slot$[0]+"^000000]  ~|~  [^660099"+@slot$[1]+"^000000]  ~|~  [^660099"+@slot$[2]+"^000000]";
  91.                 mes "";
  92.                 mes " [^660099"+@slot$[3]+"^000000]  ~|~  [^660099"+@slot$[4]+"^000000]  ~|~  [^660099"+@slot$[5]+"^000000]";
  93.                 mes "";
  94.                 mes " [^660099"+@slot$[6]+"^000000]  ~|~  [^660099"+@slot$[7]+"^000000]  ~|~  [^660099"+@slot$[8]+"^000000]";
  95.                 next;
  96.                 if(.@a > 8) break;
  97.                 Slotbelegung(.@a);
  98.             }
  99.            
  100.             for(set .@a, 0; .@a<.@slots;set .@a,.@a+1)
  101.             {
  102.             set .@win, .@win+checkRow(getd(".@row"+(.@a+1)+"[0]"),getd(".@row"+(.@a+1)+"[1]"),getd(".@row"+(.@a+1)+"[2]"));
  103.             }
  104.  
  105.             if (.@win)
  106.             {
  107.             next;
  108.             mes "Du hast deinen Gewinn schon, versuch es nochmal.";
  109.             close;
  110.             }
  111.            
  112.             mes "Sorry, du hast nichts gewonnen.";
  113.             close;
  114.  
  115.         case 2:
  116.             mes "Du brauchst 3x das selbe Symbol in einer Reihe.";
  117.             mes "Das kann waagerecht, senkrecht oder diagonal sein.";
  118.             mes "Achte auf die Abkürzungen um zu sehen welcher Preis dir winkt.";
  119.             next;
  120.             mes "[^660099 DB ^000000] - DeadBrachBox";
  121.             mes "[^660099 GO ^000000] - Gold";
  122.             mes "[^660099 CM ^000000] - ConvexMirror";
  123.             mes "[^660099 YB ^000000] - YggdrasilBox";
  124.             mes "[^660099 CA ^000000] - OldCardAlbum";
  125.             mes "[^660099 PB ^000000] - OldPurpleBox";
  126.             mes "[^660099 AW ^000000] - AngelWings";
  127.             next;
  128.             mes "[^660099 ID ^000000] - InccubusDoll";
  129.             mes "[^660099 ST ^000000] - Storage Ticket";
  130.             mes "[^660099 TS ^000000] - TamingGiftSet";
  131.             mes "[^660099 VS ^000000] - VIP Silver Ticket";
  132.             mes "[^660099 BB ^000000] - BloodyBranch";
  133.             mes "[^660099 ET ^000000] - EventTicket";
  134.             mes "[^660099 SD ^000000] - SuccubusDoll";
  135.             next;
  136.             mes "[^660099 AR ^000000] - Basic AGI Rune";
  137.             mes "[^660099 SR ^000000] - Basic STR Rune";
  138.             mes "[^660099 DR ^000000] - Basic DEX Rune";
  139.             mes "[^660099 VR ^000000] - Basic VIT Rune";
  140.             mes "[^660099 LR ^000000] - Basic LUK Rune";
  141.             mes "[^660099 IR ^000000] - Basic INT Rune";
  142.             goto PLAY;
  143.        
  144.         case 3:
  145.             Query_SQL( "SELECT SUM(value) FROM `global_reg_value` WHERE `str` = 'geldverzockt'", .@gesamt);
  146.             mes "Insgesamt wurden bisher";
  147.             mes "(^008800"+.@gesamt+"^000000) Zeny verspielt";
  148.             mes " ";
  149.             set .@c, Query_SQL( "SELECT `char`.`name`, `var`.`value` FROM `global_reg_value` AS `var`, `char` WHERE `char`.`char_id` = `var`.`char_id` AND `var`.`str` = 'geldverzockt' ORDER BY CONVERT( `var`.`value`, SIGNED ) DESC LIMIT 10", .@name$, .@verzockt );
  150.    
  151.             if( .@c == 0 ) {
  152.                 mes "[^006600 Hall Of Fame ^000000]";
  153.                 mes "Noch kein Spieler eingetragen.";
  154.                 close;
  155.             }
  156.             mes "[^006600 Hall Of Fame: TOP " + .@c + " ^000000 ]";
  157.             for( set .@i, 0; .@i < .@c; set .@i, .@i + 1 )
  158.             mes "[^FF0000" + ( .@i + 1 ) + "^000000] ^0000FF" + .@name$[ .@i ] + "^000000 (^008800" + .@verzockt[ .@i ] + "^000000)z. ";
  159.             goto PLAY;
  160.            
  161.         case 4:
  162.             mes "[Slot Maschine]";
  163.             mes "Wie du willst.";
  164.             close;
  165.  
  166. }
  167.    
  168. function Slotbelegung {
  169.     set .@rand, rand(1,10000);
  170.     for(set .@b, 0; .@b<getarraysize(@scratch_sign$)-1;set .@b, .@b+1)
  171.     {
  172.         if(@scratch_chance[(getarraysize(@scratch_sign$)-1-.@b)] >= .@rand) break;
  173.     }
  174.     set @slot$[getarg(0)], @scratch_sign$[(getarraysize(@scratch_sign$)-1-.@b)];
  175. }
  176. function checkRow {
  177.     function Win;
  178.     if(@slot$[getarg(0)] == @slot$[getarg(1)] && @slot$[getarg(0)] == @slot$[getarg(2)])
  179.     {
  180.         Win(@slot$[getarg(0)]);
  181.         return 1;
  182.     }
  183.     return 0;
  184. }
  185. function Win {
  186.     for(set .@c,0; .@c<getarraysize(@scratch_sign$); set .@c,.@c+1)
  187.     {
  188.         if(getarg(0) == @scratch_sign$[.@c] )
  189.         {
  190.             mes "Du hast "+@scratch_sign$[.@c]+"!";
  191.             emotion e_no1;
  192.             getitem @scratch_price[.@c],@scratch_amount[.@c];
  193.             announce "[ Slot Maschine ] : "+strcharinfo(0)+" hat "+@scratch_name$[.@c]+" gewonnen !!",bc_map,0xb9d6f4;
  194.             break;
  195.         }
  196.     }
  197. }
  198.  
  199.    
  200. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement