kukubaczek

iCasino [v.0.3]

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