Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- variables:
- {PedraFilosofal.Coleta::%player%} = false
- options:
- Chance: 10 # O minimo é 0.1
- Fortuna: false # Aqui é para você deixar para não ter mais chances com a fortuna
- Delay: 60 # Em segundos, delay para fazer a coleta das pedras
- NomeDoVillager: &6Curador de Museu # Vi na internet que esse é o nome de quem administra um museu
- Preco: 5000 # Preço de cada pedra
- Format: moeda # Aqui é o nome da sua moeda no singular
- PermAdmin: pedra.admin
- command /pedra [<text>]:
- trigger:
- if arg 1 is set:
- if arg 1 is "criar":
- if player has permission "{@PermAdmin}":
- CriarVillager(player)
- else:
- send "%nl% &9Você não tem permissão. %nl%"
- stop
- if arg 1 is "remover" or "deletar":
- if player has permission "{@PermAdmin}":
- RemoveVillager(player)
- else:
- send "%nl% &9Você não tem permissão. %nl%"
- stop
- if arg 1 is "confirmar":
- set {_i} to "%item amount of player's tool%" parsed as integer
- VendaMuseuConfirmar(player, {_i})
- if arg 1 is "voltar":
- set {_i} to "%item amount of player's tool%" parsed as integer
- VendaMuseuMenu(player, {_i})
- if arg 1 is "vender":
- set {_i} to "%item amount of player's tool%" parsed as integer
- VendaMuseuVender(player, {_i})
- else:
- send "%nl% &9[Pedra Filosofal]%nl% &fComandos:%nl%%nl% &7/pedra criar - Cria um villager%nl% &7/pedra remover - Remove um villager"
- on damage:
- if victim is a villager:
- if name of victim is "{@NomeDoVillager}":
- cancel event
- on rightclick on villager:
- if name of event-entity is "{@NomeDoVillager}":
- cancel event
- if player's tool is nether star:
- if name of player's tool is "&9Pedra filosofal":
- if lore of player's tool is "||&7* Adquirida com muito esforço":
- set {_i} to "%item amount of player's tool%" parsed as integer
- VendaMuseuMenu(player, {_i})
- else:
- VendaMuseuN(player)
- function VendaMuseuN(p: player):
- wait 5 tick
- open chest with 3 row named "&7{@NomeDoVillager} - &9Vendas" to {_p}
- play raw sound "random.chestopen" at {_p} with pitch 1 volume 5
- wait 5 tick
- set {_slot} to 0
- loop 27 times:
- format slot {_slot} of {_p} with a gray stained glass named "&0" to be unstealable
- add 1 to {_slot}
- set {_lucro} to {_q} * {@Preco}
- format slot 8 of {_p} with a barrier named "&aFechar menu" with lore "||&7* Clique aqui para fechar o menu" to close
- format slot 11 of {_p} with 0 of nether star named "&9Sem pedras filosofais em sua mão" with lore "||&7* :(" to be unstealable
- format slot 13 of {_p} with 0 of emerald named "&aVender pedras" with lore "||&7* Clique aqui para vender suas pedras" to be unstealable
- format slot 15 of {_p} with 0 of 175 named "&9Lucro:" with lore " &fNenhum :(" to be unstealable
- function VendaMuseuMenu(p: player, q: number):
- wait 5 tick
- open chest with 3 row named "&7{@NomeDoVillager} - &9Vendas" to {_p}
- play raw sound "random.chestopen" at {_p} with pitch 1 volume 5
- wait 5 tick
- set {_slot} to 0
- loop 27 times:
- format slot {_slot} of {_p} with a gray stained glass named "&0" to be unstealable
- add 1 to {_slot}
- set {_lucro} to {_q} * {@Preco}
- format slot 8 of {_p} with a barrier named "&aFechar menu" with lore "||&7* Clique aqui para fechar o menu" to close
- format slot 11 of {_p} with {_q} of nether star named "&9Pedra filosofal" with lore "||&7* Adquirida com muito esforço" to be unstealable
- 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"]
- format slot 15 of {_p} with 175 named "&9Lucro:" with lore "|| &f%{_lucro}%" to be unstealable
- function VendaMuseuConfirmar(p: player, q: number):
- wait 5 tick
- open chest with 3 row named "&7{@NomeDoVillager} - &9Confirmação" to {_p}
- play raw sound "random.chestopen" at {_p} with pitch 1 volume 5
- wait 5 tick
- set {_slot} to 0
- loop 27 times:
- format slot {_slot} of {_p} with a gray stained glass named "&0" to be unstealable
- add 1 to {_slot}
- set {_lucro} to {_q} * {@Preco}
- 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"]
- format slot 8 of {_p} with a barrier named "&aFechar menu" with lore "||&7* Clique aqui para fechar o menu" to close
- 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"]
- format slot 12 of {_p} with {_q} of nether star named "&9Pedras filosofais" to be unstealable
- format slot 14 of {_p} with 175 named "&9Lucro:" with lore " &f%{_lucro}%" to be unstealable
- format slot 16 of {_p} with a red wool block named "&cCancelar" with lore "||&7* Clique aqui para cancelar" to close
- function VendaMuseuVender(p: player, q: number):
- play raw sound "mob.villager.yes" at {_p} with pitch 1 volume 5
- remove {_q} of nether star named "&9Pedra filosofal" with lore "||&7* Adquirida com muito esforço" from {_p}'s inventory
- set {_lucro} to {_q} * {@Preco}
- add {_lucro} to {_p}'s balance
- if {_q} > 1:
- send "%nl% &9&lMUSEU%nl%%nl% &fVocê vendeu %{_q}% &9Pedras Filosofais &fpor &9%{_lucro}% &f{@Format}.%nl%" to {_p}
- stop
- else:
- send "%nl% &9&lMUSEU%nl%%nl% &fVocê vendeu uma &9Pedra Filosofal &fpor &9%{_lucro}% &f{@Format}.%nl%" to {_p}
- stop
- function CriarVillager(p: player):
- spawn a villager at location of {_p}
- set name of last spawned villager to "{@NomeDoVillager}"
- add "{NoAI:1}" to nbt of last spawned villager
- add "{Gravity:1}" to nbt of last spawned villager
- function RemoveVillager(p: player):
- loop all entities:
- if name of loop-entity is "{@NomeDoVillager}":
- clear loop-entity
- on mine any ore:
- set {_r} to {@Fortuna}
- if {_r} is true:
- if player's tool is enchanted with fortune:
- set {_e} to level of fortune of player's tool
- set {_c} to {_e} * {@Chance}
- else:
- set {_c} to {@Chance}
- chance of {_c}%:
- Pedrinha(player)
- if {_r} is false:
- set {_c} to {@Chance}
- chance of {_c}%:
- Pedrinha(player, block)
- function Pedrinha(p: player, b: block):
- show 50 of cloud particle at location of {_b} at speed 1
- play raw sound "mob.villager.yes" at {_p} with pitch 1 volume 5
- set {PedraFilosofal.Mochila::%{_p}%} to {PedraFilosofal.Mochila::%{_p}%} + 1
- 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}
- send json of " - Clique aqui" tooltip "&6Abrir sua mochila" run "/mochila" to {_p}
- send "" to {_p}
- function Mochila(p: player, t: number):
- if {_t} = 0:
- wait 5 tick
- open chest with 3 row named "&7Mochila - &9%{_p}%" to {_p}
- play raw sound "random.chestopen" at {_p} with pitch 1 volume 5
- wait 5 tick
- set {_slot} to 0
- loop 27 times:
- format slot {_slot} of {_p} with a gray stained glass named "&0" to be unstealable
- add 1 to {_slot}
- set {_i} to "%{PedraFilosofal.Mochila::%{_p}%}%" parsed as integer
- format slot 8 of {_p} with a barrier named "&aFechar menu" with lore "||&7* Clique aqui para fechar o menu" to close
- format slot 10 of {_p} with {_p}'s skull named "&7%{_p}'s name%" with lore "||&9* Um belo historiador" to be unstealable
- 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"]
- if {PedraFilosofal.Mochila::%{_p}%} = 0:
- format slot 13 of {_p} with {_i} of nether star named "&9Sem pedras por aqui :(" to be unstealable
- stop
- else:
- format slot 13 of {_p} with {_i} of nether star named "&9Pedras filosofais" to be unstealable
- if {_t} = 1:
- wait 5 tick
- open chest with 3 row named "&7Mochila (Confirmação) - &9%{_p}%" to {_p}
- play raw sound "random.chestopen" at {_p} with pitch 1 volume 5
- wait 5 tick
- set {_slot} to 0
- loop 27 times:
- format slot {_slot} of {_p} with a gray stained glass named "&0" to be unstealable
- add 1 to {_slot}
- set {_i} to "%{PedraFilosofal.Mochila::%{_p}%}%" parsed as integer
- 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"]
- format slot 8 of {_p} with a barrier named "&aFechar menu" with lore "||&7* Clique aqui para fechar o menu" to close
- 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"]
- format slot 13 of {_p} with {_i} of nether star named "&9Pedras filosofais" to be unstealable
- format slot 16 of {_p} with a red wool block named "&cCancelar" with lore "||&7* Clique aqui para cancelar" to close
- if {_t} = 2:
- if {PedraFilosofal.Mochila::%{_p}%} > 0:
- if {PedraFilosofal.Coleta::%{_p}%} is false:
- if {_p} has enough space for {PedraFilosofal.Mochila::%{_p}%} of nether star:
- set {_i} to "%{PedraFilosofal.Mochila::%{_p}%}%" parsed as integer
- play raw sound "random.orb" at {_p} with pitch 1 volume 5
- send "%nl% &7Você coletou suas &9pedras filosofais&7.%nl%" to {_p}
- give {_i} of nether star named "&9Pedra filosofal" with lore "||&7* Adquirida com muito esforço" to {_p}
- set {PedraFilosofal.Mochila::%{_p}%} to 0
- set {PedraFilosofal.Coleta::%{_p}%} to true
- wait {@Delay} seconds
- set {PedraFilosofal.Coleta::%{_p}%} to false
- else:
- play raw sound "mob.villager.no" at {_p} with pitch 1 volume 5
- send "%nl% &9Não há espaço em seu inventário.%nl%" to {_p}
- else:
- play raw sound "mob.villager.no" at {_p} with pitch 1 volume 5
- send "%nl% &9Aguarde o tempo de espera para coletar novamente.%nl%" to {_p}
- else:
- play raw sound "mob.villager.no" at {_p} with pitch 1 volume 5
- send "%nl% &9Não há pedras filosofais em sua mochila :(%nl%" to {_p}
- command /mochila [<text>] [<number>]:
- trigger:
- if arg 1 is not set:
- Mochila(player, 0)
- if arg 1 is "confirmar":
- Mochila(player, 1)
- if arg 1 is "coletar":
- Mochila(player, 2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement