# ########################################################### # # Name: Supply Crate # Author: Saanjuk @doped.pl # Code Version: 1.0 # Minecraft Server Version: > 1.12.2 # # Special thanks to szajkor for suggesting the idea for the script! # # ChangeLog: # v 1.1 - Optimization # - Add more customization options # v 1.0 - Create code :) # ########################################################### options: # Jak pokazywać lokalizacje zrzutu? Flase- Dokładna (X,Y) True - Niedokładna (w promieniu RADIUS bloków od random lokazlizacji wokół zrzutu) strefa: false # Czy włączyć smoka dostarczającego zrzut? (UWAGA przy włączonym smoku zaleca się zwiększyć czas między zrzutami!) # DO POPRAWNEGO DZIAŁANIA SMOKA WYMAGANY JEST ADDON Skellett! dragon: true # Przy ustawieniua strefa: TRUE podaje maxymalny promien przybliżonej lokalizacji skrzyni radius: "10" # minialne raz maxymalne wartości koordynatów X i Y gdzie może spaść drop x-min: 600 x-max: 700 z-min: 600 z-max: 700 # Świat w którym są dokonywane zrzuty zaopatrzenia - w przypadku więcej niż 1 świata nalezy podawać je w cudzysłowiu oddzielając słowem "and" Przykład: world: "world" and "survial_world" world: "world" # Czas w minutach między dropami time: 2 # Czas w minutach po którym znika nieodebrany drop sugerowany czas maxymalny [TIME -1] Sugerujemy nie wyłączać tej opcji! despawn_time: 1 # Czas w minutach od wylądowania skrzyni do możliwości otwarcia Użyj 0 aby wyłączyć! MUSI BYĆ MNIEJSZY OD DESPAWN TIME! claim_time: 0 # Prefix Wiadomości na czacie aby wyłączyć wpisz "&r" prefix: "&2&l[&7SupplyDrop&2&l] &r" # Ilość Graczy w świecie WORLD wymagana do startu dropu aby wyłączyć wpisz 0 playersCount: 1 # ################################################### # # Nagrody podzielone na kilka opcji ponieważ skript # # gubi się gdy dopiszemy dużo nbt do itemków nagród # # pamiętaj że każda z tych opcji musi znajdować się # # w "on load" na samym dole kodu! # # # # ################################################### # # używać nagród innych niż zwykłe? valuable_items: true nagrody_zwykle: diamond and gold ingot and diamond nagrody_rzadkie: diamond chestplate of protection 2 named "&d&lDiaxowa Klata" and diamond axe of sharpness 3 named "&d&lDiaxowa Siekierka" nagrody_rzadkie2: diamond pickaxe of efficiency 3 named "&d&lDiaxowy Kilof" and diamond shovel of efficiency 4 named "&d&lDiaxowa Łopata" nagrody_legendarne: netherite ingot with custom model data 1 named "&d&lNetherytowa Sztabka" nagrody_epickie: netherite pickaxe of fortune 4 and unbreaking 4 with custom model data 1 named "&d&lNetherytowy Kilof" nagrody_epickie1: netherite axe of efficiency 6 and sharpness 5 with custom model data 1 named "&d&lNetherytowa Siekiera" nagrody_epickie2: netherite hoe of unbreaking 5 with custom model data 1 named "&d&lNetherytowa Motyka" nagrody_epickie3: netherite shovel of efficiency 4 and unbreaking 4 with custom model data 1 named "&d&lNetherytowa Łopata" # Procentowe szanse na lepszy drop: rare: 20 # rzadki legendary: 5 # legendarny epic: 1 # epicki # Nazwa skrzyni z zaopatrzeniem gui_name: "&6&lSkrzynia zaopatrzenia" # Typ skrzyni z zaopatrzeniem chest_type: brown shulker box function supply(p:player): set {nagrody::*} to {@nagrody_zwykle} set {_gui} to chest inventory with 3 rows named {@gui_name} set slot 11 of {_gui} to random element out of {nagrody::*} set slot 12 of {_gui} to random element out of {nagrody::*} set slot 13 of {_gui} to random element out of {nagrody::*} set slot 14 of {_gui} to random element out of {nagrody::*} set slot 15 of {_gui} to random element out of {nagrody::*} if {@valuable_items} is true: chance of {@rare}%: set slot 13 of {_gui} to random element out of {nagrody_rzadkie::*} chance of {@legendary}%: set slot 13 of {_gui} to random element out of {@nagrody_legendarne} chance of {@epic}%: set slot 13 of {_gui} to random element out of {nagrody_epickie::*} loop {nagrody_rzadkie::*}: if slot 13 of {_gui} contains loop-value: send "%{@prefix}%&6&lGratulacje! &6Znalazłeś rzadki zrzut!" to {_p} loop {nagrody_legendarne::*}: if slot 13 of {_gui} contains loop-value: send "%{@prefix}%&6&lGratulacje! &6Znalazłeś &2&llegandarny&6 zrzut!" to {_p} loop {nagrody_epickie::*}: if slot 13 of {_gui} contains loop-value: send "%{@prefix}%&6&lGratulacje! &6Znalazłeś &s&lEpicki&6 zrzut!" to {_p} loop 3 times: play sound "entity_experience_orb_pickup" to {_p} wait tick show {_gui} to {_p} give slot (integers between 11 and 15) of {_gui} to {_p} wait 3 seconds close {_p}'s inventory on inventory click: name of event-inventory is {@gui_name}: cancel event on rightclick on {@chest_type}: if name of event-block is {@gui_name}: cancel event if block under event-block is not air : if {@claim_time} > 0: if {claim_time} is true: set event-block to air supply(player) delete {claim_time} else: send "%{@prefix}%&c&lSkrzynia jest nadal zamknięta!!" to all players else: set event-block to air supply(player) else: send "%{@prefix}%&cMusisz zaczekać aż skrzynia wyląduje!!" to player on mine {@chest_type}: if name of event-block is {@gui_name}: cancel event on command "/dragon": delete {supllydrop::playersCount} loop all players in world {@world}: add loop-player to {_list::*} set {supllydrop::playersCount} to size of {_list::*} if {supllydrop::playersCount} is not set: stop if {supllydrop::playersCount} >= {@playersCount}: set {_x} to random integer between {@x-min} and {@x-max} set {_z} to random integer between {@z-min} and {@z-max} set {_y} to 100 set {_loc} to location at ({_x}, {_y}, {_z}) in world {@world} if {@strefa} is true: loop all blocks in radius ({@radius} parsed as integer) around {_loc}: add loop-block to {_blocks::*} set {_block} to random element of {_blocks::*} set {_random} to location of {_block} set {_random}'s y-pos to 100 send "%{@prefix}%&a&lZaopatrzenie zmierza w kierunku lokalizacji %{_x}%, %{_z}%! %nl%Strefa zrzutu w promieniu %{@radius}% bloków od %{_x}%, %{_z}%!!" to all players if {@dragon} is true: if plugin "Skellett" is not enabled: send "[&eSkript&r] &4ERROR% {@prefix}%&4&lWłączyłes opcje smoka bez wymaganego addonu!" to console stop else: loop all blocks in radius 200 around {_random}: add loop-block to {_blockss::*} set {_dblock} to random element of {_blockss::*} set {_planeloc} to location of {_dblock} # set {_planeloc}'s yaw to {_loc}'s x-pos # set {_planeloc}'s pitch to {_loc}'s y-pos spawn an ender dragon at {_planeloc} set {_plane} to last spawned entity set name of {_plane} to "&cSupplyDrop" while distance between {_plane} and {_random} is bigger than 0: if chunk at {_plane} is loaded: teleport {_plane} to location of the block 1 horizontally behind {_plane} wait 10 tick else: set {_chunk} to chunk at {_plane} load chunk {_chunk} wait 10 tick kill {_plane} send "%{@prefix}%&a&lSmok zrzuca skrzynie!" to all players set block at {_random} to {@chest_type} set name of block at {_random} to {@gui_name} while block under {_random} is air: set block at {_random} to air set {_random}'s y-pos to ({_random}'s y-pos -0.5) set block at {_random} to {@chest_type} set name of block at {_random} to {@gui_name} show campfire signal smoke on block at {_random} to all players wait 2 tick set {_loc2} to {_random} if block under {_random} is not air: send "%{@prefix}%&a&lZaopatrzenie dotarło do Strefy zrzutu!" to all players if {@claim_time} > 0: set {claim_time} to false send "%{@prefix}%&a&lSkrzynia zamknięta przez &c&l{@claim_time} minut(y)!" to all players loop ({@claim_time})*60 times: show campfire signal smoke on block above {_loc2} to all players wait 1 second set {claim_time} to true set {_diff} to ({@despawn_time} - {@claim_time}) loop ({_diff}*60) times: show campfire signal smoke on block above {_loc2} to all players wait 1 second if block at {_loc2} is {@chest_type}: send "%{@prefix}%&c&lNikt nie dobiegł do zrzutu!" to all players set block at {_loc2} to air else: wait {@despawn_time} minutes if block at {_loc2} is {@chest_type}: send "%{@prefix}%&c&lNikt nie dobiegł do zrzutu!" to all players set block at {_loc2} to air else: if {@dragon} is true: if plugin "Skellett" is not enabled: send "[&eSkript&r] &4ERROR% {@prefix}%&4&lWłączyłes opcje smoka bez wymaganego addonu!" to console stop else: loop integers from -200 to -100: add loop-value to {_numbers::*} loop integers from 100 to 200: add loop-value to {_numbers::*} set {_x1} to {_loc}'s x-pos + random integer of {_numbers::*} set {_z1} to {_loc}'s z-pos + random integer of {_numbers::*} set {_planeloc} to location at ({_x1}, 100, {_z1}) in world {@world} send "Spawn smoka na: %{_planeloc}% " to console spawn an armor stand at {_planeloc} set {_pilot} to last spawned entity execute console command "tp Saanjuk %{_x1}% 100 %{_z1}%" wait 100 ticks force {_pilot} to face the block 3 meters above {_loc} at head rotation speed 100.5 set {_yaw} to {_pilot}'s yaw set {_pitch} to {_pilot}'s pitch kill {_pilot} send "%{@prefix}%&a&lZaopatrzenie zmierza w kierunku lokalizacji %{_x}%, %{_z}%!!" to all players and console execute console command "/summon ender_dragon %{_x1}% 350 %{_z1}% {DragonPhase:0,Glowing:1b,Rotation:[%{_yaw}%f,%{_pitch}%f],Motion:[%{_x}%d,100d,%{_z}%d]}" loop all enderdragons in world "world": set {_plane} to loop-entity set name of {_plane} to "&cSupplyDrop" teleport {_plane} to location at (0, 500, 0) in world {@world} wait 50 ticks teleport {_plane} to {_planeloc} while distance between location of {_plane} and {_loc} is greater than 10: if block in front of {_plane} is air: thrust {_plane} (vector from {_plane} to {_loc}) with force 0.5 force {_plane} look at location of {_loc} wait 5 ticks else: thrust {_plane} up with force 1 wait 5 ticks kill {_plane} send "%{@prefix}%&a&lSmok zrzuca skrzynie!" to all players and console set block at {_loc} to {@chest_type} named {@gui_name} while block under {_loc} is air: set block at {_loc} to air set {_loc}'s y-pos to ({_loc}'s y-pos -0.5) set block at {_loc} to {@chest_type} named {@gui_name} set name of block at {_loc} to {@gui_name} show campfire signal smoke on block at {_loc} to all players wait 2 tick set {_loc2} to {_loc} if block under {_loc2} is not air: send "%{@prefix}%&a&lZaopatrzenie dotarło do Strefy zrzutu!" to all players and console if {@claim_time} > 0: set {claim_time} to false send "%{@prefix}%&a&lSkrzynia zamknięta przez &c&l{@claim_time} minut(y)!" to all players loop ({@claim_time})*60 times: show campfire signal smoke on block above {_loc2} to all players wait 1 second set {claim_time} to true set {_diff} to ({@despawn_time} - {@claim_time}) loop ({_diff}*60) times: show campfire signal smoke on block above {_loc2} to all players wait 1 second if block at {_loc2} is {@chest_type}: send "%{@prefix}%&c&lNikt nie dobiegł do zrzutu!" to all players set block at {_loc2} to air else: wait {@despawn_time} minutes if block at {_loc2} is {@chest_type}: send "%{@prefix}%&c&lNikt nie dobiegł do zrzutu!" to all players set block at {_loc2} to air on load: delete {nagrody_epickie::*} and {nagrody_rzadkie::*} set {nagrody::*} to {@nagrody_zwykle} if {@valuable_items} is true: add {@nagrody_epickie} to {nagrody_epickie::*} add {@nagrody_epickie1} to {nagrody_epickie::*} add {@nagrody_epickie2} to {nagrody_epickie::*} add {@nagrody_epickie3} to {nagrody_epickie::*} add {@nagrody_rzadkie} to {nagrody_rzadkie::*} add {@nagrody_rzadkie2} to {nagrody_rzadkie::*}