options: #nazwa kazdego bosa zmienne: # {nazwa} - nazwa bosa # {hp} - jego aktualne zdrowie # {maxHp} - jago max zdrowie # {procent} - ilosc hp w procentach (sama liczba) # %% - to zamieni sie na jeden znak % nazwaBosa: &a{nazwa} &7[&a{hp}&7/&a{maxHp}&7] &a{procent}%% #kolor 1 c1: &3 #kolor 2 c2: &2 #kolor 3 c3: &b on inventory close: loop {boss::*}: if "%inventory name of player's current inventory%" is "&7Drop %loop-index%": clear {boss::%loop-index%::drops::*} loop items in player's current inventory: if loop-item is not air: add loop-item to {boss::%loop-index%::drops::*} on skript enable: execute console command "spawnsavedbosses" on skript disable: loop {boss::*}: if {boss::%loop-index%} is alive: set {boss::%loop-index%::lastSeenLoc} to location of {boss::%loop-index%} set {boss::%loop-index%::lastSeenHp} to {boss::%loop-index%::hp} set {_} to location of {boss::%loop-index%} remove 1000 from y-coord of {_} teleport {boss::%loop-index%} to {_} kill {boss::%loop-index%} set {boss::%loop-index%} to 1 command /spawnsavedbosses []: executable by: console trigger: loop {boss::*}: if {boss::%loop-index%::lastSeenLoc} is set: set {boss::%loop-index%::nextRespawnTime} to -1 spawn {boss::%loop-index%::type} at {boss::%loop-index%::lastSeenLoc} set {boss::%loop-index%} to last spawned entity set name of last spawned entity to "%{_}%" set {boss::%loop-index%::name} to "%{_}%" wait 1 tick kill {boss::%loop-index%} command /bossinfo []: executable by: console trigger: send "{@c1}/boss {@c2} {@c1}usun {@c3}- usuwa bosa" to player-arg send "{@c1}/boss {@c2} {@c1}stworz {@c3}- tworzy bosa" to player-arg send "{@c1}/boss {@c2} {@c1}info {@c3}- info o bosie" to player-arg send "{@c1}/boss {@c2} {@c1}zycie {@c2} {@c3}- ustawia zycie bosa" to player-arg send "{@c1}/boss {@c2} {@c1}armor {@c3}- daje bosowi armor ktory masz ubrany" to player-arg send "{@c1}/boss {@c2} {@c1}bron {@c3}- daje bosowi bron ktora trzymasz w rece" to player-arg send "{@c1}/boss {@c2} {@c1}spawn {@c3}- ustawa srodek spawnu bosa" to player-arg send "{@c1}/boss {@c2} {@c1}zasieg {@c3}- ustawia ilosc kratek od srodka spawnu w ktorych moze sie zrespic boss" to player-arg send "{@c1}/boss {@c2} {@c1}czas {@c2} {@c3}- ustawia czas respienia bosa" to player-arg send "{@c1}/boss {@c2} {@c1}drop {@c3}- ustawia dropy z bosa" to player-arg send "{@c1}/boss {@c2} {@c1}typ {@c2} {@c3}- ustawia typ bosa" to player-arg command /boss [] [] []: executable by: player trigger: if args-1 is not set: execute console command "bossinfo %player%" if {boss::%args-1%::*} is not set: if args-2 is "stworz": if {boss::%args-1%::*} is not set: set {boss::%args-1%::hp} to 100 set {boss::%args-1%::maxHp} to 100 set {boss::%args-1%::helmet} to air set {boss::%args-1%::chestplate} to air set {boss::%args-1%::leggings} to air set {boss::%args-1%::boots} to air set {boss::%args-1%::tool} to air set {boss::%args-1%::respawnTime} to 5 set {boss::%args-1%::nextRespawnTime} to -1 set {boss::%args-1%::type} to "zombie" parsed as entity type set {boss::%args-1%::spawn} to location of block at location of sender set {boss::%args-1%::spawnRadius} to 0 spawn {boss::%args-1%::type} at {boss::%args-1%::spawn} set {boss::%args-1%} to last spawned entity kill {boss::%args-1%} send "{@c1}Stworzono bosa {@c2}%args-1%" to sender else: send "{@c1}Boss {@c2}%args-1% {@c1}juz istnieje" to sender else: send "{@c1}Boss {@c2}%args-1% {@c1}nie istnieje" to sender else: if args-2 is "drop": if args-3 is not set: open chest with 3 rows named "&7Drop %args-1%" to player wait 2 tick if inventory name of current inventory of player is "&7Drop %args-1%": loop {boss::%args-1%::drops::*}: set {_} to loop-index parsed as integer set slot {_}-1 of current inventory of player to loop-value else if args-2 is "info": send "{@c1}Nazwa: {@c2}%args-1%" to sender send "{@c1}Zycie: {@c2}%{boss::%args-1%::maxHp}%" to sender send "{@c1}Typ: {@c2}%{boss::%args-1%::type}%" to sender send "{@c1}Respawn: {@c2}%{boss::%args-1%::respawnTime}% sec" to sender send "{@c1}Ilosc dropow: {@c2}%size of {boss::%args-1%::drops::*}%" to sender send "{@c1}Helm: {@c2}%{boss::%args-1%::helmet}%" to sender send "{@c1}Klata: {@c2}%{boss::%args-1%::chestplate}%" to sender send "{@c1}Spodnie: {@c2}%{boss::%args-1%::leggings}%" to sender send "{@c1}Buty: {@c2}%{boss::%args-1%::boots}%" to sender send "{@c1}Bron: {@c2}%{boss::%args-1%::tool}%" to sender if {boss::%args-1%} is alive: send "{@c1}Status: {@c2}zywy %location of {boss::%args-1%}%" to sender else: send "{@c1}Status: {@c2}odrodzenie za %{boss::%args-1%::nextRespawnTime}% sec" to sender send "{@c1}Spawn: {@c2}%{boss::%args-1%::spawn}%" to sender send "{@c1}Zasieg spawnu: {@c2}%{boss::%args-1%::spawnRadius}%" to sender else if args-2 is "usun": clear {boss::%args-1%::*} if {boss::%args-1%} is alive: kill {boss::%args-1%} clear {boss::%args-1%} send "{@c1}Usunieto bosa {@c2}%args-1%" to sender else if args-2 is "typ": if args-3 parsed as entity type is set: set {boss::%args-1%::type} to args-3 parsed as entity type if {boss::%args-1%} is alive: set {boss::%args-1%::nextRespawnTime} to -1 kill {boss::%args-1%} send "{@c1}Ustawiono typ bosa {@c2}%args-1% {@c1}na {@c2}%args-3 parsed as entity type%" to sender else: send "{@c1}Typ bosa musi byc zwierzeciem/potworem" to sender else if args-2 is "zasieg": if args-3 parsed as integer is set: set {boss::%args-1%::spawnRadius} to args-3 parsed as integer send "{@c1}Ustawiono zasieg respienia bosa {@c2}%args-1% {@c1}na {@c2}%args-3%" to sender else: send "{@c1}Zasieg respienia bosa musi byc liczba calokowita" to sender else if args-2 is "spawn": set {boss::%args-1%::spawn} to location of block at location of player send "{@c1}Ustawiono spawn bosa {@c2}%args-1%" to sender else if args-2 is "czas": if args-3 parsed as integer is set: set {boss::%args-1%::respawnTime} to args-3 parsed as integer clear {boss::%args-1%::nextRespawnTime} send "{@c1}Ustawiono czas respienia bosa {@c2}%args-1% {@c1}na {@c2}%args-3%" to sender else: send "{@c1}Czas respienia bosa musi byc liczba calokowita" to sender else if args-2 is "zycie": if args-3 parsed as integer is set: set {boss::%args-1%::maxHp} to args-3 parsed as integer if {boss::%args-1%} is alive: set {boss::%args-1%::hp} to {boss::%args-1%::maxHp} loop all entities: if "%{boss::%args-1%::name}%" is "%name of loop-entity%": set {_} to "{@nazwaBosa}" set {_hp} to {boss::%args-1%::hp} set {_maxHp} to {boss::%args-1%::maxHp} set {_prc} to {_hp}/{_maxHp}*100 replace "{nazwa}" with "%args-1%" in {_} replace "{hp}" with "%{_hp}%" in {_} replace "{maxHp}" with "%{_maxHp}%" in {_} replace "{procent}" with "%{_prc}%" in {_} set name of loop-entity to "%{_}%" set {boss::%args-1%::name} to "%{_}%" exit send "{@c1}Ustawiono hp bosa {@c2}%args-1% {@c1}na {@c2}%args-3%" to sender else: send "{@c1}Zycie bosa musi byc liczba calokowita" to sender else if args-2 is "armor": set {boss::%args-1%::helmet} to player's helmet set {boss::%args-1%::chestplate} to player's chestplate set {boss::%args-1%::leggings} to player's leggings set {boss::%args-1%::boots} to player's boots if {boss::%args-1%} is alive: set helmet of {boss::%args-1%} to {boss::%args-1%::helmet} set chestplate of {boss::%args-1%} to {boss::%args-1%::chestplate} set leggings of {boss::%args-1%} to {boss::%args-1%::leggings} set boots of {boss::%args-1%} to {boss::%args-1%::boots} send "{@c1}Ustawiono armor bosa {@c2}%args-2%" to sender else if args-2 is "bron": set {boss::%args-1%::tool} to player's tool if {boss::%args-1%} is alive: set tool of {boss::%args-1%} to {boss::%args-1%::tool} send "{@c1}Ustawiono bron bosa {@c2}%args-2%" to sender else: execute console command "bossinfo %player%" on damage: loop {boss::*}: if "%{boss::%loop-index%::name}%" is "%name of victim%": if {boss::%loop-index%::*} is set: remove damage*1.0 from {boss::%loop-index%::hp} set damage to 0 if {boss::%loop-index%::hp} < 0: cancel event kill {boss::%loop-index%} else: set {_} to "{@nazwaBosa}" set {_hp} to {boss::%loop-index%::hp} set {_maxHp} to {boss::%loop-index%::maxHp} set {_prc} to {_hp}/{_maxHp}*100 replace "{nazwa}" with loop-index in {_} replace "{hp}" with "%{_hp}%" in {_} replace "{maxHp}" with "%{_maxHp}%" in {_} replace "{procent}" with "%{_prc}%" in {_} set name of victim to "%{_}%" set {boss::%loop-index%::name} to "%{_}%" on death: loop {boss::*}: if "%{boss::%loop-index%::name}%" is "%name of victim%": if {boss::%loop-index%::*} is set: set drops to {boss::%loop-index%::drops::*} if {boss::%loop-index%::nextRespawnTime} == -1: set {_} to location of victim remove 1000 from y-coord of {_} teleport victim to {_} set {boss::%loop-index%::nextRespawnTime} to 0 if {boss::%loop-index%::nextRespawnTime} is not set: set {boss::%loop-index%::nextRespawnTime} to {boss::%loop-index%::respawnTime} while {boss::%loop-index%::nextRespawnTime} > 0: remove 1 from {boss::%loop-index%::nextRespawnTime} wait 1 second clear {boss::%loop-index%::nextRespawnTime} if {boss::%loop-index%::lastSeenLoc} is not set: set {_spawnPoint} to {boss::%loop-index%::spawn} set y-coord of {_spawnPoint} to 255 while y-coord of {_spawnPoint} > 0: if block at {_spawnPoint} is air: if block 1 up {_spawnPoint} is air: if block 1 down {_spawnPoint} is not air: exit loop remove 0.5 from y-coord of {_spawnPoint} set {_xOffset} to random number between {boss::%loop-index%::spawnRadius}*-1.0 and {boss::%loop-index%::spawnRadius} set {_zOffset} to random number between {boss::%loop-index%::spawnRadius}*-1.0 and {boss::%loop-index%::spawnRadius} add {_xOffset} to x-coord of {_spawnPoint} add {_zOffset} to z-coord of {_spawnPoint} else: set {_spawnPoint} to {boss::%loop-index%::lastSeenLoc} clear {boss::%loop-index%::lastSeenLoc} spawn {boss::%loop-index%::type} at {_spawnPoint} set {boss::%loop-index%} to last spawned entity set {boss::%loop-index%::hp} to {boss::%loop-index%::maxHp} heal {boss::%loop-index%} set helmet of {boss::%loop-index%} to {boss::%loop-index%::helmet} set chestplate of {boss::%loop-index%} to {boss::%loop-index%::chestplate} set leggings of {boss::%loop-index%} to {boss::%loop-index%::leggings} set boots of {boss::%loop-index%} to {boss::%loop-index%::boots} set tool of {boss::%loop-index%} to {boss::%loop-index%::tool} set {_} to "{@nazwaBosa}" set {_prc} to 100 if {boss::%loop-index%::lastSeenHp} is set: set {boss::%loop-index%::hp} to {boss::%loop-index%::lastSeenHp} clear {boss::%loop-index%::lastSeenHp} set {_hp} to {boss::%loop-index%::hp} set {_maxHp} to {boss::%loop-index%::maxHp} replace "{nazwa}" with loop-index in {_} replace "{hp}" with "%{_hp}%" in {_} replace "{maxHp}" with "%{_maxHp}%" in {_} replace "{procent}" with "%{_prc}%" in {_} set name of last spawned entity to "%{_}%" set {boss::%loop-index%::name} to "%{_}%" else: clear drops