Advertisement
Guest User

Untitled

a guest
Jan 18th, 2020
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # Конец разработки 25.06.19
  2. # на
  3. # options:
  4. # file: /home/Airdrop/config.yml
  5. aliases:
  6. ordinary airdrop = minecraft:white_shulker_box {Damage: 1}
  7. rare airdrop = minecraft:lime_shulker_box {Damage: 1}
  8. very rare airdrop = minecraft:light_blue_shulker_box {Damage: 1}
  9. mythic airdrop = minecraft:magenta_shulker_box {Damage: 1}
  10.  
  11. on join:
  12. delete {temp::%player%::deleteAll}
  13.  
  14. every 45 minutes:
  15. if size of all players >= 2:
  16. execute console command "/airdrop s"
  17.  
  18. command airdrop [<text>] [<number>]:
  19. aliases: a, air
  20. trigger:
  21. if executor is op or console:
  22. # if arg 1 is "d" or "delete":
  23. # if {airdrop::data::blocks::*} is set:
  24. # if {temp::%player%::deleteAll} is set:
  25. # delete {airdrop::data::blocks::*}
  26. # delete {temp::%player%::deleteAll}
  27. # send "&a✔ &fВы успешно удалили все блоки!"
  28. # stop
  29. # else:
  30. # send "&e⚠ &fВы собираетесь удалить все блоки для аирдропа. Напишите эту команду ещё раз, что бы удалить!"
  31. # add 1 to {temp::%player%::deleteAll}
  32. # wait 15 minutes
  33. # delete {temp::%player%::deleteAll}
  34. # else:
  35. # send "&c⚠ &fМассив с блоками для аирдропа не был обнаружен."
  36. if arg 1 is "forcecancel" or "fc":
  37. if {worker::airdrop::*} is not set:
  38. send "&e⚠ &fНи одного работающего Airdrop-Worker не было обнаруженого."
  39. stop
  40. else:
  41. delete {worker::airdrop::*}
  42. send "&a✔ &fВы успешно удалили все аирдропы."
  43. stop
  44. if arg 1 is "c" or "cancel":
  45. if {worker::airdrop::*} is not set:
  46. send "&e⚠ &fНи одного работающего Airdrop-Worker не было обнаруженого."
  47. stop
  48. else:
  49. # loop {worker::airdrop::*}:
  50. loop {worker::airdrop::*}:
  51. set {worker::airdrop::%loop-value%} to "canceled"
  52. # delete {worker::airdrop::*}
  53. # set {worker::airdrop::*} to "canceled"
  54. send "&a✔ &fСигнал об отмене был успешно отправлен всем аирдропам."
  55. stop
  56. if arg 1 is "s" or "start":
  57. set {_location::1} to 1
  58. set {_location::2} to 2
  59.  
  60. if {_location::1} or {_location::2} is not set:
  61. send "&c⚠ &fКакая-то из позиций не была установленна."
  62. else:
  63. replace all " " in {_location::1} and {_location::2} with ""
  64. set {_locations::1::*} to {_location::1} split at ","
  65. set {_locations::2::*} to {_location::2} split at ","
  66.  
  67. # broadcast "&e⚐ &fРассчитываем позицию для аирдропа... Возможны небольшие лаги."
  68. set {_code} to random integer between 0 and 100000
  69.  
  70. # Аирдропы. Типы и бла-бла-бла
  71. # Расчитываем...
  72. #
  73. if arg-2 is set:
  74. set {_number} to "%arg-2%"
  75.  
  76. if {_number} contains "9":
  77. set {_location} to location of player
  78.  
  79. replace all "9" in {_number} with ""
  80. set {_number} to {_number} parsed as number
  81. else:
  82. set {_number} to "%arg-2%" parsed as number
  83.  
  84.  
  85. if {airdrop::data::blocks::*} is not set:
  86. broadcast "&c⚠ &fБлижайший аирдроп был отменён потому, что в системе не был найдён список всех блоков."
  87. delete {worker::airdrop::%{_code}%}
  88. stop
  89. set {_finding} to true
  90. while {_finding} is true:
  91. set {_location} to random element of {airdrop::data::blocks::*}
  92. if {_location} is within border:
  93. set {_finding} to false
  94. else:
  95. set {_location} to random element of {airdrop::data::blocks::*}
  96.  
  97. set {_airdrop::type} to "&7Обычный"
  98.  
  99. # set {_airdrop::type} to random element of {_airdrop::types::*}
  100.  
  101. if {_airdrop::type} is "&7Обычный":
  102. set {_airdrop::type::visualIcon} to "&7⚀"
  103. if {_airdrop::type} is "&aРедкий":
  104. set {_airdrop::type::visualIcon} to "&a⚁"
  105. if {_airdrop::type} is "&bОчень редкий":
  106. set {_airdrop::type::visualIcon} to "&b⚂"
  107. if {_airdrop::type} is "&dМифический":
  108. set {_airdrop::type::visualIcon} to "&d⚃"
  109.  
  110. set {airdrop::%{_code}%::type} to {_airdrop::type}
  111. set {airdrop::%{_code}%::type::visualIcon} to {_airdrop::type::visualIcon}
  112.  
  113. # ⚀⚁⚂⚃
  114. # Время
  115. add 5 seconds to {_airdrop::times::*}
  116. add 10 seconds to {_airdrop::times::*}
  117.  
  118. # add 5 minute to {_airdrop::times::*}
  119. # add 15 minute to {_airdrop::times::*}
  120. # add 25 minute to {_airdrop::times::*}
  121. # add 30 minute to {_airdrop::times::*}
  122. # add 45 minute to {_airdrop::times::*}
  123. # add 1 hour to {_airdrop::times::*}
  124.  
  125. set {_airdrop::time} to random element of {_airdrop::times::*}
  126. set {_airdrop::time::visual} to "%{_airdrop::time}%"
  127.  
  128. replace all "and ", "," and "and" in {_airdrop::time::visual} with ""
  129. replace all "seconds", "second" in {_airdrop::time::visual} with "с."
  130. replace all "minutes", "minute" in {_airdrop::time::visual} with "м."
  131. replace all "hours", "hour" in {_airdrop::time::visual} with "ч."
  132. replace all "days", "day" in {_airdrop::time::visual} with "д."
  133.  
  134. replace all "s" in {_airdrop::time::visual} with ""
  135. if {_airdrop::time::visual} contains ".":
  136. set {_prep::*} to {_airdrop::time::visual} split at " "
  137. loop {_prep::*}:
  138. set {_tmp::loop-value} to loop-value
  139. if {_tmp::loop-value} contains ".":
  140. if {_tmp::loop-value} contains "д." or "ч." or "м." or "с.":
  141. add 1 to {_nothing}
  142. else:
  143. set {_prep2::*} to {_tmp::loop-value} split at "."
  144. set {_erase} to {_prep2::2}
  145.  
  146. set {_erase} to ".%{_prep2::2}%"
  147. replace all "%{_erase}%" in {_airdrop::time::visual} with ""
  148.  
  149.  
  150. # Подготавливаем координатц аирдропа | Визуальный вид
  151. set {_location::visual::x} to x coordinate of {_location}
  152. set {_location::visual::y} to "?"
  153. set {_location::visual::z} to z coordinate of {_location}
  154.  
  155. set {_airdrop::coordinates::visual} to "%{_location::visual::x}%, %{_location::visual::y}%, %{_location::visual::z}%"
  156. set {airdrop::%{_code}%::coordinates::visual} to {_airdrop::coordinates::visual}
  157.  
  158. broadcast "&e⚑ &fАирдроп вида %{_airdrop::type}% &fприземлится на координаты &e%{_airdrop::coordinates::visual}%&f через %{_airdrop::time::visual}%"
  159.  
  160.  
  161. # Расчитываем позицию внизу...
  162. set {_found} to false
  163. while {_found} is false:
  164. if {_location::find} is not set:
  165. set {_location::find} to {_location}
  166. reduce y coordinate of {_location::find} by 1
  167. if block at {_location::find} is not air:
  168. set {_block} to block at {_location::find}
  169. set {_found} to true
  170.  
  171. wait 1 tick
  172.  
  173. loop all blocks in radius 10 around {_location::find}:
  174. set {airdrop::%{_code}%::block::%location of loop-block%::breakable} to false
  175.  
  176. # Airdrop-Worker
  177. set {worker::airdrop::%{_code}%} to "%{_code}%"
  178. while {worker::airdrop::%{_code}%} is set:
  179. if {worker::airdrop::%{_code}%} is "canceled":
  180. # broadcast "&c⚠ &fAirdrop-Worker был выключен. Ближайший аирдроп был отменён."
  181. stopEffect id "airdrop-portal"
  182. stopEffect id "airdrop-shulker"
  183. delete {worker::airdrop::%{_code}%}
  184. delete {airdrop::%{_code}%::*}
  185. stop
  186. # Анимация.
  187.  
  188. if {_airdrop::time} <= 0 seconds:
  189.  
  190. if {_send} is not set:
  191. broadcast "%{_airdrop::type::visualIcon}% %{_airdrop::type}% &fаирдроп уже летит! Берегитесь! &7(Координаты: %{_airdrop::coordinates::visual}%)"
  192. set {_send} to true
  193.  
  194. if {_animated} is not set:
  195. # Анимируем
  196. set {_animating} to true
  197. while {_animating} is true:
  198. if {_location::animating} is not set:
  199.  
  200. set {_location::animating} to {_location}
  201. set {_x} to random integer between -80 and 80
  202. add {_x} to x coordinate of {_location::animating}
  203.  
  204. set {_z} to random integer between -80 and 80
  205. add {_z} to z coordinate of {_location::animating}
  206. add 150 to y coordinate of {_location::animating}
  207.  
  208. set {_location::end} to {_location::find}
  209.  
  210. set {_locations::animation::*} to line({_location::animating}, {_location::end}, 60)
  211.  
  212. # Сама анимация.
  213.  
  214. # Подготовка
  215. set {_s} to size of {_locations::animation::*}
  216. set {_end} to {_locations::animation::%{_s}%}
  217. # broadcast "END: %{_end}% || S: %{_s}%"
  218.  
  219. # delete {worker::airdrop}
  220. # stop
  221. loop {_locations::animation::*}:
  222. drawDot count 1, particle "explosionhuge", center loop-value, visibleRange 2526, keepFor 1 second
  223. # play sound
  224. play sound "entity.generic.burn" with volume 1.2 and pitch 2 at loop-value
  225. play sound "entity.generic.explode" with volume 1.2 and pitch 2 at loop-value
  226.  
  227.  
  228. # broadcast "Yeah"
  229. if "%loop-value%" contains "%{_end}%":
  230. delete {_locations::animation::*}
  231. set {_animating} to false
  232. exit 1 loop
  233. # else:
  234. # broadcast "LOOP: %loop-value% || %{_end}%"
  235. wait 1 tick
  236. # Идём дальше..
  237. # reduce y coordinate of {_location::animating} by 1
  238.  
  239. set {_animated} to true
  240.  
  241.  
  242. # Ставим шалкер с ресами.
  243. # set {_block} to block at {_location::find}
  244. # if block at {_location::find} is not bedrock:
  245. # set {_block::end} to block at {_location::find}
  246. # set block at {_location::find} to bedrock
  247.  
  248. set {_location::shulker} to {_location::find}
  249. add 1 to y coordinate of {_location::shulker}
  250.  
  251. if {_looted} is true:
  252. set {_block} to block at {_location::shulker}
  253.  
  254. loop all items in {_block}'s inventory:
  255. add 1 to {_exist}
  256. if {_exist} is not set:
  257. if {_setted} is not set:
  258. set {_airdrop::wait::time} to 15 seconds
  259. set {_setted} to true
  260. # set {airdrop::%{_code}%::wait::time} to {_airdrop::wait::time}
  261. delete {_exist}
  262. else:
  263. set {_block::air} to block at {_location::shulker}
  264. if {_airdrop::type} is "&7Обычный":
  265. set {_block} to ordinary airdrop
  266.  
  267. # Готовим слоты
  268. add 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26 to {_slots::*}
  269.  
  270. # if block at {_location::shulker} is not {_block}:
  271. set block at {_location::shulker} to ordinary airdrop
  272.  
  273. set {_block} to block at {_location::shulker}
  274. # Подготавливаем ресы для шалкера
  275. if {_looted} is not set:
  276. chance of 100%:
  277. set {_rand} to random integer between 1 and 15
  278. set {_item} to {_rand} of iron ingot
  279.  
  280. set {_slot} to random element of {_slots::*}
  281. remove {_slot} from {_slots::*}
  282.  
  283. # broadcast "&cdebug &fЛут: %{_rand}% железа."
  284. set slot {_slot} of {_block}'s inventory to {_item}
  285.  
  286. # Мини-анимация
  287. drawComplexSpiral particle "redstone", center {_location::shulker}, id "airdrop-shulker", rainbowMode false, clockwise true, scan true, radius 2, density 50, height 6, effectMod .05, start 0, visibleRange 30
  288. reduce {_airdrop::wait::time} by 1 second
  289.  
  290.  
  291. if {_airdrop::wait::time} <= 0 seconds:
  292. delete block at {_location::shulker}
  293. set block at {_location::find} to {_block::end}
  294. set {worker::airdrop::%{_code}%} to "canceled"
  295.  
  296. if {_airdrop::wait::time} is not set:
  297. set {_airdrop::wait::time} to 30 minutes
  298. set {airdrop::%{_code}%::wait::time} to {_airdrop::wait::time}
  299. set {airdrop::%{_code}%::time} to {_airdrop::time}
  300.  
  301. if {airdrop::%{_code}%::time} = 5 minutes:
  302.  
  303. #Force the advancement to be awarded
  304. loop all players:
  305. set {_setting} to getSetting(loop-player, "airdropNotifications")
  306. if {_setting} is 404:
  307. set {_setting} to 1
  308. if {_setting} is 1:
  309. send title "&e⚠ &fУведомление об Аирдропе!" with subtitle "&7Посмотри в таб на время! Ты чуть его не пропустил." to loop-player for 6 seconds with 1 second fade in and 1 second fade out
  310. play sound "block.note.pling" with volume 2 with pitch 2 at loop-player for loop-player
  311.  
  312. if {_airdrop::time} >= 1 second:
  313. set {_location} to {_location::find}
  314. set {data::effectlib::loc::location} to {_location}
  315. execute console command "/effectLib wave loc"
  316. reduce {_airdrop::time} by 1 second
  317. wait 1 second
  318.  
  319.  
  320.  
  321. # if arg 1 is "p" or "pos" or "position" or "setPosition" or "setpos" or "позицияБлять":
  322. # if arg 2 is not set:
  323. # send "&c⚠ &fВ втором аргументе вам нужно указать номер позиции. (1 или 2)"
  324. # stop
  325. # else:
  326. # if arg 2 is 1:
  327. # send title "&a✔ &fУспешно!" with subtitle "&fВы успешно установили &aпервую позицию&f." to player for 3 seconds
  328. #
  329. # set {_location} to player's location
  330. # set {_locations::x} to x coordinate of {_location}
  331. # set {_locations::y} to y coordinate of {_location}
  332. # set {_locations::z} to z coordinate of {_location}
  333. #
  334. # set skript-yaml value "locations.1" from "{@file}" to "%{_locations::x}%,%{_locations::y}%,%{_locations::z}%"
  335. # save yaml "{@file}"
  336. # load yaml "{@file}" as "{@file}"
  337. #
  338. # else if arg 2 is 2:
  339. # send title "&a✔ &fУспешно!" with subtitle "&fВы успешно установили &aвторую позицию&f." to player for 3 seconds
  340. #
  341. # set {_location} to player's location
  342. # set {_locations::x} to x coordinate of {_location}
  343. # set {_locations::y} to y coordinate of {_location}
  344. # set {_locations::z} to z coordinate of {_location}
  345. #
  346. # set skript-yaml value "locations.2" from "{@file}" to "%{_locations::x}%,%{_locations::y}%,%{_locations::z}%"
  347. # save yaml "{@file}"
  348. # load yaml "{@file}" as "{@file}"
  349. #
  350. # else:
  351. # send "&c⚠ &fПозиция &c%arg 2% &fне была обнаружена. Используйте позиции 1 или 2."
  352. # stop
  353. else:
  354. send "&c⚠ &fУ вас нету доступа к этой команде."
  355. stop
  356. on block break:
  357. if {worker::airdrop::*} is set:
  358. loop {worker::airdrop::*}:
  359. if {airdrop::%loop-value%::block::%location of event-block%::breakable} is false:
  360. cancel event
  361.  
  362. on block place:
  363. if {worker::airdrop::*} is set:
  364. loop {worker::airdrop::*}:
  365. if {airdrop::%loop-value%::block::%location of event-block%::breakable} is false:
  366. cancel event
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement