Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Конец разработки 25.06.19
- # на
- # options:
- # file: /home/Airdrop/config.yml
- aliases:
- ordinary airdrop = minecraft:white_shulker_box {Damage: 1}
- rare airdrop = minecraft:lime_shulker_box {Damage: 1}
- very rare airdrop = minecraft:light_blue_shulker_box {Damage: 1}
- mythic airdrop = minecraft:magenta_shulker_box {Damage: 1}
- on join:
- delete {temp::%player%::deleteAll}
- every 45 minutes:
- if size of all players >= 2:
- execute console command "/airdrop s"
- command airdrop [<text>] [<number>]:
- aliases: a, air
- trigger:
- if executor is op or console:
- # if arg 1 is "d" or "delete":
- # if {airdrop::data::blocks::*} is set:
- # if {temp::%player%::deleteAll} is set:
- # delete {airdrop::data::blocks::*}
- # delete {temp::%player%::deleteAll}
- # send "&a✔ &fВы успешно удалили все блоки!"
- # stop
- # else:
- # send "&e⚠ &fВы собираетесь удалить все блоки для аирдропа. Напишите эту команду ещё раз, что бы удалить!"
- # add 1 to {temp::%player%::deleteAll}
- # wait 15 minutes
- # delete {temp::%player%::deleteAll}
- # else:
- # send "&c⚠ &fМассив с блоками для аирдропа не был обнаружен."
- if arg 1 is "forcecancel" or "fc":
- if {worker::airdrop::*} is not set:
- send "&e⚠ &fНи одного работающего Airdrop-Worker не было обнаруженого."
- stop
- else:
- delete {worker::airdrop::*}
- send "&a✔ &fВы успешно удалили все аирдропы."
- stop
- if arg 1 is "c" or "cancel":
- if {worker::airdrop::*} is not set:
- send "&e⚠ &fНи одного работающего Airdrop-Worker не было обнаруженого."
- stop
- else:
- # loop {worker::airdrop::*}:
- loop {worker::airdrop::*}:
- set {worker::airdrop::%loop-value%} to "canceled"
- # delete {worker::airdrop::*}
- # set {worker::airdrop::*} to "canceled"
- send "&a✔ &fСигнал об отмене был успешно отправлен всем аирдропам."
- stop
- if arg 1 is "s" or "start":
- set {_location::1} to 1
- set {_location::2} to 2
- if {_location::1} or {_location::2} is not set:
- send "&c⚠ &fКакая-то из позиций не была установленна."
- else:
- replace all " " in {_location::1} and {_location::2} with ""
- set {_locations::1::*} to {_location::1} split at ","
- set {_locations::2::*} to {_location::2} split at ","
- # broadcast "&e⚐ &fРассчитываем позицию для аирдропа... Возможны небольшие лаги."
- set {_code} to random integer between 0 and 100000
- # Аирдропы. Типы и бла-бла-бла
- # Расчитываем...
- #
- if arg-2 is set:
- set {_number} to "%arg-2%"
- if {_number} contains "9":
- set {_location} to location of player
- replace all "9" in {_number} with ""
- set {_number} to {_number} parsed as number
- else:
- set {_number} to "%arg-2%" parsed as number
- if {airdrop::data::blocks::*} is not set:
- broadcast "&c⚠ &fБлижайший аирдроп был отменён потому, что в системе не был найдён список всех блоков."
- delete {worker::airdrop::%{_code}%}
- stop
- set {_finding} to true
- while {_finding} is true:
- set {_location} to random element of {airdrop::data::blocks::*}
- if {_location} is within border:
- set {_finding} to false
- else:
- set {_location} to random element of {airdrop::data::blocks::*}
- set {_airdrop::type} to "&7Обычный"
- # set {_airdrop::type} to random element of {_airdrop::types::*}
- if {_airdrop::type} is "&7Обычный":
- set {_airdrop::type::visualIcon} to "&7⚀"
- if {_airdrop::type} is "&aРедкий":
- set {_airdrop::type::visualIcon} to "&a⚁"
- if {_airdrop::type} is "&bОчень редкий":
- set {_airdrop::type::visualIcon} to "&b⚂"
- if {_airdrop::type} is "&dМифический":
- set {_airdrop::type::visualIcon} to "&d⚃"
- set {airdrop::%{_code}%::type} to {_airdrop::type}
- set {airdrop::%{_code}%::type::visualIcon} to {_airdrop::type::visualIcon}
- # ⚀⚁⚂⚃
- # Время
- add 5 seconds to {_airdrop::times::*}
- add 10 seconds to {_airdrop::times::*}
- # add 5 minute to {_airdrop::times::*}
- # add 15 minute to {_airdrop::times::*}
- # add 25 minute to {_airdrop::times::*}
- # add 30 minute to {_airdrop::times::*}
- # add 45 minute to {_airdrop::times::*}
- # add 1 hour to {_airdrop::times::*}
- set {_airdrop::time} to random element of {_airdrop::times::*}
- set {_airdrop::time::visual} to "%{_airdrop::time}%"
- replace all "and ", "," and "and" in {_airdrop::time::visual} with ""
- replace all "seconds", "second" in {_airdrop::time::visual} with "с."
- replace all "minutes", "minute" in {_airdrop::time::visual} with "м."
- replace all "hours", "hour" in {_airdrop::time::visual} with "ч."
- replace all "days", "day" in {_airdrop::time::visual} with "д."
- replace all "s" in {_airdrop::time::visual} with ""
- if {_airdrop::time::visual} contains ".":
- set {_prep::*} to {_airdrop::time::visual} split at " "
- loop {_prep::*}:
- set {_tmp::loop-value} to loop-value
- if {_tmp::loop-value} contains ".":
- if {_tmp::loop-value} contains "д." or "ч." or "м." or "с.":
- add 1 to {_nothing}
- else:
- set {_prep2::*} to {_tmp::loop-value} split at "."
- set {_erase} to {_prep2::2}
- set {_erase} to ".%{_prep2::2}%"
- replace all "%{_erase}%" in {_airdrop::time::visual} with ""
- # Подготавливаем координатц аирдропа | Визуальный вид
- set {_location::visual::x} to x coordinate of {_location}
- set {_location::visual::y} to "?"
- set {_location::visual::z} to z coordinate of {_location}
- set {_airdrop::coordinates::visual} to "%{_location::visual::x}%, %{_location::visual::y}%, %{_location::visual::z}%"
- set {airdrop::%{_code}%::coordinates::visual} to {_airdrop::coordinates::visual}
- broadcast "&e⚑ &fАирдроп вида %{_airdrop::type}% &fприземлится на координаты &e%{_airdrop::coordinates::visual}%&f через %{_airdrop::time::visual}%"
- # Расчитываем позицию внизу...
- set {_found} to false
- while {_found} is false:
- if {_location::find} is not set:
- set {_location::find} to {_location}
- reduce y coordinate of {_location::find} by 1
- if block at {_location::find} is not air:
- set {_block} to block at {_location::find}
- set {_found} to true
- wait 1 tick
- loop all blocks in radius 10 around {_location::find}:
- set {airdrop::%{_code}%::block::%location of loop-block%::breakable} to false
- # Airdrop-Worker
- set {worker::airdrop::%{_code}%} to "%{_code}%"
- while {worker::airdrop::%{_code}%} is set:
- if {worker::airdrop::%{_code}%} is "canceled":
- # broadcast "&c⚠ &fAirdrop-Worker был выключен. Ближайший аирдроп был отменён."
- stopEffect id "airdrop-portal"
- stopEffect id "airdrop-shulker"
- delete {worker::airdrop::%{_code}%}
- delete {airdrop::%{_code}%::*}
- stop
- # Анимация.
- if {_airdrop::time} <= 0 seconds:
- if {_send} is not set:
- broadcast "%{_airdrop::type::visualIcon}% %{_airdrop::type}% &fаирдроп уже летит! Берегитесь! &7(Координаты: %{_airdrop::coordinates::visual}%)"
- set {_send} to true
- if {_animated} is not set:
- # Анимируем
- set {_animating} to true
- while {_animating} is true:
- if {_location::animating} is not set:
- set {_location::animating} to {_location}
- set {_x} to random integer between -80 and 80
- add {_x} to x coordinate of {_location::animating}
- set {_z} to random integer between -80 and 80
- add {_z} to z coordinate of {_location::animating}
- add 150 to y coordinate of {_location::animating}
- set {_location::end} to {_location::find}
- set {_locations::animation::*} to line({_location::animating}, {_location::end}, 60)
- # Сама анимация.
- # Подготовка
- set {_s} to size of {_locations::animation::*}
- set {_end} to {_locations::animation::%{_s}%}
- # broadcast "END: %{_end}% || S: %{_s}%"
- # delete {worker::airdrop}
- # stop
- loop {_locations::animation::*}:
- drawDot count 1, particle "explosionhuge", center loop-value, visibleRange 2526, keepFor 1 second
- # play sound
- play sound "entity.generic.burn" with volume 1.2 and pitch 2 at loop-value
- play sound "entity.generic.explode" with volume 1.2 and pitch 2 at loop-value
- # broadcast "Yeah"
- if "%loop-value%" contains "%{_end}%":
- delete {_locations::animation::*}
- set {_animating} to false
- exit 1 loop
- # else:
- # broadcast "LOOP: %loop-value% || %{_end}%"
- wait 1 tick
- # Идём дальше..
- # reduce y coordinate of {_location::animating} by 1
- set {_animated} to true
- # Ставим шалкер с ресами.
- # set {_block} to block at {_location::find}
- # if block at {_location::find} is not bedrock:
- # set {_block::end} to block at {_location::find}
- # set block at {_location::find} to bedrock
- set {_location::shulker} to {_location::find}
- add 1 to y coordinate of {_location::shulker}
- if {_looted} is true:
- set {_block} to block at {_location::shulker}
- loop all items in {_block}'s inventory:
- add 1 to {_exist}
- if {_exist} is not set:
- if {_setted} is not set:
- set {_airdrop::wait::time} to 15 seconds
- set {_setted} to true
- # set {airdrop::%{_code}%::wait::time} to {_airdrop::wait::time}
- delete {_exist}
- else:
- set {_block::air} to block at {_location::shulker}
- if {_airdrop::type} is "&7Обычный":
- set {_block} to ordinary airdrop
- # Готовим слоты
- 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::*}
- # if block at {_location::shulker} is not {_block}:
- set block at {_location::shulker} to ordinary airdrop
- set {_block} to block at {_location::shulker}
- # Подготавливаем ресы для шалкера
- if {_looted} is not set:
- chance of 100%:
- set {_rand} to random integer between 1 and 15
- set {_item} to {_rand} of iron ingot
- set {_slot} to random element of {_slots::*}
- remove {_slot} from {_slots::*}
- # broadcast "&cdebug &fЛут: %{_rand}% железа."
- set slot {_slot} of {_block}'s inventory to {_item}
- set {_looted} to true
- # Мини-анимация
- 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
- reduce {_airdrop::wait::time} by 1 second
- if {_airdrop::wait::time} <= 0 seconds:
- delete block at {_location::shulker}
- set block at {_location::find} to {_block::end}
- set {worker::airdrop::%{_code}%} to "canceled"
- if {_airdrop::wait::time} is not set:
- set {_airdrop::wait::time} to 30 minutes
- set {airdrop::%{_code}%::wait::time} to {_airdrop::wait::time}
- set {airdrop::%{_code}%::time} to {_airdrop::time}
- if {airdrop::%{_code}%::time} = 5 minutes:
- #Force the advancement to be awarded
- loop all players:
- set {_setting} to getSetting(loop-player, "airdropNotifications")
- if {_setting} is 404:
- set {_setting} to 1
- if {_setting} is 1:
- send title "&e⚠ &fУведомление об Аирдропе!" with subtitle "&7Посмотри в таб на время! Ты чуть его не пропустил." to loop-player for 6 seconds with 1 second fade in and 1 second fade out
- play sound "block.note.pling" with volume 2 with pitch 2 at loop-player for loop-player
- if {_airdrop::time} >= 1 second:
- set {_location} to {_location::find}
- set {data::effectlib::loc::location} to {_location}
- execute console command "/effectLib wave loc"
- reduce {_airdrop::time} by 1 second
- wait 1 second
- # if arg 1 is "p" or "pos" or "position" or "setPosition" or "setpos" or "позицияБлять":
- # if arg 2 is not set:
- # send "&c⚠ &fВ втором аргументе вам нужно указать номер позиции. (1 или 2)"
- # stop
- # else:
- # if arg 2 is 1:
- # send title "&a✔ &fУспешно!" with subtitle "&fВы успешно установили &aпервую позицию&f." to player for 3 seconds
- #
- # set {_location} to player's location
- # set {_locations::x} to x coordinate of {_location}
- # set {_locations::y} to y coordinate of {_location}
- # set {_locations::z} to z coordinate of {_location}
- #
- # set skript-yaml value "locations.1" from "{@file}" to "%{_locations::x}%,%{_locations::y}%,%{_locations::z}%"
- # save yaml "{@file}"
- # load yaml "{@file}" as "{@file}"
- #
- # else if arg 2 is 2:
- # send title "&a✔ &fУспешно!" with subtitle "&fВы успешно установили &aвторую позицию&f." to player for 3 seconds
- #
- # set {_location} to player's location
- # set {_locations::x} to x coordinate of {_location}
- # set {_locations::y} to y coordinate of {_location}
- # set {_locations::z} to z coordinate of {_location}
- #
- # set skript-yaml value "locations.2" from "{@file}" to "%{_locations::x}%,%{_locations::y}%,%{_locations::z}%"
- # save yaml "{@file}"
- # load yaml "{@file}" as "{@file}"
- #
- # else:
- # send "&c⚠ &fПозиция &c%arg 2% &fне была обнаружена. Используйте позиции 1 или 2."
- # stop
- else:
- send "&c⚠ &fУ вас нету доступа к этой команде."
- stop
- on block break:
- if {worker::airdrop::*} is set:
- loop {worker::airdrop::*}:
- if {airdrop::%loop-value%::block::%location of event-block%::breakable} is false:
- cancel event
- on block place:
- if {worker::airdrop::*} is set:
- loop {worker::airdrop::*}:
- if {airdrop::%loop-value%::block::%location of event-block%::breakable} is false:
- cancel event
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement