Guest User

Untitled

a guest
Jan 18th, 2020
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 20.63 KB | None | 0 0
  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. if {_number} is 1:
  98. set {_airdrop::type} to "&7Обычный"
  99. else if {_number} is 2:
  100. set {_airdrop::type} to "&aРедкий"
  101. else if {_number} is 3:
  102. set {_airdrop::type} to "&bОчень редкий"
  103. else if {_number} is 4:
  104. set {_airdrop::type} to "&dМифический"
  105. else:
  106. set {_airdrop::type} to "&7Обычный"
  107.  
  108.  
  109.  
  110. else:
  111. chance of 75%:
  112. set {_airdrop::type} to "&7Обычный"
  113. chance of 8%:
  114. if size of all players >= 3:
  115. set {_airdrop::type} to "&aРедкий"
  116. chance of 3%:
  117. if size of all players >= 6:
  118. set {_airdrop::type} to "&bОчень редкий"
  119. chance of 2%:
  120. if size of all players >= 12:
  121. set {_airdrop::type} to "&dМифический"
  122.  
  123. if {_airdrop::type} is not set:
  124. stop
  125.  
  126. # set {_airdrop::type} to random element of {_airdrop::types::*}
  127.  
  128. if {_airdrop::type} is "&7Обычный":
  129. set {_airdrop::type::visualIcon} to "&7⚀"
  130. if {_airdrop::type} is "&aРедкий":
  131. set {_airdrop::type::visualIcon} to "&a⚁"
  132. if {_airdrop::type} is "&bОчень редкий":
  133. set {_airdrop::type::visualIcon} to "&b⚂"
  134. if {_airdrop::type} is "&dМифический":
  135. set {_airdrop::type::visualIcon} to "&d⚃"
  136.  
  137. set {airdrop::%{_code}%::type} to {_airdrop::type}
  138. set {airdrop::%{_code}%::type::visualIcon} to {_airdrop::type::visualIcon}
  139.  
  140. # ⚀⚁⚂⚃
  141. # Время
  142. add 5 seconds to {_airdrop::times::*}
  143. add 10 seconds to {_airdrop::times::*}
  144.  
  145. # add 5 minute to {_airdrop::times::*}
  146. # add 15 minute to {_airdrop::times::*}
  147. # add 25 minute to {_airdrop::times::*}
  148. # add 30 minute to {_airdrop::times::*}
  149. # add 45 minute to {_airdrop::times::*}
  150. # add 1 hour to {_airdrop::times::*}
  151.  
  152. set {_airdrop::time} to random element of {_airdrop::times::*}
  153. set {_airdrop::time::visual} to "%{_airdrop::time}%"
  154.  
  155. replace all "and ", "," and "and" in {_airdrop::time::visual} with ""
  156. replace all "seconds", "second" in {_airdrop::time::visual} with "с."
  157. replace all "minutes", "minute" in {_airdrop::time::visual} with "м."
  158. replace all "hours", "hour" in {_airdrop::time::visual} with "ч."
  159. replace all "days", "day" in {_airdrop::time::visual} with "д."
  160.  
  161. replace all "s" in {_airdrop::time::visual} with ""
  162. if {_airdrop::time::visual} contains ".":
  163. set {_prep::*} to {_airdrop::time::visual} split at " "
  164. loop {_prep::*}:
  165. set {_tmp::loop-value} to loop-value
  166. if {_tmp::loop-value} contains ".":
  167. if {_tmp::loop-value} contains "д." or "ч." or "м." or "с.":
  168. add 1 to {_nothing}
  169. else:
  170. set {_prep2::*} to {_tmp::loop-value} split at "."
  171. set {_erase} to {_prep2::2}
  172.  
  173. set {_erase} to ".%{_prep2::2}%"
  174. replace all "%{_erase}%" in {_airdrop::time::visual} with ""
  175.  
  176.  
  177. # Подготавливаем координатц аирдропа | Визуальный вид
  178. set {_location::visual::x} to x coordinate of {_location}
  179. set {_location::visual::y} to "?"
  180. set {_location::visual::z} to z coordinate of {_location}
  181.  
  182. set {_airdrop::coordinates::visual} to "%{_location::visual::x}%, %{_location::visual::y}%, %{_location::visual::z}%"
  183. set {airdrop::%{_code}%::coordinates::visual} to {_airdrop::coordinates::visual}
  184.  
  185. broadcast "&e⚑ &fАирдроп вида %{_airdrop::type}% &fприземлится на координаты &e%{_airdrop::coordinates::visual}%&f через %{_airdrop::time::visual}%"
  186.  
  187.  
  188. # Расчитываем позицию внизу...
  189. set {_found} to false
  190. while {_found} is false:
  191. if {_location::find} is not set:
  192. set {_location::find} to {_location}
  193. reduce y coordinate of {_location::find} by 1
  194. if block at {_location::find} is not air:
  195. set {_block} to block at {_location::find}
  196. set {_found} to true
  197.  
  198. wait 1 tick
  199.  
  200. loop all blocks in radius 10 around {_location::find}:
  201. set {airdrop::%{_code}%::block::%location of loop-block%::breakable} to false
  202.  
  203. # Airdrop-Worker
  204. set {worker::airdrop::%{_code}%} to "%{_code}%"
  205. while {worker::airdrop::%{_code}%} is set:
  206. if {worker::airdrop::%{_code}%} is "canceled":
  207. # broadcast "&c⚠ &fAirdrop-Worker был выключен. Ближайший аирдроп был отменён."
  208. stopEffect id "airdrop-portal"
  209. stopEffect id "airdrop-shulker"
  210. delete {worker::airdrop::%{_code}%}
  211. delete {airdrop::%{_code}%::*}
  212. stop
  213. # Анимация.
  214.  
  215. if {_airdrop::time} <= 0 seconds:
  216.  
  217. if {_send} is not set:
  218. broadcast "%{_airdrop::type::visualIcon}% %{_airdrop::type}% &fаирдроп уже летит! Берегитесь! &7(Координаты: %{_airdrop::coordinates::visual}%)"
  219. set {_send} to true
  220.  
  221. if {_animated} is not set:
  222. # Анимируем
  223. set {_animating} to true
  224. while {_animating} is true:
  225. if {_location::animating} is not set:
  226.  
  227. set {_location::animating} to {_location}
  228. set {_x} to random integer between -80 and 80
  229. add {_x} to x coordinate of {_location::animating}
  230.  
  231. set {_z} to random integer between -80 and 80
  232. add {_z} to z coordinate of {_location::animating}
  233. add 150 to y coordinate of {_location::animating}
  234.  
  235. set {_location::end} to {_location::find}
  236.  
  237. set {_locations::animation::*} to line({_location::animating}, {_location::end}, 60)
  238.  
  239. # Сама анимация.
  240.  
  241. # Подготовка
  242. set {_s} to size of {_locations::animation::*}
  243. set {_end} to {_locations::animation::%{_s}%}
  244. # broadcast "END: %{_end}% || S: %{_s}%"
  245.  
  246. # delete {worker::airdrop}
  247. # stop
  248. loop {_locations::animation::*}:
  249. drawDot count 1, particle "explosionhuge", center loop-value, visibleRange 2526, keepFor 1 second
  250. # play sound
  251. play sound "entity.generic.burn" with volume 1.2 and pitch 2 at loop-value
  252. play sound "entity.generic.explode" with volume 1.2 and pitch 2 at loop-value
  253.  
  254.  
  255. # broadcast "Yeah"
  256. if "%loop-value%" contains "%{_end}%":
  257. delete {_locations::animation::*}
  258. set {_animating} to false
  259. exit 1 loop
  260. # else:
  261. # broadcast "LOOP: %loop-value% || %{_end}%"
  262. wait 1 tick
  263. # Идём дальше..
  264. # reduce y coordinate of {_location::animating} by 1
  265.  
  266. set {_animated} to true
  267.  
  268.  
  269. # Ставим шалкер с ресами.
  270. # set {_block} to block at {_location::find}
  271. # if block at {_location::find} is not bedrock:
  272. # set {_block::end} to block at {_location::find}
  273. # set block at {_location::find} to bedrock
  274.  
  275. set {_location::shulker} to {_location::find}
  276. add 1 to y coordinate of {_location::shulker}
  277.  
  278. if {_looted} is true:
  279. set {_block} to block at {_location::shulker}
  280.  
  281. loop all items in {_block}'s inventory:
  282. add 1 to {_exist}
  283. if {_exist} is not set:
  284. if {_setted} is not set:
  285. set {_airdrop::wait::time} to 15 seconds
  286. set {_setted} to true
  287. # set {airdrop::%{_code}%::wait::time} to {_airdrop::wait::time}
  288. delete {_exist}
  289. else:
  290. set {_block::air} to block at {_location::shulker}
  291. if {_airdrop::type} is "&7Обычный":
  292. set {_block} to ordinary airdrop
  293.  
  294. # Готовим слоты
  295. 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::*}
  296.  
  297. # if block at {_location::shulker} is not {_block}:
  298. set block at {_location::shulker} to ordinary airdrop
  299.  
  300. set {_block} to block at {_location::shulker}
  301. # Подготавливаем ресы для шалкера
  302. if {_looted} is not set:
  303. chance of 100%:
  304. set {_rand} to random integer between 1 and 15
  305. set {_item} to "%{_rand}% of iron ingot" parsed as item
  306.  
  307. set {_slot} to random element of {_slots::*}
  308. remove {_slot} from {_slots::*}
  309.  
  310. # broadcast "&cdebug &fЛут: %{_rand}% железа."
  311. set slot {_slot} of {_block}'s inventory to {_item}
  312.  
  313. if {_airdrop::type} is "&aРедкий":
  314. # Готовим слоты
  315. 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::*}
  316.  
  317. # if block at {_location::shulker} is not {_block}:
  318. set block at {_location::shulker} to rare airdrop
  319.  
  320. set {_block} to block at {_location::shulker}
  321. # Подготавливаем ресы для шалкера
  322. if {_looted} is not set:
  323.  
  324. # ЛУТ РЕДКОГО АИРА
  325.  
  326. loop all items in {_block}'s inventory:
  327. add 1 to {_exist}
  328. if {_exist} is not set:
  329. set slot {_slot} of {_block}'s inventory to {_item}
  330. set {_looted} to true
  331.  
  332. if {_airdrop::type} is "&bОчень редкий":
  333. # Готовим слоты
  334. 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::*}
  335.  
  336. # if block at {_location::shulker} is not {_block}:
  337. set block at {_location::shulker} to very rare airdrop
  338.  
  339. set {_block} to block at {_location::shulker}
  340. # Подготавливаем ресы для шалкера
  341. if {_looted} is not set:
  342.  
  343. # ЛУТ ОЧЕНЬ РЕДКОГО АИРА
  344.  
  345. loop all items in {_block}'s inventory:
  346. add 1 to {_exist}
  347. if {_exist} is not set:
  348. set slot 13 of {_block}'s inventory to stone named "&9☃ &fУпс, тут пусто."
  349. set {_looted} to true
  350. if {_airdrop::type} is "&dМифический":
  351. # Готовим слоты
  352. 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::*}
  353.  
  354. # if block at {_location::shulker} is not {_block}:
  355. set block at {_location::shulker} to mythic airdrop
  356.  
  357. set {_block} to block at {_location::shulker}
  358. # Подготавливаем ресы для шалкера
  359. if {_looted} is not set:
  360.  
  361. # ЛУТ МИФИЧЕСКОГО АИРА
  362.  
  363. loop all items in {_block}'s inventory:
  364. add 1 to {_exist}
  365. if {_exist} is not set:
  366. set slot 13 of {_block}'s inventory to stone named "&9☃ &fУпс, тут пусто."
  367. set {_looted} to true
  368. # Мини-анимация
  369. 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
  370. reduce {_airdrop::wait::time} by 1 second
  371.  
  372.  
  373. if {_airdrop::wait::time} <= 0 seconds:
  374. delete block at {_location::shulker}
  375. set block at {_location::find} to {_block::end}
  376. set {worker::airdrop::%{_code}%} to "canceled"
  377.  
  378. if {_airdrop::wait::time} is not set:
  379. set {_airdrop::wait::time} to 30 minutes
  380. set {airdrop::%{_code}%::wait::time} to {_airdrop::wait::time}
  381. set {airdrop::%{_code}%::time} to {_airdrop::time}
  382.  
  383. if {airdrop::%{_code}%::time} = 5 minutes:
  384.  
  385. #Force the advancement to be awarded
  386. loop all players:
  387. set {_setting} to getSetting(loop-player, "airdropNotifications")
  388. if {_setting} is 404:
  389. set {_setting} to 1
  390. if {_setting} is 1:
  391. send title "&e⚠ &fУведомление об Аирдропе!" with subtitle "&7Посмотри в таб на время! Ты чуть его не пропустил." to loop-player for 6 seconds with 1 second fade in and 1 second fade out
  392. play sound "block.note.pling" with volume 2 with pitch 2 at loop-player for loop-player
  393.  
  394. if {_airdrop::time} >= 1 second:
  395. set {_location} to {_location::find}
  396. set {data::effectlib::loc::location} to {_location}
  397. execute console command "/effectLib wave loc"
  398. reduce {_airdrop::time} by 1 second
  399. wait 1 second
  400.  
  401.  
  402.  
  403. # if arg 1 is "p" or "pos" or "position" or "setPosition" or "setpos" or "позицияБлять":
  404. # if arg 2 is not set:
  405. # send "&c⚠ &fВ втором аргументе вам нужно указать номер позиции. (1 или 2)"
  406. # stop
  407. # else:
  408. # if arg 2 is 1:
  409. # send title "&a✔ &fУспешно!" with subtitle "&fВы успешно установили &aпервую позицию&f." to player for 3 seconds
  410. #
  411. # set {_location} to player's location
  412. # set {_locations::x} to x coordinate of {_location}
  413. # set {_locations::y} to y coordinate of {_location}
  414. # set {_locations::z} to z coordinate of {_location}
  415. #
  416. # set skript-yaml value "locations.1" from "{@file}" to "%{_locations::x}%,%{_locations::y}%,%{_locations::z}%"
  417. # save yaml "{@file}"
  418. # load yaml "{@file}" as "{@file}"
  419. #
  420. # else if arg 2 is 2:
  421. # send title "&a✔ &fУспешно!" with subtitle "&fВы успешно установили &aвторую позицию&f." to player for 3 seconds
  422. #
  423. # set {_location} to player's location
  424. # set {_locations::x} to x coordinate of {_location}
  425. # set {_locations::y} to y coordinate of {_location}
  426. # set {_locations::z} to z coordinate of {_location}
  427. #
  428. # set skript-yaml value "locations.2" from "{@file}" to "%{_locations::x}%,%{_locations::y}%,%{_locations::z}%"
  429. # save yaml "{@file}"
  430. # load yaml "{@file}" as "{@file}"
  431. #
  432. # else:
  433. # send "&c⚠ &fПозиция &c%arg 2% &fне была обнаружена. Используйте позиции 1 или 2."
  434. # stop
  435. else:
  436. send "&c⚠ &fУ вас нету доступа к этой команде."
  437. stop
  438. on block break:
  439. if {worker::airdrop::*} is set:
  440. loop {worker::airdrop::*}:
  441. if {airdrop::%loop-value%::block::%location of event-block%::breakable} is false:
  442. cancel event
  443.  
  444. on block place:
  445. if {worker::airdrop::*} is set:
  446. loop {worker::airdrop::*}:
  447. if {airdrop::%loop-value%::block::%location of event-block%::breakable} is false:
  448. cancel event
Advertisement
Add Comment
Please, Sign In to add comment