Advertisement
Guest User

PedraFilosofal 2.0

a guest
Aug 27th, 2017
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.29 KB | None | 0 0
  1. variables:
  2. {PedraFilosofal.Coleta::%player%} = false
  3.  
  4.  
  5. options:
  6.  
  7. Chance: 10 # O minimo é 0.1
  8. Fortuna: false # Aqui é para você deixar para não ter mais chances com a fortuna
  9. Delay: 60 # Em segundos, delay para fazer a coleta das pedras
  10. NomeDoVillager: &6Curador de Museu # Vi na internet que esse é o nome de quem administra um museu
  11. Preco: 5000 # Preço de cada pedra
  12. Format: moeda # Aqui é o nome da sua moeda no singular
  13. PermAdmin: pedra.admin
  14.  
  15. command /pedra [<text>]:
  16.  
  17. trigger:
  18. if arg 1 is set:
  19.  
  20. if arg 1 is "criar":
  21.  
  22. if player has permission "{@PermAdmin}":
  23.  
  24. CriarVillager(player)
  25.  
  26. else:
  27.  
  28. send "%nl% &9Você não tem permissão. %nl%"
  29. stop
  30.  
  31. if arg 1 is "remover" or "deletar":
  32.  
  33. if player has permission "{@PermAdmin}":
  34.  
  35. RemoveVillager(player)
  36.  
  37. else:
  38.  
  39. send "%nl% &9Você não tem permissão. %nl%"
  40. stop
  41.  
  42. if arg 1 is "confirmar":
  43.  
  44. set {_i} to "%item amount of player's tool%" parsed as integer
  45. VendaMuseuConfirmar(player, {_i})
  46.  
  47. if arg 1 is "voltar":
  48.  
  49. set {_i} to "%item amount of player's tool%" parsed as integer
  50. VendaMuseuMenu(player, {_i})
  51.  
  52. if arg 1 is "vender":
  53.  
  54. set {_i} to "%item amount of player's tool%" parsed as integer
  55. VendaMuseuVender(player, {_i})
  56.  
  57. else:
  58.  
  59. send "%nl% &9[Pedra Filosofal]%nl% &fComandos:%nl%%nl% &7/pedra criar - Cria um villager%nl% &7/pedra remover - Remove um villager"
  60.  
  61.  
  62. on damage:
  63.  
  64. if victim is a villager:
  65.  
  66. if name of victim is "{@NomeDoVillager}":
  67.  
  68. cancel event
  69.  
  70. on rightclick on villager:
  71.  
  72. if name of event-entity is "{@NomeDoVillager}":
  73.  
  74. cancel event
  75. if player's tool is nether star:
  76.  
  77. if name of player's tool is "&9Pedra filosofal":
  78.  
  79. if lore of player's tool is "||&7* Adquirida com muito esforço":
  80.  
  81. set {_i} to "%item amount of player's tool%" parsed as integer
  82. VendaMuseuMenu(player, {_i})
  83.  
  84. else:
  85.  
  86. VendaMuseuN(player)
  87.  
  88. function VendaMuseuN(p: player):
  89.  
  90. wait 5 tick
  91. open chest with 3 row named "&7{@NomeDoVillager} - &9Vendas" to {_p}
  92. play raw sound "random.chestopen" at {_p} with pitch 1 volume 5
  93. wait 5 tick
  94. set {_slot} to 0
  95. loop 27 times:
  96.  
  97. format slot {_slot} of {_p} with a gray stained glass named "&0" to be unstealable
  98. add 1 to {_slot}
  99.  
  100. set {_lucro} to {_q} * {@Preco}
  101. format slot 8 of {_p} with a barrier named "&aFechar menu" with lore "||&7* Clique aqui para fechar o menu" to close
  102. format slot 11 of {_p} with 0 of nether star named "&9Sem pedras filosofais em sua mão" with lore "||&7* :(" to be unstealable
  103. format slot 13 of {_p} with 0 of emerald named "&aVender pedras" with lore "||&7* Clique aqui para vender suas pedras" to be unstealable
  104. format slot 15 of {_p} with 0 of 175 named "&9Lucro:" with lore " &fNenhum :(" to be unstealable
  105.  
  106. function VendaMuseuMenu(p: player, q: number):
  107.  
  108. wait 5 tick
  109. open chest with 3 row named "&7{@NomeDoVillager} - &9Vendas" to {_p}
  110. play raw sound "random.chestopen" at {_p} with pitch 1 volume 5
  111. wait 5 tick
  112. set {_slot} to 0
  113. loop 27 times:
  114.  
  115. format slot {_slot} of {_p} with a gray stained glass named "&0" to be unstealable
  116. add 1 to {_slot}
  117.  
  118. set {_lucro} to {_q} * {@Preco}
  119. format slot 8 of {_p} with a barrier named "&aFechar menu" with lore "||&7* Clique aqui para fechar o menu" to close
  120. format slot 11 of {_p} with {_q} of nether star named "&9Pedra filosofal" with lore "||&7* Adquirida com muito esforço" to be unstealable
  121. format slot 13 of {_p} with a emerald named "&aVender pedras" with lore "||&7* Clique aqui para vender suas pedras" to close then run [execute {_p} command "pedra confirmar"]
  122. format slot 15 of {_p} with 175 named "&9Lucro:" with lore "|| &f%{_lucro}%" to be unstealable
  123.  
  124. function VendaMuseuConfirmar(p: player, q: number):
  125.  
  126. wait 5 tick
  127. open chest with 3 row named "&7{@NomeDoVillager} - &9Confirmação" to {_p}
  128. play raw sound "random.chestopen" at {_p} with pitch 1 volume 5
  129. wait 5 tick
  130. set {_slot} to 0
  131. loop 27 times:
  132.  
  133. format slot {_slot} of {_p} with a gray stained glass named "&0" to be unstealable
  134. add 1 to {_slot}
  135.  
  136. set {_lucro} to {_q} * {@Preco}
  137. format slot 0 of {_p} with a 324 named "&aVoltar" with lore "||&7* Clique aqui para voltar" to close then run [execute {_p} command "pedra voltar"]
  138. format slot 8 of {_p} with a barrier named "&aFechar menu" with lore "||&7* Clique aqui para fechar o menu" to close
  139. format slot 10 of {_p} with a light green wool block named "&aConfirmar" with lore "||&7* Clique aqui para confirmar" to close then run [execute {_p} command "pedra vender"]
  140. format slot 12 of {_p} with {_q} of nether star named "&9Pedras filosofais" to be unstealable
  141. format slot 14 of {_p} with 175 named "&9Lucro:" with lore " &f%{_lucro}%" to be unstealable
  142. format slot 16 of {_p} with a red wool block named "&cCancelar" with lore "||&7* Clique aqui para cancelar" to close
  143.  
  144. function VendaMuseuVender(p: player, q: number):
  145.  
  146. play raw sound "mob.villager.yes" at {_p} with pitch 1 volume 5
  147. remove {_q} of nether star named "&9Pedra filosofal" with lore "||&7* Adquirida com muito esforço" from {_p}'s inventory
  148. set {_lucro} to {_q} * {@Preco}
  149. add {_lucro} to {_p}'s balance
  150. if {_q} > 1:
  151.  
  152. send "%nl% &9&lMUSEU%nl%%nl% &fVocê vendeu %{_q}% &9Pedras Filosofais &fpor &9%{_lucro}% &f{@Format}.%nl%" to {_p}
  153. stop
  154.  
  155. else:
  156.  
  157. send "%nl% &9&lMUSEU%nl%%nl% &fVocê vendeu uma &9Pedra Filosofal &fpor &9%{_lucro}% &f{@Format}.%nl%" to {_p}
  158. stop
  159.  
  160.  
  161.  
  162. function CriarVillager(p: player):
  163. spawn a villager at location of {_p}
  164. set name of last spawned villager to "{@NomeDoVillager}"
  165. add "{NoAI:1}" to nbt of last spawned villager
  166. add "{Gravity:1}" to nbt of last spawned villager
  167.  
  168. function RemoveVillager(p: player):
  169. loop all entities:
  170. if name of loop-entity is "{@NomeDoVillager}":
  171. clear loop-entity
  172.  
  173. on mine any ore:
  174.  
  175. set {_r} to {@Fortuna}
  176. if {_r} is true:
  177.  
  178. if player's tool is enchanted with fortune:
  179.  
  180. set {_e} to level of fortune of player's tool
  181. set {_c} to {_e} * {@Chance}
  182.  
  183. else:
  184.  
  185. set {_c} to {@Chance}
  186.  
  187. chance of {_c}%:
  188.  
  189. Pedrinha(player)
  190.  
  191. if {_r} is false:
  192.  
  193. set {_c} to {@Chance}
  194. chance of {_c}%:
  195.  
  196. Pedrinha(player, block)
  197.  
  198. function Pedrinha(p: player, b: block):
  199.  
  200. show 50 of cloud particle at location of {_b} at speed 1
  201. play raw sound "mob.villager.yes" at {_p} with pitch 1 volume 5
  202. set {PedraFilosofal.Mochila::%{_p}%} to {PedraFilosofal.Mochila::%{_p}%} + 1
  203. send "%nl% &9Como um historiador nato, você conseguiu encontrar a &7Pedra %nl% &7Filosofal&9, que estava escondida em meio a tantas pedras.%nl% &9Ela foi colocada em sua &f/mochila&9, para abrir ela:" to {_p}
  204. send json of " - Clique aqui" tooltip "&6Abrir sua mochila" run "/mochila" to {_p}
  205. send "" to {_p}
  206.  
  207. function Mochila(p: player, t: number):
  208.  
  209. if {_t} = 0:
  210.  
  211. wait 5 tick
  212. open chest with 3 row named "&7Mochila - &9%{_p}%" to {_p}
  213. play raw sound "random.chestopen" at {_p} with pitch 1 volume 5
  214. wait 5 tick
  215. set {_slot} to 0
  216. loop 27 times:
  217.  
  218. format slot {_slot} of {_p} with a gray stained glass named "&0" to be unstealable
  219. add 1 to {_slot}
  220.  
  221. set {_i} to "%{PedraFilosofal.Mochila::%{_p}%}%" parsed as integer
  222. format slot 8 of {_p} with a barrier named "&aFechar menu" with lore "||&7* Clique aqui para fechar o menu" to close
  223. format slot 10 of {_p} with {_p}'s skull named "&7%{_p}'s name%" with lore "||&9* Um belo historiador" to be unstealable
  224. format slot 16 of {_p} with a hopper named "&aColetar pedras" with lore "||&7* Clique aqui para coletas suas pedras" to close then run [execute {_p} command "mochila confirmar"]
  225. if {PedraFilosofal.Mochila::%{_p}%} = 0:
  226. format slot 13 of {_p} with {_i} of nether star named "&9Sem pedras por aqui :(" to be unstealable
  227. stop
  228. else:
  229. format slot 13 of {_p} with {_i} of nether star named "&9Pedras filosofais" to be unstealable
  230.  
  231. if {_t} = 1:
  232.  
  233. wait 5 tick
  234. open chest with 3 row named "&7Mochila (Confirmação) - &9%{_p}%" to {_p}
  235. play raw sound "random.chestopen" at {_p} with pitch 1 volume 5
  236. wait 5 tick
  237. set {_slot} to 0
  238. loop 27 times:
  239.  
  240. format slot {_slot} of {_p} with a gray stained glass named "&0" to be unstealable
  241. add 1 to {_slot}
  242.  
  243. set {_i} to "%{PedraFilosofal.Mochila::%{_p}%}%" parsed as integer
  244. format slot 0 of {_p} with a 324 named "&aVoltar" with lore "||&7* Clique aqui para voltar" to close then run [execute {_p} command "mochila"]
  245. format slot 8 of {_p} with a barrier named "&aFechar menu" with lore "||&7* Clique aqui para fechar o menu" to close
  246. format slot 10 of {_p} with a light green wool block named "&aConfirmar" with lore "||&7* Clique aqui para confirmar" to close then run [execute {_p} command "mochila coletar"]
  247. format slot 13 of {_p} with {_i} of nether star named "&9Pedras filosofais" to be unstealable
  248. format slot 16 of {_p} with a red wool block named "&cCancelar" with lore "||&7* Clique aqui para cancelar" to close
  249.  
  250. if {_t} = 2:
  251. if {PedraFilosofal.Mochila::%{_p}%} > 0:
  252.  
  253. if {PedraFilosofal.Coleta::%{_p}%} is false:
  254.  
  255. if {_p} has enough space for {PedraFilosofal.Mochila::%{_p}%} of nether star:
  256.  
  257. set {_i} to "%{PedraFilosofal.Mochila::%{_p}%}%" parsed as integer
  258. play raw sound "random.orb" at {_p} with pitch 1 volume 5
  259. send "%nl% &7Você coletou suas &9pedras filosofais&7.%nl%" to {_p}
  260. give {_i} of nether star named "&9Pedra filosofal" with lore "||&7* Adquirida com muito esforço" to {_p}
  261. set {PedraFilosofal.Mochila::%{_p}%} to 0
  262. set {PedraFilosofal.Coleta::%{_p}%} to true
  263. wait {@Delay} seconds
  264. set {PedraFilosofal.Coleta::%{_p}%} to false
  265.  
  266. else:
  267.  
  268. play raw sound "mob.villager.no" at {_p} with pitch 1 volume 5
  269. send "%nl% &9Não há espaço em seu inventário.%nl%" to {_p}
  270.  
  271. else:
  272.  
  273. play raw sound "mob.villager.no" at {_p} with pitch 1 volume 5
  274. send "%nl% &9Aguarde o tempo de espera para coletar novamente.%nl%" to {_p}
  275.  
  276. else:
  277.  
  278. play raw sound "mob.villager.no" at {_p} with pitch 1 volume 5
  279. send "%nl% &9Não há pedras filosofais em sua mochila :(%nl%" to {_p}
  280.  
  281. command /mochila [<text>] [<number>]:
  282.  
  283. trigger:
  284.  
  285. if arg 1 is not set:
  286.  
  287. Mochila(player, 0)
  288.  
  289. if arg 1 is "confirmar":
  290.  
  291. Mochila(player, 1)
  292.  
  293. if arg 1 is "coletar":
  294.  
  295. Mochila(player, 2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement