# ########################################################### # # 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 # 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: -3000 x-max: 3000 z-min: -3000 z-max: 3000 # Ś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: 3 # Czas w minutach po którym znika nieodebrany drop sugerowany czas maxymalny [TIME -1] despawn_time: 2 # Czas w minutach od wylądowania skrzyni do możliwości otwarcia Użyj 0 aby wyłączyć! Sugerowany czas mmaxymalny [DESPAWN_TIME -1] claim_time: 1 # 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}%&a&lSkrzynia zamknięta przez &c&l{@claim_time} minut(y)!" 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 every {@time} minutes: 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 256 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 256 set block at {_random} to {@chest_type} set name of block at {_random} to {@gui_name} send "%{@prefix}%&a&lZaopatrzenie zmierza w kierunku lokalizacji %{_x}%, %{_z}%! %nl%Strefa zrzutu w promieniu %{@radius}% bloków od %{_x}%, %{_z}%!!" to all players 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 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: set block at {_loc} to {@chest_type} named {@gui_name} send "%{@prefix}%&a&lZaopatrzenie zmierza w kierunku lokalizacji %{_x}%, %{_z}%!!" to all players 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 if block under {_loc2} is not air: if {@despawn_time} > 0: 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 if block under {_loc2} is not air: 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 wait {@claim_time} minutes set {claim_time} to true 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::*}