kukubaczek

iCasino [v.0.4]

Apr 13th, 2014
933
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 12.11 KB | None | 0 0
  1. #------------------------------#
  2. #                              #
  3. #            iCasino           #
  4. #             v. 0.4           #
  5. #         by kukubaczek        #
  6. #                              #
  7. #------------------------------#
  8.  
  9. #------------------------------#
  10. #         Kongiguracja         #
  11. #------------------------------#
  12.  
  13. options:
  14.     tag: &ai&bCasino &6>&r
  15.             #  /\  Co ma sie wyswietlac przed wiadomosciami
  16.  
  17.     slots-los: 10
  18.             #  /\  Cena losowania w grze Slots
  19.     slots-win: 25
  20.             #  /\  Ilosc zdobytych zetonow po wygranej w grze Slots (1 zeton = 10 monet)
  21.  
  22.     cards-gra: 5
  23.             #  /\  Koszt gry Cards
  24.     cards-win: 1
  25.             #  /\  Ilosc zdobytych zetonow po wygranej w grze cards (nie polecam zmieniac) (1 zeton = 10 monet)
  26.  
  27.     coins-gra: 6
  28.             #  /\  Koszt gry Coins
  29.     coins-win: 1
  30.             #  /\  Ilosc zdobytych zetonow po wygranej w grze Coins (1 zeton = 10 monet)
  31.  
  32.     lotto-gra: 10
  33.             #  /\  Koszt losowania Lotto
  34.     lotto-win: 100
  35.             #  /\  Ilosc zdobytych zetonow po wygranej w grze Lotto (1 zeton = 10 monet)
  36.     lotto-startlosowania: 1
  37.             #  /\  Ile graczy ma obstawic w lotto, aby zaczac losowanie
  38.  
  39.     scoreboard-odswiezanie: 1
  40.             #  /\  Czas w sekundach co ile ma sie odswiezac scoreboard
  41.  
  42. #------------------------------#
  43. #          Variables           #
  44. #------------------------------#
  45.  
  46. variables:
  47.     {zetony.%player%} = 0
  48. #------------------------------#
  49. #                              #
  50. #            Ogolne            #
  51. #                              #
  52. #------------------------------#
  53.  
  54. command /zetony [<offlineplayer>]:
  55.     trigger:
  56.         if arg 1 is not set:
  57.             send "{@tag} &aMasz &b%{zetony.%player%}% &azetonow. Wymien je przy wyjsciu, inaczej je stracisz."
  58.             stop
  59.         else:
  60.             send "{@tag} &aGracz &b%arg 1% &ama &b%{zetony.%arg 1%}% &azetonow."
  61.             stop
  62.  
  63. on quit:
  64.     player do not have permission "casino.zachowanie.zetonow":
  65.         set {zetony.%player%} to 0
  66.         stop
  67.  
  68. on leave of region "kasyno":
  69.     if {zetony.%player%} is 0:
  70.         send "{@tag} Zapraszamy ponownie!"
  71.         stop
  72.     else:
  73.         send "{@tag} Przepadlo twoje %{zetony.%player%}% zetonow, bo opusciles kasyno."
  74.         send "{@tag} Zapraszamy ponownie!"
  75.     set {zetony.%player%} to 0
  76.     stop
  77.  
  78. on entering of region "kasyno":
  79.     send "{@tag} Witamy w Kasynie!"
  80.     stop
  81.  
  82. command /sellzetony:
  83.     trigger:
  84.         player has permission "admin.sellzetony":
  85.             spawn a priest
  86.             set the name of last spawned entity to "&eZetony"
  87.             apply slowness 100 to last spawned entity for 9999 days
  88.             apply regeneration 100 to last spawned entity for 9999 days
  89.             stop
  90.  
  91. command /addzetony <number> <player>:
  92.     trigger:
  93.         player has permission "admin.addzetony":
  94.             add arg 1 to {zetony.%arg 2%}
  95.             send "{@tag} &eDodano %arg 1% zetonow do gracza %arg 2%."
  96.             stop
  97.  
  98. on right click on priest:
  99.     if name of entity is "&eZetony":
  100.         cancel event
  101.         if {zetony.%player%} is greater than 0:
  102.             set {_zetonysell} to {zetony.%player%} * 10
  103.             add {_zetonysell} to player's balance
  104.             send "{@tag} &eWymieniles &a%{zetony.%player%}%&e zetonow na &a%{_zetonysell}%&e monet. Masz &a%player's money% &emonet!"
  105.             set {zetony.%player%} to 0
  106.             stop
  107.         else:
  108.             send "{@tag} &cMasz &f%{zetony.%player%}% &czetonow, zdabadz troche aby wymienic."
  109.             stop
  110.  
  111. on damage:
  112.     if victim is priest:
  113.         if name of victim is "&eZetony":
  114.             if attacker has permission "admin.sellzetony.zabijanie":
  115.                 kill the victim
  116.                 stop
  117.             else:
  118.                 cancel event
  119.                 stop
  120.  
  121. #------------------------------#
  122. #       Tabliczki do gier"     #
  123. #------------------------------#
  124.  
  125. on sign change:
  126.     player has permission "kasino.slots.sign":
  127.         if line 1 of block is "-Slots-":
  128.             set line 1 to "&eCasino"
  129.             set line 3 to "○○○"
  130.             set line 2 to "&1-&b&lSlots&1-"
  131.             set line 4 to "&2[&aReady&2]"
  132.             send "{@tag} Utworzyles gre Slots!"
  133.             stop
  134.         if line 1 is "-Cards-":
  135.             set line 1 to "&eCasino"
  136.             set line 2 to "&1-&b&lCards&1-"
  137.             set line 4 to "&2[&aReady&2]"
  138.             send "{@tag} Utworzyles gre Cards!"
  139.             stop
  140.         if line 1 is "-Coins-":
  141.             set line 1 to "&eCasino"
  142.             set line 2 to "&f&l■■ &0&l■■"
  143.             set line 3 to "&f&l■■ &0&l■■"
  144.             set line 4 to "&f[LPM] &0[PPM]"
  145. on break a sign:
  146.     if line 1 of block is "&eCasino":
  147.         player has permission "casino.signdestroy":
  148.             send "{@tag} Zniszczyles gre z Casina."
  149.             stop
  150.         else:
  151.             cancel event
  152.             stop
  153.  
  154. #------------------------------#
  155. #       Jednoręki bandyta      #
  156. #------------------------------#
  157.  
  158. on right click on sign:
  159.     if line 1 of block is "&eCasino":
  160.         line 2 of block is "&1-&b&lSlots&1-"
  161.         line 4 of block is "&2[&aReady&2]"
  162.         if {@slots-los} is greater than player's money:
  163.             message "{@tag} &cMasz za malo kasy, aby zagrac w &2Slots&c! &aKoszt gry: &b{@slots-los} &akasy!"
  164.             stop
  165.         remove {@slots-los} from player's balance
  166.         set line 4 of block to "&4[&cPlaying&4]"
  167.         loop 60 times:
  168.             set {_znak1} to a random integer between 1 and 10
  169.             set {_znak2} to a random integer between 1 and 10
  170.             set {_znak3} to a random integer between 1 and 10
  171.             if {_znak1} is 1:
  172.                 set {_znak1} to "■"
  173.             if {_znak1} is 2:
  174.                 set {_znak1} to "&c♥&r"
  175.             if {_znak1} is 3:
  176.                 set {_znak1} to "&c♦&r"
  177.             if {_znak1} is 4:
  178.                 set {_znak1} to "♣"
  179.             if {_znak1} is 5:
  180.                 set {_znak1} to "♠"
  181.             if {_znak1} is 6:
  182.                 set {_znak1} to "○"
  183.             if {_znak1} is 7:
  184.                 set {_znak1} to "•"
  185.             if {_znak1} is 8:
  186.                 set {_znak1} to "&e☼&r"
  187.             if {_znak1} is 9:
  188.                 set {_znak1} to "&6▲&r"
  189.             if {_znak1} is 10:
  190.                 set {_znak1} to "&9▼&r"
  191.             if {_znak2} is 1:
  192.                 set {_znak2} to "■"
  193.             if {_znak2} is 2:
  194.                 set {_znak2} to "&c♥&r"
  195.             if {_znak2} is 3:
  196.                 set {_znak2} to "&c♦&r"
  197.             if {_znak2} is 4:
  198.                 set {_znak2} to "♣"
  199.             if {_znak2} is 5:
  200.                 set {_znak2} to "♠"
  201.             if {_znak2} is 6:
  202.                 set {_znak2} to "○"
  203.             if {_znak2} is 7:
  204.                 set {_znak2} to "•"
  205.             if {_znak2} is 8:
  206.                 set {_znak2} to "&e☼&r"
  207.             if {_znak2} is 9:
  208.                 set {_znak2} to "&6▲&r"
  209.             if {_znak2} is 10:
  210.                 set {_znak2} to "&9▼&r"
  211.             if {_znak3} is 1:
  212.                 set {_znak3} to "■"
  213.             if {_znak3} is 2:
  214.                 set {_znak3} to "&c♥&r"
  215.             if {_znak3} is 3:
  216.                 set {_znak3} to "&c♦&r"
  217.             if {_znak3} is 4:
  218.                 set {_znak3} to "♣"
  219.             if {_znak3} is 5:
  220.                 set {_znak3} to "♠"
  221.             if {_znak3} is 6:
  222.                 set {_znak3} to "○"
  223.             if {_znak3} is 7:
  224.                 set {_znak3} to "•"
  225.             if {_znak3} is 8:
  226.                 set {_znak3} to "&e☼&r"
  227.             if {_znak3} is 9:
  228.                 set {_znak3} to "&6▲&r"
  229.             if {_znak3} is 10:
  230.                 set {_znak3} to "&9▼&r"
  231.             set line 3 of block to "%{_znak1}% %{_znak2}% %{_znak3}%"
  232.             wait 1 tick
  233.         set line 4 of block to "&2[&aReady&2]"
  234.         if {_znak1} is {_znak2}:
  235.             if {_znak1} is {_znak3}:
  236.                 add {@slots-win} to {zetony.%player%}
  237.                 send "{@tag} &a%player% &6wygral w grze &b&lSlots &e{@slots-win} &azetonow!"
  238.                 send "{@tag} &aMasz juz &e%{zetony.%player%}% &azetonow!"
  239.                 stop
  240.  
  241. #------------------------------#
  242. #          Trzy karty          #
  243. #------------------------------#
  244.  
  245. on right click on sign:
  246.     if line 1 of block is "&eCasino":
  247.         line 2 of block is "&1-&b&lCards&1-"
  248.         line 4 of block is "&2[&aReady&2]"
  249.         if {@cards-gra} is greater than player's money:
  250.             message "{@tag} &cMasz za malo kasy, aby zagrac w &2Cards&c! &aKoszt gry: &b{@cards-gra} &akasy!"
  251.             stop
  252.         remove {@cards-gra} from player's balance
  253.         set {_karta} to random integer between 1 and 4
  254.         set line 4 to "&6[&eMixing&6]"
  255.         wait 1 second
  256.         if {_karta} is 2 or 3:
  257.             set line 3 to "&l■"
  258.             set line 4 to "&4[&cLose&4]"
  259.             wait 2 seconds
  260.             set line 4 to "&2[&aReady&2]"
  261.             stop
  262.         if {_karta} is 4:
  263.             set line 3 to "&f&l■"
  264.             set line 4 to "&2[&aWIN&2]"
  265.             add {@cards-win} to {zetony.%player%}
  266.             send "{@tag} &aWygrales {@cards-win} zetona!"
  267.             wait 25 ticks
  268.             set line 4 to "&2[&aReady&2]"
  269.             stop
  270.         stop
  271.  
  272. #------------------------------#
  273. #           Coin Toss          #
  274. #------------------------------#
  275.  
  276. on leftclick on sign:
  277.     if line 1 of block is "&eCasino":
  278.         line 2 of block is "&f&l■■ &0&l■■"
  279.         line 3 of block is "&f&l■■ &0&l■■"
  280.         if {@coins-gra} is greater than player's money:
  281.             message "{@tag} &cMasz za malo kasy, aby zagrac w &2Coins&c! &aKoszt gry: &b{@coins-gra} &akasy!"
  282.             stop
  283.         remove {@coins-gra} from player's balance
  284.         if line 4 of block is "&f[LPM] &0[PPM]":
  285.             set {_kolor} to random integer between 1 and 3
  286.             wait 5 ticks
  287.             if {_kolor} is 2:
  288.                 set line 4 to "&4[&cLose&4]"
  289.                 set line 3 to "&0&l■■"
  290.                 set line 2 to "&0&l■■"
  291.                 wait 1 second
  292.                 set line 2 to "&f&l■■ &0&l■■"
  293.                 set line 3 to "&f&l■■ &0&l■■"
  294.                 set line 4 to "&f[LPM] &0[PPM]"
  295.             if {_kolor} is 3:
  296.                 set line 4 to "&2[&aWIN&2]"
  297.                 set line 3 to "&f&l■■"
  298.                 set line 2 to "&f&l■■"
  299.                 wait 1 second
  300.                 set line 2 to "&f&l■■ &0&l■■"
  301.                 set line 3 to "&f&l■■ &0&l■■"
  302.                 send "{@tag} &aWygrales {@cards-win} zetona!"
  303.                 set line 4 to "&f[LPM] &0[PPM]"
  304.                 add {@coins-win} to {zetony.%player%}
  305.                 stop
  306.  
  307. on rightclick on sign:
  308.     if line 1 of block is "&eCasino":
  309.         line 2 of block is "&f&l■■ &0&l■■"
  310.         line 3 of block is "&f&l■■ &0&l■■"
  311.         if {@coins-gra} is greater than player's money:
  312.             message "{@tag} &cMasz za malo kasy, aby zagrac w &2Coins&c! &aKoszt gry: &b{@coins-gra} &akasy!"
  313.             stop
  314.         remove {@coins-gra} from player's balance
  315.         if line 4 of block is "&f[LPM] &0[PPM]":
  316.             set {_kolor} to random integer between 1 and 3
  317.             wait 5 ticks
  318.             if {_kolor} is 2:
  319.                 set line 4 to "&2[&aWIN&2]"
  320.                 set line 3 to "&0&l■■"
  321.                 set line 2 to "&0&l■■"
  322.                 wait 1 second
  323.                 set line 2 to "&f&l■■ &0&l■■"
  324.                 set line 3 to "&f&l■■ &0&l■■"
  325.                 set line 4 to "&f[LPM] &0[PPM]"
  326.                 add {@coins-win} to {zetony.%player%}
  327.                 send "{@tag} &aWygrales {@cards-win} zetona!"
  328.             if {_kolor} is 3:
  329.                 set line 4 to "&4[&cLose&4]"
  330.                 set line 3 to "&f&l■■"
  331.                 set line 2 to "&f&l■■"
  332.                 wait 1 second
  333.                 set line 2 to "&f&l■■ &0&l■■"
  334.                 set line 3 to "&f&l■■ &0&l■■"
  335.                 set line 4 to "&f[LPM] &0[PPM]"
  336.                 stop
  337.        
  338.  
  339. #------------------------------#
  340. #             Lotto            #
  341. #------------------------------#
  342.  
  343. command /obstaw [<integer>]:
  344.     usage: /obstaw <liczba obstawiona 0-100>
  345.     aliases: /lotto
  346.     trigger:
  347.         if arg 1 is set:
  348.             if {@lotto-gra} is greater than player's money:
  349.                 message "{@tag} &cMasz za malo kasy, aby zagrac w &2Cards&c! &aKoszt gry: &b{@lotto-gra} &akasy!"
  350.                 stop
  351.             remove {@lotto-gra} from player's balance
  352.             loop 100 times:
  353.                 if arg 1 is loop-number:
  354.                     send "{@tag} Postawiles liczbe %arg 1%, losowanie odbedzie sie gdy bedzie bralo w nim udzial wiecej niz {@lotto-startlosowania} graczy!"
  355.                     set {lotto.%player%} to arg 1
  356.                     add 1 to {lotto-start}
  357.                     if {lotto-start} is greater than {@lotto-startlosowania}:
  358.                         set {_losowanie} to random integer between 0 and 100
  359.                         send "{@tag} Rozpoczynanie losowania..." to all players
  360.                         wait 1 second
  361.                         send "{@tag} Wylosowana liczba to %{_losowanie}%!" to all players
  362.                         send "{@tag} Sprawdzanie czy ktos wygral..." to all players
  363.                         wait 2 seconds
  364.                         loop all players:
  365.                             if {lotto.%loop-player%} is {_losowanie}:
  366.                                 send "{@tag} Gracz %loop-player% wygral Lotto! Dostaje {@lotto-win} zetonow!" to all players
  367.                                 add {@lotto-win} to {zetony.%player%}
  368.                                 stop
  369.                             else:
  370.                                 send "{@tag} Niestety nikt nie wygral..."
  371.                                 stop
  372.                             clear {lotto.%loop-player%}
  373.                             set {lotto-start} to 0
  374.                             stop
  375.                     stop
  376.                 else:
  377.                     send "{@tag} Postaw liczbe 1-100!"
  378.         else:
  379.             send "{@tag} Poprawnie: /obstaw <liczba obstawiona 1-100>. Koszt: {@lotto-gra}."
  380.  
  381. #------------------------------#
  382. #          Scoreboard          #
  383. #------------------------------#
  384.  
  385. every {@scoreboard-odswiezanie} seconds:
  386.     loop all players:
  387.         set {_gracze} to number of all players
  388.         set {_zetony} to {zetony.%loop-player%}
  389.         set {_money} to loop-player's balance
  390.         display board named "&a&li&b&lCasino" to loop-player
  391.         make score "&7Zetony:" in board of loop-player to {_zetony}
  392.         make score "&7Kasa:" in board of loop-player to {_money}
  393.         make score "&7Online:" in board of loop-player to {_gracze}
  394.         move display of loop-player to "sidebar"
  395.         stop
Advertisement
Add Comment
Please, Sign In to add comment