QuacziSK

QEnchant BETA

Oct 2nd, 2016
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 15.74 KB | None | 0 0
  1. function openMenu(p: player):
  2. open chest with 5 rows named "&e&oQ&6&oEnchant" to {_p}
  3. wait a tick
  4. format slot 7 of {_p} with 1 of bars named "&e>" with lore "&0_" to be unstealable
  5. format slot 16 of {_p} with 1 of bars named "&e>" with lore "&0_" to be unstealable
  6. format slot 17 of {_p} with 1 of bars named "&e/\" with lore "&0_" to be unstealable
  7. format slot 25 of {_p} with 1 of bars named "&e>" with lore "&0_" to be unstealable
  8. format slot 34 of {_p} with 1 of bars named "&e>" with lore "&0_" to be unstealable
  9. format slot 43 of {_p} with 1 of bars named "&e>" with lore "&0_" to be unstealable
  10. format slot 41 of {_p} with 1 of bars named "&e>" with lore "&0_" to be unstealable
  11. format slot 32 of {_p} with 1 of bars named "&e>" with lore "&0_" to be unstealable
  12. format slot 23 of {_p} with 1 of book named "&a&lRegaly: &e%{qenchant::%{_p}%::bib}%" with lore "&0_" to be unstealable
  13. format slot 14 of {_p} with 1 of bars named "&e>" with lore "&0_" to be unstealable
  14. format slot 5 of {_p} with 1 of bars named "&e>" with lore "&0_" to be unstealable
  15. format slot 26 of {_p} with 1 of book of unbreaking 1 named "&5> &c&lNIEZNISZCZALNOSC I &5<" with lore "&5> &aXP: &55LvL||&5> &aRegaly: &50" to close then run [make {_p} execute command "qenchant_enchant2 1 unbreaking"]
  16. format slot 35 of {_p} with 1 of book of unbreaking 2 named "&5> &c&lNIEZNISZCZALNOSC II &5<" with lore "&5> &aXP: &510LvL||&5> &aRegaly: &510" to close then run [make {_p} execute command "qenchant_enchant2 2 unbreaking"]
  17. format slot 44 of {_p} with 1 of book of unbreaking 3 named "&5> &c&lNIEZNISZCZALNOSC III &5<" with lore "&5> &aXP: &515LvL||&5> &aRegaly: &510" to close then run [make {_p} execute command "qenchant_enchant2 3 unbreaking"]
  18. format slot 0 of {_p} with 1 of book of sharpness 1 named "&5> &c&lOSTROSC I &5<" with lore "&5> &aXP: &55LvL||&5> &aRegaly: &50" to close then run [make {_p} execute command "qenchant_enchant2 1 sharpness"]
  19. format slot 1 of {_p} with 1 of book of sharpness 2 named "&5> &c&lOSTROSC II &5<" with lore "&5> &aXP: &58LvL||&5> &aRegaly: &55" to close then run [make {_p} execute command "qenchant_enchant2 2 sharpness"]
  20. format slot 2 of {_p} with 1 of book of sharpness 3 named "&5> &c&lOSTROSC III &5<" with lore "&5> &aXP: &515LvL||&5> &aRegaly: &510" to close then run [make {_p} execute command "qenchant_enchant2 3 sharpness"]
  21. format slot 3 of {_p} with 1 of book of sharpness 4 named "&5> &c&lOSTROSC IV &5<" with lore "&5> &aXP: &525LvL||&5> &aRegaly: &515" to close then run [make {_p} execute command "qenchant_enchant2 4 sharpness"]
  22. format slot 4 of {_p} with 1 of book of sharpness 5 named "&5> &c&lOSTROSC V &5<" with lore "&5> &aXP: &535LvL||&5> &aRegaly: &520" to close then run [make {_p} execute command "qenchant_enchant2 5 sharpness"]
  23. format slot 9 of {_p} with 1 of book of fire aspect 1 named "&5> &c&lOGIEN I &5<" with lore "&5> &aXP: &525LvL||&5> &aRegaly: &515" to close then run [make {_p} execute command "qenchant_enchant2 1 fire aspect"]
  24. format slot 10 of {_p} with 1 of book of fire aspect 2 named "&5> &c&lOGIEN II &5<" with lore "&5> &aXP: &530LvL||&5> &aRegaly: &520" to close then run [make {_p} execute command "qenchant_enchant2 2 fire aspect"]
  25. format slot 18 of {_p} with 1 of book of knockback 1 named "&5> &c&lODRZUT I &5<" with lore "&5> &aXP: &535LvL||&5> &aRegaly: &520" to close then run [make {_p} execute command "qenchant_enchant2 1 knockback"]
  26. format slot 19 of {_p} with 1 of book of knockback 2 named "&5> &c&lODRZUT II &5<" with lore "&5> &aXP: &535LvL||&5> &aRegaly: &520" to close then run [make {_p} execute command "qenchant_enchant2 2 knockback"]
  27. format slot 27 of {_p} with 1 of book of looting 1 named "&5> &c&lSZCZESCIE I &5<" with lore "&5> &aXP: &535LvL||&5> &aRegaly: &520" to close then run [make {_p} execute command "qenchant_enchant2 1 looting"]
  28. format slot 28 of {_p} with 1 of book of looting 2 named "&5> &c&lSZCZESCIE II &5<" with lore "&5> &aXP: &535LvL||&5> &aRegaly: &520" to close then run [make {_p} execute command "qenchant_enchant2 2 looting"]
  29. format slot 29 of {_p} with 1 of book of looting 2 named "&5> &c&lSZCZESCIE III &5<" with lore "&5> &aXP: &535LvL||&5> &aRegaly: &520" to close then run [make {_p} execute command "qenchant_enchant2 3 looting"]
  30. format slot 36 of {_p} with 1 of book of smite 1 named "&5> &c&lPOGROMCA NIEUMARLYCH I &5<" with lore "&5> &aXP: &535LvL||&5> &aRegaly: &520" to close then run [make {_p} execute command "qenchant_enchant2 1 smite"]
  31. format slot 37 of {_p} with 1 of book of smite 1 named "&5> &c&lPOGROMCA NIEUMARLYCH II &5<" with lore "&5> &aXP: &535LvL||&5> &aRegaly: &520" to close then run [make {_p} execute command "qenchant_enchant2 2 smite"]
  32. format slot 38 of {_p} with 1 of book of smite 1 named "&5> &c&lPOGROMCA NIEUMARLYCH III &5<" with lore "&5> &aXP: &535LvL||&5> &aRegaly: &520" to close then run [make {_p} execute command "qenchant_enchant2 3 smite"]
  33. format slot 39 of {_p} with 1 of book of smite 1 named "&5> &c&lPOGROMCA NIEUMARLYCH IV &5<" with lore "&5> &aXP: &535LvL||&5> &aRegaly: &520" to close then run [make {_p} execute command "qenchant_enchant2 4 smite"]
  34. format slot 40 of {_p} with 1 of book of smite 1 named "&5> &c&lPOGROMCA NIEUMARLYCH V &5<" with lore "&5> &aXP: &535LvL||&5> &aRegaly: &520" to close then run [make {_p} execute command "qenchant_enchant2 5 smite"]
  35. format slot 24 of {_p} with 1 of sunflower of fortune 10 named "&5> &c&lLOSUJ ENCHANT &5<" with lore "&5> &aXP: &525LvL||&5> &aRegaly: &520" to close then run [make {_p} execute command "qenchant_random"]
  36. format slot 15 of {_p} with 1 of anvil named "&5> &c&lNAPRAW &5<" with lore "&5> &aXP: &525LvL||&5> &aRegaly: &520" to close then run [make {_p} execute command "qenchant_repair"]
  37. format slot 33 of {_p} with 1 of name tag named "&5> &c&lNAZWIJ &5<" with lore "&5> &aXP: &525LvL||&5> &aRegaly: &520" to close then run [make {_p} execute command "qenchant_nazwij"]
  38.  
  39.  
  40. on load:
  41. if file "plugins/QEnchant/config.yml" doesn't exists:
  42. create file "plugins/QEnchant/config.yml"
  43. download from "http://pastebin.com/raw/WtDY3Y6H" to "plugins/QEnchant/config.yml"
  44. if file "plugins/QEnchant/wiadomosci.yml" doesn't exists:
  45. create file "plugins/QEnchant/wiadomosci.yml"
  46. wait a tick
  47. set "Prefix" to "&e&oQ&6&oEnchant &8[&6>&8]" in yaml file "plugins/QEnchant/wiadomosci.yml"
  48. set "Suffix" to "&8." in yaml file "plugins/QEnchant/wiadomosci.yml"
  49. set "NoLVL" to "&cNie masz wystarczajacego poziomu" in yaml file "plugins/QEnchant/wiadomosci.yml"
  50. set "NoBOOK" to "&cNie masz wystarczajacego ilosci biblioteczek" in yaml file "plugins/QEnchant/wiadomosci.yml"
  51. set "NoSPACE" to "&cNie masz miejsca w ekwipunku." in yaml file "plugins/QEnchant/wiadomosci.yml"
  52. set "Success" to "&aZaklnales przedmiot na &e&o_ENCHANT_" in yaml file "plugins/QEnchant/wiadomosci.yml"
  53. set "Random" to "&aWylosolwales &e&o_ENCHANT_" in yaml file "plugins/QEnchant/wiadomosci.yml"
  54. set "Repair" to "&aNaprawiles przedmiot" in yaml file "plugins/QEnchant/wiadomosci.yml"
  55. set "TypeName" to "&aNapisz na czacie nazwe przedmiotu" in yaml file "plugins/QEnchant/wiadomosci.yml"
  56. set "Name" to "&aPomyslnie ustawiles nazwe na &e&o_NAZWA_" in yaml file "plugins/QEnchant/wiadomosci.yml"
  57. set "Set" to "&aPostawiles enchant" in yaml file "plugins/QEnchant/wiadomosci.yml"
  58. set "Break" to "&aZniszczyles enchant" in yaml file "plugins/QEnchant/wiadomosci.yml"
  59. set "Give" to "&aOtrzymales enchant" in yaml file "plugins/QEnchant/wiadomosci.yml"
  60. set {qenchant::wiad::nl} to colored single value "NoLVL" get of "plugins/QEnchant/wiadomosci.yml"
  61. set {qenchant::wiad::nb} to colored single value "NoBOOK" get of "plugins/QEnchant/wiadomosci.yml"
  62. set {qenchant::wiad::ns} to colored single value "NoSPACE" get of "plugins/QEnchant/wiadomosci.yml"
  63. set {qenchant::wiad::su} to colored single value "Success" get of "plugins/QEnchant/wiadomosci.yml"
  64. set {qenchant::wiad::ra} to colored single value "Random" get of "plugins/QEnchant/wiadomosci.yml"
  65. set {qenchant::wiad::re} to colored single value "Repair" get of "plugins/QEnchant/wiadomosci.yml"
  66. set {qenchant::wiad::tn} to colored single value "TypeName" get of "plugins/QEnchant/wiadomosci.yml"
  67. set {qenchant::wiad::na} to colored single value "Name" get of "plugins/QEnchant/wiadomosci.yml"
  68. set {qenchant::wiad::ot} to colored single value "Give" get of "plugins/QEnchant/wiadomosci.yml"
  69. set {qenchant::wiad::be} to colored single value "Break" get of "plugins/QEnchant/wiadomosci.yml"
  70. set {qenchant::wiad::pe} to colored single value "Set" get of "plugins/QEnchant/wiadomosci.yml"
  71. set {qenchant::wiad::prefix} to colored single value "Prefix" get of "plugins/QEnchant/wiadomosci.yml"
  72. set {qenchant::wiad::suffix} to colored single value "Suffix" get of "plugins/QEnchant/wiadomosci.yml"
  73.  
  74.  
  75. on right click on enchantment table:
  76. if {qenchant::%event-block%} is true:
  77. if tool of player is any sword:
  78. set {qenchant::%player%::bib} to 0
  79. loop all blocks in radius 3 of event-block:
  80. if loop-block is bookshelf:
  81. if distance between loop-block and event-block is bigger or equal to 2:
  82. if y-coordinate of event-block is less or equal to y-coordinate of loop-block:
  83. add 1 to {qenchant::%player%::bib}
  84. wait 3 ticks
  85. execute player command "/qenchant_menu"
  86.  
  87. command /qenchant_enchant2 [<number>] [<text>]:
  88. trigger:
  89. set {_lvl} to single value "cennik.miecze.%arg-2%.%arg-1%.LvL" get of "plugins/QEnchant/config.yml" parsed as integer
  90. set {_bib} to single value "cennik.miecze.%arg-2%.%arg-1%.Biblioteczki" get of "plugins/QEnchant/config.yml" parsed as integer
  91. if player's level is less than {_lvl}:
  92. send "%{qenchant::wiad::prefix}% %{qenchant::wiad::nl}%%{qenchant::wiad::suffix}%"
  93. stop
  94. if {qenchant::%player%::bib} is less than {_bib}:
  95. send "%{qenchant::wiad::prefix}% %{qenchant::wiad::nb}%%{qenchant::wiad::suffix}%"
  96. stop
  97. if player's level is bigger or equal to {_lvl}:
  98. if {qenchant::%player%::bib} is bigger or equal to {_bib}:
  99. set player's level to player's level -{_lvl}
  100. set {_tier} to arg-1
  101. set {_ench} to arg-2 parsed as enchantment type
  102. set {_full} to "%{_ench}% %{_tier}%" parsed as enchantment type
  103. wait a tick
  104. execute player command "qenchant_menu"
  105. wait 3 ticks
  106. set {_item} to slot 8 of player's current inventory
  107. enchant {_item} with {_full}
  108. wait 2 tick
  109. set slot 8 of player's current inventory to {_item}
  110. replace all "_ENCHANT_" with "%{_full}%" in {qenchant::wiad::su}
  111. send "%{qenchant::wiad::prefix}% %{qenchant::wiad::su}%%{qenchant::wiad::suffix}%"
  112. replace all "%{_full}%" with "_ENCHANT_" in {qenchant::wiad::su}
  113. delete {_full}
  114. delete {_tier}
  115. delete {_ench}
  116. delete {_item}
  117. show 100 "hearth" particles at location of targeted block for player
  118. create ultra fake lightning at targeted block
  119.  
  120.  
  121. command /qenchant_nazwij:
  122. trigger:
  123. set {qenchant::%player%::name} to true
  124. send "%{qenchant::wiad::prefix}% %{qenchant::wiad::tn}%%{qenchant::wiad::suffix}%"
  125.  
  126. on chat:
  127. if {qenchant::%player%::name} is true:
  128. cancel event
  129. execute player command "/qenchant_menu"
  130. wait a tick
  131. set {_s} to slot 8 of player's current inventory
  132. set name of {_s} to "%colored message%"
  133. set slot 8 of player's current inventory to {_s}
  134. delete {qenchant::%player%::name}
  135.  
  136.  
  137. command /qenchant_repair:
  138. trigger:
  139. wait 3 ticks
  140. execute player command "/qenchant_menu"
  141. wait a tick
  142. set {_s} to slot 8 of player's current inventory
  143. set data of {_s} to 0
  144. set slot 8 of player's current inventory to {_s}
  145. send "%{qenchant::wiad::prefix}% %{qenchant::wiad::re}%%{qenchant::wiad::suffix}%"
  146.  
  147. command /qenchant_reload:
  148. permission: qenchant.admin
  149. trigger:
  150. set {qenchant::wiad::nl} to colored single value "NoLVL" get of "plugins/QEnchant/wiadomosci.yml"
  151. set {qenchant::wiad::nb} to colored single value "NoBOOK" get of "plugins/QEnchant/wiadomosci.yml"
  152. set {qenchant::wiad::ns} to colored single value "NoSPACE" get of "plugins/QEnchant/wiadomosci.yml"
  153. set {qenchant::wiad::su} to colored single value "Success" get of "plugins/QEnchant/wiadomosci.yml"
  154. set {qenchant::wiad::ra} to colored single value "Random" get of "plugins/QEnchant/wiadomosci.yml"
  155. set {qenchant::wiad::re} to colored single value "Repair" get of "plugins/QEnchant/wiadomosci.yml"
  156. set {qenchant::wiad::tn} to colored single value "TypeName" get of "plugins/QEnchant/wiadomosci.yml"
  157. set {qenchant::wiad::na} to colored single value "Name" get of "plugins/QEnchant/wiadomosci.yml"
  158. set {qenchant::wiad::prefix} to colored single value "Prefix" get of "plugins/QEnchant/wiadomosci.yml"
  159. set {qenchant::wiad::suffix} to colored single value "Suffix" get of "plugins/QEnchant/wiadomosci.yml"
  160.  
  161. command /qenchant_random:
  162. trigger:
  163. set {_los} to random integer between 1 to 5
  164. if {_los} is 1 or 2:
  165. set {_los2} to random integer between 1 to 5
  166. if {_los} is 1:
  167. set {_full} to "sharpness %{_los2}%" parsed as enchantment type
  168. set {_full2} to "%{_los2}% sharpness" parsed as enchantment type
  169. if {_los} is 2:
  170. set {_full} to "smite %{_los2}%" parsed as enchantment type
  171. set {_full2} to "%{_los2}% smite" parsed as enchantment type
  172. if {_los} is 3 or 4:
  173. set {_los2} to random integer between 1 to 2
  174. if {_los} is 3:
  175. set {_full} to "knockback %{_los2}%" parsed as enchantment type
  176. set {_full2} to "%{_los2}% knockback" parsed as enchantment type
  177. if {_los} is 4:
  178. set {_full} to "fire aspect %{_los2}%" parsed as enchantment type
  179. set {_full2} to "%{_los2}% fire aspect" parsed as enchantment type
  180. if {_los} is 5:
  181. set {_los2} to random integer between 1 to 3
  182. set {_full} to "looting %{_los2}%" parsed as enchantment type
  183. set {_full2} to "%{_los2}% looting" parsed as enchantment type
  184. wait 3 ticks
  185. execute player command "qenchant_enchant2 %{_full2}%"
  186. replace all "_ENCHANT_" with "%{_full}%" in {qenchant::wiad::ra}
  187. send "%{qenchant::wiad::prefix}% %{qenchant::wiad::ra}%%{qenchant::wiad::suffix}%"
  188.  
  189. command /qenchant_menu:
  190. trigger:
  191. loop all blocks in radius 6 of player:
  192. if loop-block is enchantment table:
  193. set {_ok} to true
  194. if {_ok} is true:
  195. if player's tool is any sword:
  196. set {qenchant::%player%::menu} to true
  197. openMenu(player)
  198. set slot 8 of current inventory of player to player's tool
  199. set player's tool to air
  200. set {qenchant::%player%::tool} to slot 8 of player's current inventory
  201.  
  202.  
  203.  
  204.  
  205. command /qenchant_name:
  206. trigger:
  207. set {qenchant::%player%::toolname} to name of player's tool
  208. set name of player's tool to ""
  209.  
  210.  
  211. command /nazwa [<text>]:
  212. trigger:
  213. set name of player's tool to colored arg
  214.  
  215.  
  216.  
  217. on inventory close:
  218. set {_slot} to slot 8 of player's current inventory
  219. set {qenchant::%player%::tool} to slot 8 of player's current inventory
  220. if {_slot} is {qenchant::%player%::tool}:
  221. if player have space for 1 of {qenchant::%player%::tool}:
  222. give {qenchant::%player%::tool} to player
  223. if player don't have space for 1 of {qenchant::%player%::tool}:
  224. drop {qenchant::%player%::tool} at player
  225.  
  226. on place of enchantment table:
  227. if name of player's tool is "&e&oQ&6&oEnchant":
  228. set {qenchant::%event-block%} to true
  229. set {qenchant::%event-block%::y::min} to y-coordinate of event-block
  230. set {qenchant::%event-block%::y::max} to y-coordinate of event-block
  231. increase y-coordinate of {qenchant::%event-block%::y::max} by +2
  232. send "%{qenchant::wiad::prefix}% %{qenchant::wiad::pe}%%{qenchant::wiad::suffix}%"
  233.  
  234.  
  235. command /qenchant [<text>] [<text>] [<text>] [<text>]:
  236. trigger:
  237. if arg 1 is "daj" or "give":
  238. if player have permission "qenchant.*" or "qenchant.give":
  239. give player enchantment table named "&e&oQ&6&oEnchant" with lore "&5> &aPostaw na ziemi aby utworzyc magiczny enchant&5."
  240. send "%{qenchant::wiad::prefix}% %{qenchant::wiad::ot}%%{qenchant::wiad::suffix}%"
Advertisement
Add Comment
Please, Sign In to add comment