7mm

Skript: AquaHatch: CASINO[SLOT]

7mm
Dec 6th, 2019
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.97 KB | None | 0 0
  1. command /debug:
  2. trigger:
  3. if {debug::*} doesn't contain player:
  4. add player to {debug::*}
  5. else:
  6. remove player from {debug::*}
  7.  
  8. #スロット作成手順
  9. #1. /lbslot.pos <番号> でスロットにするブロックを指定
  10. #2. /itemid でパターンに入れるアイテムのIDを確認
  11. #3. /lbslot.create <ID> <使うPosの量> <パターン> でスロットを作成
  12. #4. /lbslot.opt.time <ID> <回転数> でスロットの回転数を指定
  13. #5. /lbslot.opt.addhit <ID> <HitID> <Pos> でヒットパターンを指定
  14. #6. /lbslot.opt.reward.hit <ID> <HitID> <報酬倍率> でヒットパターンごとの報酬倍率を指定
  15. #7. /lbslot.opt.reward.block <ID> <ブロック> <報酬量> でブロックパターンごとの報酬量を指定
  16. #8. /lbslot.opt.message <ID> <HitID> <メッセージ> でヒットパターンごとの個人向けのメッセージを指定
  17. #9. /lbslot.opt.broadcast <ID> <HitID> <メッセージ> でヒットパターンごとの全体向けのメッセージを指定
  18. #10. /lbslot.opt.chip <ID> <賭け金> でスロットを回すのに必要な賭け金を指定
  19. #11. /lbslot.execute <ID> @p をコマンドブロックに入れて終わり!
  20.  
  21. command /lbslot.pos <integer>:
  22. permission: lbslot.pos
  23. trigger:
  24. set {lbslot::player.%player%::pos::%arg 1%} to location of player's target block
  25. message "&albslot &7> &9pos &7> &fPos%arg 1%を %location of player's target block% に設定しました"
  26.  
  27. command /lbslot.create <text> <integer> <text>:
  28. permission: lbslot.create
  29. trigger:
  30. set {_args::*} to split arg 3 by ","
  31. loop {_args::*}:
  32. set {_loopcount} to 1
  33. set {_dot} to 1
  34. #message first character of loop-value
  35. if first character of loop-value is "*":
  36. set {_char::*} to loop-value split by ""
  37. set {_exitloop} to false
  38. loop {_char::*}:
  39. continue loop if {_exitloop} is true
  40. #message "... %loop-index-2%:%loop-value-2%"
  41. continue loop if loop-index-2 is "1"
  42. if loop-value-2 is ".":
  43. set {_loopcount} to substring of loop-value-1 from 2 to {_dot}
  44. set {_loopcount} to {_loopcount} parsed as integer
  45. #message "%{_dot}% %{_loopcount}%"
  46. add 2 to {_dot}
  47. set {_exitloop} to true
  48. continue loop
  49. set {_dot} to loop-index-2 parsed as integer
  50. #message "%{_dot}%,%{_loopcount}%"
  51. set {_value} to substring of loop-value-1 from {_dot} to length of loop-value-1
  52. #message "%{_value}%"
  53. loop {_loopcount} times:
  54. add 1 to {_index}
  55. message "%{_index}%:%{_value}%"
  56. set {lbslot::slot.%arg 1%::pattern::%{_index}%} to {_value} parsed as itemtype
  57. loop arg-2 times:
  58. set {lbslot::slot.%arg 1%::location::%loop-number%} to {lbslot::player.%player%::pos::%loop-number%}
  59. message "&albslot &7> &6create &7> &fスロット ""%arg 1%"" を作成しました"
  60.  
  61. command /lbslot.remove <text>:
  62. permission: lbslot.remove
  63. trigger:
  64. message "&albslot &7> &6remove &7> &fスロット ""%arg 1%"" を削除しました"
  65. clear {lbslot::slot.%arg 1%::*}
  66.  
  67. command /lbslot.opt.pattern <text> <text>:
  68. permission: lobslot.opt.pattern
  69. trigger:
  70. clear {lbslot::slot.%arg 1%::pattern::*}
  71. message "&albslot &7> &6opt &7> &9pattern &7> &fスロット ""%arg 1%"" のパターンを変更しました"
  72. set {_args::*} to split arg 2 by ","
  73. loop {_args::*}:
  74. set {_loopcount} to 1
  75. set {_dot} to 1
  76. #message first character of loop-value
  77. if first character of loop-value is "*":
  78. set {_char::*} to loop-value split by ""
  79. set {_exitloop} to false
  80. loop {_char::*}:
  81. continue loop if {_exitloop} is true
  82. #message "... %loop-index-2%:%loop-value-2%"
  83. continue loop if loop-index-2 is "1"
  84. if loop-value-2 is ".":
  85. set {_loopcount} to substring of loop-value-1 from 2 to {_dot}
  86. set {_loopcount} to {_loopcount} parsed as integer
  87. #message "%{_dot}% %{_loopcount}%"
  88. add 2 to {_dot}
  89. set {_exitloop} to true
  90. continue loop
  91. set {_dot} to loop-index-2 parsed as integer
  92. #message "%{_dot}%,%{_loopcount}%"
  93. set {_value} to substring of loop-value-1 from {_dot} to length of loop-value-1
  94. #message "%{_value}%"
  95. loop {_loopcount} times:
  96. add 1 to {_index}
  97. message "%{_index}%:%{_value}%"
  98. set {lbslot::slot.%arg 1%::pattern::%{_index}%} to {_value} parsed as itemtype
  99.  
  100. command /lbslot.opt.pos <text> <integer>:
  101. permission: lobslot.opt.pos
  102. trigger:
  103. clear {lbslot::slot.%arg 1%::location::*}
  104. message "&albslot &7> &6opt &7> &9pattern &7> &fスロット ""%arg 1%"" のブロック位置を変更しました"
  105. loop arg-2 times:
  106. set {lbslot::slot.%arg 1%::location::%loop-number%} to {lbslot::player.%player%::pos::%loop-number%}
  107.  
  108. command /lbslot.opt.time <text> <integer>:
  109. permission: lobslot.opt.pattern
  110. trigger:
  111. message "&albslot &7> &6opt &7> &9pattern &7> &fスロット ""%arg 1%"" の回転数を &e%arg 2% &fに変更しました"
  112. set {lbslot::slot.%arg 1%::loop} to arg 2
  113.  
  114. command /lbslot.opt.addhit <text> <text> <text>:
  115. permission: lobslot.opt.addhit
  116. trigger:
  117. message "&albslot &7> &6opt &7> &9addhit &7> &fスロット ""%arg 1%"" に新しいヒットパターンを追加しました"
  118. message "&a名前: %arg 2% / パターン: %arg 3%"
  119. set {_args::*} to split arg 3 by ","
  120. loop {_args::*}:
  121. set {lbslot::slot.%arg 1%::hit::%arg 2%} to true
  122. add loop-value to {lbslot::slot.%arg 1%::hit::%arg 2%::*}
  123.  
  124. command /lbslot.opt.remhit <text> <text>:
  125. permission: lobslot.opt.remhit
  126. trigger:
  127. message "&albslot &7> &6opt &7> &9remhit &7> &fスロット ""%arg 1%"" から"
  128. message "&fヒットパターン ""%arg 2%"" を削除しました"
  129. clear {lbslot::slot.%arg 1%::hit::%arg 2%}
  130. clear {lbslot::slot.%arg 1%::hit::%arg 2%::*}
  131.  
  132. command /lbslot.opt.message <text> <text> <text>:
  133. permission: lobslot.opt.message
  134. trigger:
  135. message "&albslot &7> &6opt &7> &9message &7> &fスロット ""%arg 1%"" ヒットパターン ""%arg 2%"" の"
  136. message "&fメッセージを設定しました"
  137. set {lbslot::slot.%arg 1%::hit.message::%arg 2%} to arg 3
  138.  
  139. command /lbslot.opt.broadcast <text> <text> <text>:
  140. permission: lobslot.opt.broadcast
  141. trigger:
  142. message "&albslot &7> &6opt &7> &9broadcast &7> &fスロット ""%arg 1%"" ヒットパターン ""%arg 2%"" の"
  143. message "&f全体メッセージを設定しました"
  144. set {lbslot::slot.%arg 1%::hit.broadcast::%arg 2%} to arg 3
  145.  
  146. command /lbslot.opt.reward.hit <text> <text> <number>:
  147. permission: lobslot.opt.reward.hit
  148. trigger:
  149. message "&albslot &7> &6opt &7> &9reward.hit &7> &fスロット ""%arg 1%"" ヒットパターン ""%arg 2%"" の"
  150. message "&f報酬倍率を &e%arg 3% &fに設定しました"
  151. set {lbslot::slot.%arg 1%::hit.reward::%arg 2%} to arg 3
  152.  
  153. command /lbslot.opt.reward.block <text> <text> <integer>:
  154. permission: lobslot.opt.reward.block
  155. trigger:
  156. set {_arg2} to arg 2
  157. replace all "_" with " " in {_arg2}
  158. set {_arg2} to {_arg2} parsed as itemtype
  159. message "&albslot &7> &6opt &7> &9reward.block &7> &fスロット ""%arg 1%"" ブロック %{_arg2}% の"
  160. message "&f報酬額を &e%arg 3% &fに設定しました"
  161. set {lbslot::slot.%arg 1%::reward::%{_arg2}%} to arg 3
  162.  
  163. command /lbslot.opt.chip <text> <integer>:
  164. permission: lobslot.opt.reward.block
  165. trigger:
  166. message "&albslot &7> &6opt &7> &9chip &7> &fスロット ""%arg 1%"" の賭け金を %arg 2% に設定しました"
  167. set {lbslot::slot.%arg 1%::chip} to arg 2
  168.  
  169. command /lbslot.force.doingcancel <text>:
  170. permission: lbslot.force.doingcancel
  171. trigger:
  172. message "&albslot &7> &e&lFORCE &7> &9doingcancel &7> &c&ldoing を解除しました"
  173. set {lbslot::slot.%arg 1%::stat::doing} to false
  174.  
  175. command /lbslot.execute <text> <player>:
  176. permission: lbslot.execute
  177. trigger:
  178. if {lbslot::slot.%arg 1%::chip} > {casino::player.%arg 2%::stat::coin}:
  179. message "&a&llbslot &7> &cコインが必要数に足りていません (&e%{casino::player.%arg 2%::stat::coin}%/%{lbslot::slot.%arg 1%::chip}%&c)" to arg 2
  180. stop
  181. if {lbslot::slot.%arg 1%::stat::doing} is true:
  182. message "&a&llbslot &7> &cスロットが回転中です" to arg 2
  183. stop
  184. remove {lbslot::slot.%arg 1%::chip} from {casino::player.%arg 2%::stat::coin}
  185. message "&9&llbslot &7> &e%arg 2% Roll %arg 1% &7(Debug Message)" to {debug::*}
  186. set {lbslot::slot.%arg 1%::stat::doing} to true
  187. set {lbslot::slot.%arg 1%::loop} to 8 if {lbslot::slot.%arg 1%::loop} is not set
  188. set {_blocks::*} to {lbslot::slot.%arg 1%::pattern::*}
  189. loop {lbslot::slot.%arg 1%::location::*}:
  190. set block at location of loop-value to bedrock
  191. loop {lbslot::slot.%arg 1%::location::*}:
  192. loop {lbslot::slot.%arg 1%::loop} times:
  193. set {_blocks.::*} to {_blocks::*}
  194. remove {_block} from {_blocks.::*}
  195. set {_block} to random element out of {_blocks.::*}
  196. set block at location of loop-value-1 to {_block}
  197. command "execute %arg 2% ~ ~ ~ playsound block.stone.place master @p ~ ~ ~ 0.3 1 0.1"
  198. wait 1 tick
  199. command "execute %arg 2% ~ ~ ~ playsound block.stone.place master @p ~ ~ ~ 1.0 0.5 0.5"
  200. add {_block} to {_result::*}
  201. clear {_block}
  202. set {lbslot::slot.%arg 1%::stat::doing} to false
  203. loop {lbslot::slot.%arg 1%::hit::*}:
  204. set {_result} to true
  205. clear {_dice-prev}
  206. clear {_dice}
  207. loop {lbslot::slot.%arg 1%::hit::%loop-index%::*}:
  208. set {_dice-prev} to {_dice}
  209. set {_dice} to {_result::%loop-value-2%}
  210. continue loop if {_dice-prev} is not set
  211. set {_result} to false if {_dice} isn't {_dice-prev}
  212. {_result} is true
  213. add 1 to {_hits}
  214. command "execute %arg 2% ~ ~ ~ playsound entity.player.levelup master @p ~ ~ ~ 1.0 0.5 0.5"
  215. set {_reward} to floor({lbslot::slot.%arg 1%::reward::%{_dice}%}*{lbslot::slot.%arg 1%::hit.reward::%loop-index%})
  216. set {_mes} to colored {lbslot::slot.%arg 1%::hit.message::%loop-index%}
  217. replace all "[p]" with "%arg 2%" in {_mes}
  218. replace all "[r]" with "%{_reward}%" in {_mes}
  219. message "&a&llbslot &7> %{_mes}%" to arg 2 if {_mes} is set
  220. message "&a&llbslot &7> &e&lHIT! %{_reward}%coins" to arg 2 if {_mes} is not set
  221. set {_brc} to colored {lbslot::slot.%arg 1%::hit.broadcast::%loop-index%}
  222. replace all "[p]" with "%arg 2%" in {_brc}
  223. replace all "[r]" with "%{_reward}%" in {_brc}
  224. broadcast "&a&llbslot &7> %{_brc}%" if {_brc} is set
  225. message "&9&llbslot &7> &e%arg 2% &bSucc %arg 1% &7(Debug Message)" to {debug::*}
  226. add {_reward} to {casino::player.%arg 2%::stat::coin}
  227. {_hits} is not set
  228. command "execute %arg 2% ~ ~ ~ playsound entity.player.burp master @p ~ ~ ~ 1.0 1.0 0.5"
  229. message "&9&llbslot &7> &e%arg 2% &cFail %arg 1% &7(Debug Message)" to {debug::*}
Add Comment
Please, Sign In to add comment