Advertisement
Guest User

Untitled

a guest
Oct 18th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.44 KB | None | 0 0
  1. #Slave Market
  2. #thewormy / jordanleevan
  3.  
  4.  
  5. options:
  6. P: &8[&6Slave Market&8]&7
  7. C: &7
  8. H: &e
  9.  
  10. command /slave [<text>] [<text>] [<text>]:
  11. permission: skript.op
  12. aliases: /sm
  13. trigger:
  14.  
  15. if arg-1 is set:
  16. if arg-1 is "owner":
  17. if arg-2 is set:
  18. if arg-2 is "add":
  19. if arg-3 is set:
  20.  
  21. if {sm::slaveOwner::%arg-3%} is set:
  22. send "{@P} %arg-3% is already a slave owner"
  23. else if {sm::sOwnerCount} is greater than 7:
  24. send "{@P} There are already 8 slave owners"
  25. else:
  26. if {sm::diamonds} is not set:
  27. set {sm::diamonds} to 30
  28. send "{@P} Diamonds set to 30!"
  29. increase {sm::sOwnerCount} by 1
  30. set {sm::slaveOwner::%arg-3%} to true
  31. console command "give %arg-3% diamond %{sm::diamonds}%"
  32.  
  33. if {sm::teamNumber} is not set:
  34. set {sm::teamNumber} to 1
  35. player command "/team reset"
  36. else:
  37. increase {sm::teamNumber} by 1
  38.  
  39. player command "/team create"
  40. player command "/team set %arg-3% %{sm::teamNumber}%"
  41.  
  42. broadcast "{@P} {@H}%arg-3% {@C}is now a slave master!"
  43.  
  44. else:
  45. send "{@P} /slave owner <add> <player>"
  46.  
  47.  
  48.  
  49. else if arg-2 is "list":
  50. send "{@P} Slave Owners: "
  51. loop all players:
  52. if {sm::slaveOwner::%loop-player%} is true:
  53. send "- %loop-player%"
  54.  
  55.  
  56. else if arg-1 is "start":
  57. if {sm::Running} is set:
  58. send "{@P} Slave market already running!"
  59. send "{@P} {@H}/sm end {@C}to end current slave market"
  60. else:
  61. set {sm::Running} to true
  62. if {sm::diamonds} is not set:
  63. set {sm::diamonds} to 30
  64. send "{@P} Diamonds set to 30!"
  65.  
  66. loop all players:
  67. if {sm::slaveOwner::%loop-player%} is not set:
  68. if {sm::ignore::%loop-player%} is not set:
  69. add loop-player to {sm::slaves::*}
  70.  
  71. player command "/chat mute"
  72.  
  73. set {sm::currentSlave} to (random element of {sm::slaves::*})
  74. while {sm::currentSlave} is offline:
  75. delete {sm::currentSlave}
  76. set {sm::currentSlave} to (random element of {sm::slaves::*})
  77.  
  78. set {sm::currentBid} to -1
  79. set {sm::bidTimer} to 15
  80.  
  81. broadcast "{@P} {@H}%{sm::currentSlave}% {@C}is now up for auction!"
  82. loop all players:
  83. if {sm::slaveOwner::%loop-player%} is set:
  84. send "{@P} Use {@H}/bid {@C}to bid!"
  85.  
  86.  
  87.  
  88. else if arg-1 is "ignore":
  89. if arg-2 is set:
  90. if arg-2 is "add" or "remove":
  91. arg-3 is set
  92. if {sm::ignore::%arg-3%} is set:
  93. delete {sm::ignore::%arg-3%}
  94. send "{@P} %arg-3% removed from ignore list"
  95. else:
  96. set {sm::ignore::%arg-3%} to true
  97. send "{@P} %arg-3% added to ignore list"
  98.  
  99. else:
  100. if {sm::ignore::%arg-2%} is set:
  101. delete {sm::ignore::%arg-2%}
  102. send "{@P} %arg-2% removed from ignore list"
  103. else:
  104. set {sm::ignore::%arg-2%} to true
  105. send "{@P} %arg-2% added to ignore list"
  106. else:
  107. send "{@P} /slave ignore <add:remove:player*> <player*>"
  108.  
  109. else if arg-1 is "diamonds":
  110. if arg-2 is set:
  111. if arg-2 is "set":
  112. arg-3 is set
  113. set {_diamonds} to arg-3 parsed as number
  114. if {_diamonds} is not less than 1:
  115. set {sm::diamonds} to {_diamonds}
  116. send "{@P} Diamonds set to %arg-3%"
  117. else if arg-2 is "save":
  118. loop all players:
  119. if loop-player's inventory contains diamonds:
  120. set {sm::sDiamonds::%loop-player%} to amount of diamonds in loop-player's inventory
  121. send "{@P} %{sm::sDiamonds::%loop-player%}% diamonds have been saved in your inventory"
  122. send "{@P} Removing them from your inventory now"
  123. remove all diamonds from loop-player's inventory
  124. else if arg-2 is "give":
  125. loop all players:
  126. if {sm::slaveOwner::%loop-player%} is set:
  127. if {sm::sDiamonds::%loop-player%} is set:
  128. console command "give %loop-player% diamond %{sm::sDiamonds::%loop-player%}%"
  129. send "{@P} You have been given {@H}%{sm::sDiamonds::%loop-player%}% {@C}diamonds!"
  130. else:
  131. send "{@P} /slave diamonds <number of diamonds>"
  132.  
  133. else if arg-1 is "reset":
  134. if arg-2 is not set:
  135. send "{@P} Are you sure you want to reset?"
  136. send "{@P} {@H}/slave reset confirm {@C}to confirm"
  137. else if arg-2 is "confirm":
  138. send "{@P} Slave Market reset"
  139. delete {sm::*}
  140.  
  141. else if arg-1 is "help":
  142. send "{@P} insert commands here"
  143. else:
  144. player command "/slave help"
  145.  
  146.  
  147.  
  148. command /bid [<int>]:
  149. trigger:
  150. if command sender's inventory contains arg-1 diamonds:
  151. if {sm::Running} is set:
  152. if {sm::bidTimer} is set:
  153. if {sm::slaveOwner::%command sender%} is set:
  154. if arg-1 is greater than 0:
  155. if arg-1 is greater than {sm::currentBid}:
  156. set {sm::currentBid} to arg-1
  157. set {sm::highBidder} to command sender
  158. broadcast "{@P} {@H}%command sender% {@C}bid {@H}%arg-1% {@C}diamonds"
  159. if {sm::bidTimer} is less than 5:
  160. add 5 to {sm::bidTimer}
  161. else:
  162. send "{@P} Current bid is higher! {@H}%{sm::currentBid}%"
  163. else:
  164. send "{@P} You need to bid a positive number"
  165. else:
  166. send "{@P} You aren't a slave owner"
  167. else:
  168. send "{@P} No timer running!"
  169. else:
  170. send "{@P} No game in progress!"
  171.  
  172.  
  173.  
  174. every 1 real second:
  175. if {sm::Running} is set:
  176. if {sm::bidTimer} is set:
  177. remove 1 from {sm::bidTimer}
  178. if {sm::bidTimer} is less than 5:
  179. broadcast "{@P} {@H}%{sm::bidTimer}% {@C}seconds remaining!"
  180. else if {sm::bidTimer} is 0:
  181. broadcast "{@P} {@H}%{sm::highBidder}% {@C}won the bid for {@H}%{sm::currentSlave}%"
  182. broadcast "{@P} {@H}%{sm::currentBid}% {@C}diamonds"
  183. console command "team set %{sm::currentSlave}% %{TeamNumber::%{sm::highBidder}%}%"
  184.  
  185. remove {sm::currentSlave} from {sm::slaves::*}
  186. remove {sm::currentBid} of diamonds from {sm::highBidder}
  187.  
  188. #reset
  189. delete {slave::bidTimer}
  190. delete {sm::highBidder}
  191. set {sm::currentBid} to -1
  192. set {sm::currentSlave} to (random element of {sm::slaves::*})
  193. while {sm::currentSlave} is offline:
  194. delete {sm::currentSlave}
  195. set {sm::currentSlave} to (random element of {sm::slaves::*})
  196.  
  197. broadcast "{@P} {@H}%{sm::currentSlave}% {@C}is now up for auction!"
  198. set {sm::bidTimer} to 15
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement