NoHacksJustACow

Enchants | Prison

Feb 15th, 2019
521
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.50 KB | None | 0 0
  1. command /enchant:
  2. trigger:
  3. if player is holding a pickaxe:
  4. open virtual chest inventory with size 3 named "&6Enchants Page" to player
  5. make gui slot 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 17, 18, 19, 20, 21, 22, 23, 24, 25, and 26 of player with light gray glass named " " to do nothing
  6. make gui slot 10 of player with sponge named "&cLucky Enchant" with lore "&7Chance to get lucky and get extra tokens while mining||&710000 Tokens||&6Max Level » 100" to run function Luck(player)
  7. make gui slot 11 of player with emerald named "&cFortune Enchant" with lore "&7Get more ores while mining blocks||&75000 Tokens||&6Max Level » 300" to run function Fortune(player)
  8. make gui slot 12 of player with gold_pickaxe named "&cEfficiency Enchant" with lore "&7While mining ores you will mine faster||&73000 Tokens||&6Max Level » 50" to run function Efficiency(player)
  9. make gui slot 13 of player with chest named "&cTreasure Enchant" with lore "&7Chance to get shards while mining that give rewards||&75000 Tokens||&6Max Level » 100" to run function Treasure(player)
  10. make gui slot 14 of player with magma_cream named "&cToken Enchant" with lore "&7Get bonus tokens while mining blocks||&77500 Tokens||&6Max Level » 100" to run function Token(player)
  11. make gui slot 15 of player with dandelion_yellow named "&cHaste Enchant" with lore "&7Chance to get haste while mining for a short peroid of time||&76000 Tokens||&6Max Level » 100" to run function Haste(player)
  12. make gui slot 16 of player with paper named "&cMerchant Enchant" with lore "&7Chance to sell your inventory while mining||&715000||&6&6Max Level » 250" to run function Merchant(player)
  13.  
  14. function Merchant(p: player):
  15. if {tokens::%{_p}%} >= 15000:
  16. if lore of {_p}'s held item contains "&7Merchant":
  17. set {_lore::*} to lore of {_p}'s tool split at "||"
  18.  
  19. loop {_lore::*}:
  20. if "%loop-value%" contains "&7Merchant":
  21. set {_value} to uncolored loop-value
  22. stop loop
  23.  
  24. replace all "Merchant" with "" in {_value}
  25. replace all " " with "" in {_value}
  26. set {_value} to "%{_value}%" parsed as integer
  27. if {_value} is 250:
  28. send "&cYour Merchant Is Maxed Out" to {_p}
  29. close {_p}'s inventory
  30. stop
  31. replace all "&7Merchant %{_value}%" with "&7Merchant %{_value} +1%" in lore of {_p}'s tool
  32. remove 15000 from {tokens::%{_p}%}
  33. send "&3&lEnchants &8| &7You purchased &3Merchant &7enchant for &325000 Tokens&7." to {_p}
  34. else:
  35. set {_amount} to 15000 - {tokens::%{_p}%}
  36. send "&3&lEnchants &8| &7You need &b%{_amount}% Tokens &7more to buy this enchant" to {_p}
  37. close {_p}'s inventory
  38.  
  39. function Luck(p: player):
  40. if {tokens::%{_p}%} >= 10000:
  41. if lore of {_p}'s held item contains "&7Luck":
  42. set {_lore::*} to lore of {_p}'s tool split at "||"
  43.  
  44. loop {_lore::*}:
  45. if "%loop-value%" contains "&7Luck":
  46. set {_value} to uncolored loop-value
  47. stop loop
  48.  
  49. replace all "Luck" with "" in {_value}
  50. replace all " " with "" in {_value}
  51. set {_value} to "%{_value}%" parsed as integer
  52. if {_value} is 100:
  53. send "&cYour Luck Is Maxed Out" to {_p}
  54. close {_p}'s inventory
  55. stop
  56. replace all "&7Luck %{_value}%" with "&7Luck %{_value} +1%" in lore of {_p}'s tool
  57. remove 10000 from {tokens::%{_p}%}
  58. send "&3&lEnchants &8| &7You purchased &3Luck &7enchant for &325000 Tokens&7." to {_p}
  59. else:
  60. set {_amount} to 10000 - {tokens::%{_p}%}
  61. send "&3&lEnchants &8| &7You need &b%{_amount}% Tokens &7more to buy this enchant" to {_p}
  62. close {_p}'s inventory
  63.  
  64. function Treasure(p: player):
  65. if {tokens::%{_p}%} >= 5000:
  66. if lore of {_p}'s held item contains "&7Treasure":
  67. set {_lore::*} to lore of {_p}'s tool split at "||"
  68.  
  69. loop {_lore::*}:
  70. if "%loop-value%" contains "&7Treasure":
  71. set {_value} to uncolored loop-value
  72. stop loop
  73.  
  74. replace all "Treasure" with "" in {_value}
  75. replace all " " with "" in {_value}
  76. set {_value} to "%{_value}%" parsed as integer
  77. if {_value} is 100:
  78. send "&cYour Treasure Is Maxed Out" to {_p}
  79. close {_p}'s inventory
  80. stop
  81. replace all "&7Treasure %{_value}%" with "&7Treasure %{_value} +1%" in lore of {_p}'s tool
  82. remove 5000 from {tokens::%{_p}%}
  83. send "&3&lEnchants &8| &7You purchased &3Treasure &7enchant for &375000 Tokens&7." to {_p}
  84. else:
  85. set {_amount} to 5000 - {tokens::%{_p}%}
  86. send "&3&lEnchants &8| &7You need &b%{_amount}% Tokens &7more to buy this enchant" to {_p}
  87. close {_p}'s inventory
  88.  
  89. function Token(p: player):
  90. if {tokens::%{_p}%} >= 7500:
  91. if lore of {_p}'s held item contains "&7Token":
  92. set {_lore::*} to lore of {_p}'s tool split at "||"
  93.  
  94. loop {_lore::*}:
  95. if "%loop-value%" contains "&7Token":
  96. set {_value} to uncolored loop-value
  97. stop loop
  98.  
  99. replace all "Token" with "" in {_value}
  100. replace all " " with "" in {_value}
  101. set {_value} to "%{_value}%" parsed as integer
  102. if {_value} is 100:
  103. send "&cYour Token Is Maxed Out" to {_p}
  104. close {_p}'s inventory
  105. stop
  106. replace all "&7Token %{_value}%" with "&7Token %{_value} +1%" in lore of {_p}'s tool
  107. remove 7500 from {tokens::%{_p}%}
  108. send "&3&lEnchants &8| &7You purchased &3Token &7enchant for &335000 Tokens&7." to {_p}
  109. else:
  110. set {_amount} to 7500 - {tokens::%{_p}%}
  111. send "&3&lEnchants &8| &7You need &b%{_amount}% Tokens &7more to buy this enchant" to {_p}
  112. close {_p}'s inventory
  113.  
  114. function Haste(p: player):
  115. if {tokens::%{_p}%} >= 6000:
  116. if lore of {_p}'s held item contains "&7Haste":
  117. set {_lore::*} to lore of {_p}'s tool split at "||"
  118.  
  119. loop {_lore::*}:
  120. if "%loop-value%" contains "&7Haste":
  121. set {_value} to uncolored loop-value
  122. stop loop
  123.  
  124. replace all "Haste" with "" in {_value}
  125. replace all " " with "" in {_value}
  126. set {_value} to "%{_value}%" parsed as integer
  127. if {_value} is 100:
  128. send "&cYour Token Is Maxed Out" to {_p}
  129. close {_p}'s inventory
  130. stop
  131. replace all "&7Haste %{_value}%" with "&7Haste %{_value} +1%" in lore of {_p}'s tool
  132. remove 6000 from {tokens::%{_p}%}
  133. send "&3&lEnchants &8| &7You purchased &3Haste &7enchant for &340000 Tokens&7." to {_p}
  134. else:
  135. set {_amount} to 6000 - {tokens::%{_p}%}
  136. send "&3&lEnchants &8| &7You need &b%{_amount}% Tokens &7more to buy this enchant" to {_p}
  137. close {_p}'s inventory
  138.  
  139. function Efficiency(p: player):
  140. if {tokens::%{_p}%} is greater than or equal to 3000:
  141. if level of efficiency of {_p}'s held item <= 49:
  142. send "&3&lEnchants &8| &7You purchased &3Efficiency &7enchant for &315000 Tokens&7." to {_p}
  143. remove 3000 from {tokens::%{_p}%}
  144. enchant the tool of {_p} with "efficiency %level of efficiency of {_p}'s tool +1%" parsed as enchantment type
  145. stop
  146. else:
  147. send "&cYour Efficiency Is Maxed Out" to {_p}
  148. close {_p}'s inventory
  149. else:
  150. set {_amount} to 3000 - {tokens::%{_p}%}
  151. send "&3&lEnchants &8| &7You need &b%{_amount}% Tokens &7more to buy this enchant" to {_p}
  152. close {_p}'s inventory
  153. stop
  154.  
  155. function Fortune(p: player):
  156. if {tokens::%{_p}%} is greater than or equal to 5000:
  157. if level of fortune of {_p}'s held item <= 299:
  158. send "&3&lEnchants &8| &7You purchased &3Fortune &7enchant for &330000 Tokens&7." to {_p}
  159. remove 5000 from {tokens::%{_p}%}
  160. enchant the tool of {_p} with "fortune %level of fortune of {_p}'s tool +1%" parsed as enchantment type
  161. stop
  162. else:
  163. send "&cYour Fortune Is Maxed Out" to {_p}
  164. close {_p}'s inventory
  165. else:
  166. set {_amount} to 5000 - {tokens::%{_p}%}
  167. send "&3&lEnchants &8| &7You need &b%{_amount}% Tokens &7more to buy this enchant" to {_p}
  168. close {_p}'s inventory
  169.  
  170. on mine:
  171. if lore of player's held item contains "&7Luck":
  172. set {_lore::*} to lore of player's tool split at "||"
  173.  
  174. loop {_lore::*}:
  175. if "%loop-value%" contains "&7Luck":
  176. set {_value} to uncolored loop-value
  177. stop loop
  178.  
  179. replace all "Luck" with "" in {_value}
  180. replace all " " with "" in {_value}
  181. set {_value} to "%{_value}%" parsed as integer
  182. set {_value} to {_value} /25
  183. chance of {_value}%:
  184. set {_tokens} to a random integer between 1 and 3000
  185. add {_tokens} to {tokens::%player%}
  186. send "&7You got lucky and recieved &a%{_tokens}% Tokens &7From your lucky enchant"
  187.  
  188. on mine:
  189. if lore of player's held item contains "&7Treasure":
  190. set {_lore::*} to lore of player's tool split at "||"
  191.  
  192. loop {_lore::*}:
  193. if "%loop-value%" contains "&7Treasure":
  194. set {_value} to uncolored loop-value
  195. stop loop
  196.  
  197. replace all "Treasure" with "" in {_value}
  198. replace all " " with "" in {_value}
  199. set {_value} to "%{_value}%" parsed as integer
  200. set {_value} to {_value} /25
  201. chance of {_value}%:
  202. give player prismarine_shard named "&7&lSimple Shard"
  203. send player title "&d&lTREASURE" with subtitle "&7You got a &lSimple Shard"
  204. play "BLOCK_ANVIL_PLACE " to player
  205.  
  206. on mine:
  207. if lore of player's held item contains "&7Haste":
  208. set {_lore::*} to lore of player's tool split at "||"
  209.  
  210. loop {_lore::*}:
  211. if "%loop-value%" contains "&7Haste":
  212. set {_value} to uncolored loop-value
  213. stop loop
  214.  
  215. replace all "Haste" with "" in {_value}
  216. replace all " " with "" in {_value}
  217. set {_value} to "%{_value}%" parsed as integer
  218. set {_value} to {_value} /25
  219. chance of {_value}%:
  220. apply haste 3 to the player for 5 seconds
  221. play "entity_player_levelup" to player
  222.  
  223. on mine:
  224. if lore of player's held item contains "&7Merchant":
  225. set {_lore::*} to lore of player's tool split at "||"
  226.  
  227. loop {_lore::*}:
  228. if "%loop-value%" contains "&7Merchant":
  229. set {_value} to uncolored loop-value
  230. stop loop
  231.  
  232. replace all "Merchant" with "" in {_value}
  233. replace all " " with "" in {_value}
  234. set {_value} to "%{_value}%" parsed as integer
  235. set {_value} to {_value} /25
  236. chance of {_value}%:
  237. set {_ironWorth} to 0.74
  238. set {_ironCount} to amount of iron_ingot in player's inventory
  239. set {_ironSell} to {_ironCount} * {_ironWorth}
  240. set {_coalWorth} to 0.16
  241. set {_coalCount} to amount of coal in player's inventory
  242. set {_coalSell} to {_coalCount} * {_coalWorth}
  243. set {_goldWorth} to 1.72
  244. set {_goldCount} to amount of gold_ingot in player's inventory
  245. set {_goldSell} to {_goldCount} * {_goldWorth}
  246. set {_diamondWorth} to 5.32
  247. set {_diamondCount} to amount of diamond in player's inventory
  248. set {_diamondSell} to {_diamondCount} * {_diamondWorth}
  249. set {_emeraldWorth} to 12.56
  250. set {_emeraldCount} to amount of emerald in player's inventory
  251. set {_emeraldSell} to {_emeraldCount} * {_emeraldWorth}
  252. remove all emerald from player's inventory
  253. remove all diamond from player's inventory
  254. remove all gold_ingot from player's inventory
  255. remove all coal from player's inventory
  256. remove all iron ingot from player's inventory
  257. set {_totalCount} to {_coalCount} + {_ironCount} + {_goldCount} + {_diamondCount} + {_emeraldCount}
  258. set {_totalProfit} to {_ironSell} + {_coalSell} + {_goldSell} + {_diamondSell} + {_emeraldSell}
  259. set {_totalProfit} to {_totalProfit} * {booster::%player%}
  260. set {_totalBooster} to {_totalProfit} * {globalbooster}
  261. set {_afterSell} to {_totalProfit} + {_totalBooster}
  262. set action bar of player to coloured "&7Sold &a%{_totalCount}% &7Item(s) for &f$&a%{_aftersell}% &3&lPersonal &a&l(*%{booster::%player%}%) &3&lGlobal &a&l(*%{globalbooster}%)"
  263. add {_aftersell} to player's balance
  264.  
  265. on mine:
  266. if lore of player's held item contains "&7Token":
  267. set {_lore::*} to lore of player's tool split at "||"
  268.  
  269. loop {_lore::*}:
  270. if "%loop-value%" contains "&7Token":
  271. set {_value} to uncolored loop-value
  272. stop loop
  273.  
  274. replace all "Token" with "" in {_value}
  275. replace all " " with "" in {_value}
  276. set {_value} to "%{_value}%" parsed as integer
  277. set {_value} to {_value} * 1.6
  278. set {_number} to a random integer between 1 and {_value}
  279. add {_number} to {tokens::%player%}
  280. else:
  281. set {_number} to a random integer between 1 and 5
  282. add {_number} to {tokens::%player%}
  283.  
  284.  
  285. on mine of coal ore:
  286. if {autoinv::%player%} is true:
  287. cancel drops
  288. if the player's tool is enchanted with fortune:
  289. set {_fortune} to random integer between 1 and level of fortune on player's tool
  290. give player {_fortune} of coal
  291.  
  292. on mine of iron ore:
  293. if {autoinv::%player%} is true:
  294. cancel drops
  295. if the player's tool is enchanted with fortune:
  296. set {_fortune} to random integer between 1 and level of fortune on player's tool
  297. give player {_fortune} of iron ingot
  298.  
  299.  
  300. on mine:
  301. add 1 to {blocks::%player%}
Advertisement
Add Comment
Please, Sign In to add comment