├── team.sk ├── util.sk ├── battleroyale.sk └── border.sk /team.sk: -------------------------------------------------------------------------------- 1 | options: 2 | p: &c( 배틀로얄 ) &f 3 | 4 | function splitTeam(size: number): 5 | loop {_size} times: 6 | delete {BR.flag.team.%loop-number%::*} 7 | set {_plist::*} to all players 8 | set {_num} to size of {_plist::*} 9 | set {_playerperteam} to round({_num} / {_size}) 10 | loop {_size} times: 11 | loop {_playerperteam} times: 12 | set {_rnd} to random element out of {_plist::*} 13 | remove {_rnd} from {_plist::*} 14 | add {_rnd} to {BR.flag.team.%loop-iteration-1%::*} 15 | set {_uuid} to uuid of {_rnd} 16 | set {BR.player.team.%{_uuid}%} to loop-iteration-1 17 | send "&7당신은 %{BR.player.team.%{_uuid}%}% 팀 입니다!" to {_rnd} 18 | loop {_plist::*}: 19 | add loop-value to {BR.flag.team.%loop-iteration%::*} 20 | set {_uuid} to uuid of loop-value 21 | set {BR.player.team.%{_uuid}%} to loop-iteration 22 | send "&7당신은 %{BR.player.team.%{_uuid}%}% 팀 입니다!" to loop-value 23 | 24 | loop {_size} times: 25 | broadcast "{@p} %loop-number% 팀 - %{BR.flag.team.%loop-number%::*}%" 26 | 27 | function teamTP(size: number): 28 | execute console command "xp add @a 180 levels" 29 | loop {_size} times: 30 | execute console command "team add %loop-number%" 31 | execute console command "team modify %loop-number% nametagVisibility hideForOtherTeams" 32 | loop {BR.flag.team.%loop-iteration%::*}: 33 | execute console command "team join %loop-number-1% %loop-value-2%" 34 | loop {_size} times: #왠진 모르겠는데 sublist 쓰면 첫번째 인덱스 루프가 그냥 박살남 ㅅㅂ 일단 임시로 이렇게 두고 만듬 35 | loop {BR.flag.team.%loop-number%::*}: 36 | if loop-number is 1: 37 | set {_loc} to brGetspawnloc("++") 38 | else if loop-number is 2: 39 | set {_loc} to brGetspawnloc("--") 40 | else if loop-number is 3: 41 | set {_loc} to brGetspawnloc("+-") 42 | else if loop-number is 4: 43 | set {_loc} to brGetspawnloc("-+") 44 | teleport loop-value-2 to {_loc} 45 | 46 | function teamInit(size: number): 47 | splitTeam({_size}) 48 | teamTP({_size}) 49 | 50 | command /teamtest: 51 | trigger: 52 | teamInit(2) 53 | loop 2 times: #왠진 모르겠는데 sublist 쓰면 첫번째 인덱스 루프가 그냥 박살남 ㅅㅂ 일단 임시로 이렇게 두고 만듬 54 | loop {BR.flag.team::%loop-number%::*}: 55 | broadcast "%loop-value-1% %loop-value-2%" 56 | 57 | command /팀가르기 []: 58 | trigger: 59 | splitTeam(arg 1) 60 | 61 | command /팀참여 []: 62 | trigger: 63 | if arg 1 is not set: 64 | stop 65 | else: 66 | loop 4 times: 67 | if loop-number is arg 1: 68 | add player to {BR.flag.team.%loop-number%::*} 69 | set {BR.player.team.%uuid of player%} to loop-number 70 | else: 71 | remove player from {BR.flag.team.%loop-number%::*} 72 | send "&7팀에 참여했습니다!" 73 | -------------------------------------------------------------------------------- /util.sk: -------------------------------------------------------------------------------- 1 | options: 2 | p: &c( 배틀로얄 ) &f 3 | 4 | function updateCompass(): 5 | wait 2 seconds 6 | loop all players: 7 | set {_loc} to location of loop-player 8 | set x coordinate of {_loc} to {BR.flag.nextborderCenter.x} 9 | set z coordinate of {_loc} to {BR.flag.nextborderCenter.z} 10 | set loop-player's compass target to {_loc} 11 | send "{@p} 나침반이 업데이트 되었습니다" to loop-player 12 | 13 | function brSuply(): 14 | set {_tmp} to {BR.flag.phase} + 1 15 | set {_newsize} to {BR.data.borderSize::%{_tmp}%} 16 | set {_coords::*} to makeRandomcenter({_newsize},10,{BR.flag.nextborderCenter.x},{BR.flag.nextborderCenter.z}) 17 | set {_x} to {_coords::1} 18 | set {_z} to {_coords::2} 19 | set {_tmploc} to location at {_x}, 256, {_z} of the world "world" 20 | while block at {_tmploc} is air: 21 | set {_y} to y-coordinate of {_tmploc} 22 | set y-coordinate of {_tmploc} to {_y} - 1 23 | set y-coordinate of {_tmploc} to {_y} 24 | set block at {_tmploc} to chest 25 | set {_int} to random integer between 1 and 5 26 | set slot 0 of block at {_tmploc} to ({_int} of blaze rod) 27 | set {_int} to random integer between 0 and 2 28 | set slot 1 of block at {_tmploc} to ({_int} of netherite ingot) 29 | set {_int} to random integer between 5 and 10 30 | set slot 2 of block at {_tmploc} to ({_int} of quartz) 31 | set {_int} to random integer between 5 and 8 32 | set slot 3 of block at {_tmploc} to ({_int} of glowstone dust) 33 | set {_int} to random integer between 64 and 64 34 | set slot 4 of block at {_tmploc} to ({_int} of iron ingot) 35 | set {_int} to random integer between 32 and 64 36 | set slot 5 of block at {_tmploc} to ({_int} of iron ingot) 37 | set {_int} to random integer between 10 and 30 38 | set slot 6 of block at {_tmploc} to ({_int} of gold ingot) 39 | broadcast "{@p} ( %{_x}%, %{_z}% ) 에 보급이 소환되었습니다!" 40 | 41 | on break: 42 | if event-block is iron ore: 43 | cancel event 44 | set {_rnd} to random integer between 1 and 5 45 | drop {_rnd} of iron ingot at event-block 46 | set block at event-block to air 47 | if event-block is deepslate iron ore: 48 | cancel event 49 | set {_rnd} to random integer between 1 and 5 50 | drop {_rnd} of iron ingot at event-block 51 | set block at event-block to air 52 | if event-block is gold ore: 53 | cancel event 54 | set {_rnd} to random integer between 1 and 5 55 | drop {_rnd} of gold ingot at event-block 56 | set block at event-block to air 57 | if event-block is deepslate gold ore: 58 | cancel event 59 | set {_rnd} to random integer between 1 and 5 60 | drop {_rnd} of gold ingot at event-block 61 | set block at event-block to air 62 | 63 | if event-block is copper ore: 64 | cancel event 65 | set {_rnd} to random integer between 1 and 5 66 | drop {_rnd} of copper ingot at event-block 67 | set block at event-block to air 68 | if event-block is deepslate copper ore: 69 | cancel event 70 | set {_rnd} to random integer between 1 and 5 71 | drop {_rnd} of copper ingot at event-block 72 | set block at event-block to air 73 | if event-block is sand: 74 | cancel event 75 | set {_rnd} to random integer between 1 and 1 76 | drop {_rnd} of glass block at event-block 77 | set block at event-block to air 78 | 79 | command /suplytest: 80 | trigger: 81 | brSuply() 82 | 83 | command /밥: 84 | trigger: 85 | give 64 of bread to player 86 | 87 | on join: 88 | set player's max health to 20 89 | heal player 90 | on respawn: 91 | wait 1 tick 92 | set player's max health to 20 93 | heal player 94 | on damage: 95 | if attacker is not player: 96 | set damage to damage / 2 97 | 98 | 99 | on death: 100 | if attacker is player: 101 | set {_rnd} to random integer between 1 and 3 102 | drop {_rnd} of gunpowder at victim's location 103 | chance of 35%: 104 | drop 1 of amethyst shard at victim's location -------------------------------------------------------------------------------- /battleroyale.sk: -------------------------------------------------------------------------------- 1 | options: 2 | p: &c( 배틀로얄 ) &f 3 | 4 | on load: 5 | delete {BR.data.borderSize::*} 6 | add 2500 to {BR.data.borderSize::*} 7 | add 2000 to {BR.data.borderSize::*} 8 | add 1500 to {BR.data.borderSize::*} 9 | add 1000 to {BR.data.borderSize::*} 10 | add 500 to {BR.data.borderSize::*} 11 | add 100 to {BR.data.borderSize::*} 12 | add 10 to {BR.data.borderSize::*} 13 | add 0 to {BR.data.borderSize::*} 14 | 15 | function brGameinit(mode: text,size: number): 16 | set {BR.flag.isIngame} to true 17 | set {BR.flag.gametime} to 0 18 | set {BR.delay} to 500 19 | brBorderinit() 20 | if {_mode} is "default": 21 | teamInit({_size}) 22 | else if {_mode} is "custom": 23 | teamTP({_size}) 24 | while {BR.flag.phase} < 7: 25 | if {BR.flag.isshrinking} is false: 26 | add 1 to {BR.flag.gametime} 27 | set {_left} to {BR.delay} - {BR.flag.gametime} 28 | set {_x1} to {BR.flag.nextborderCenter.x} + ({BR.flag.size} / 2) 29 | set {_x2} to {BR.flag.nextborderCenter.x} - ({BR.flag.size} / 2) 30 | set {_z1} to {BR.flag.nextborderCenter.z} + ({BR.flag.size} / 2) 31 | set {_z2} to {BR.flag.nextborderCenter.z} - ({BR.flag.size} / 2) 32 | loop all players: 33 | set {_xc} to x-coordinate of loop-player's location 34 | set {_zc} to z-coordinate of loop-player's location 35 | if brIsinnextborder({_xc},{_zc},{BR.flag.phase} + 1) is true: 36 | send action bar "&7자기장 크기: &c%{BR.flag.size}% &f| &7자기장 축소까지: &c%{_left}%초 남음 &f| &7다음 자기장 중앙: &c(%{BR.flag.nextborderCenter.x}%,%{BR.flag.nextborderCenter.z}%)" to loop-player 37 | else: 38 | send action bar "&7자기장 크기: &c%{BR.flag.size}% &f| &7자기장 축소까지: &c%{_left}%초 남음 &f| &7다음 자기장 중앙: &c(%{BR.flag.nextborderCenter.x}%,%{BR.flag.nextborderCenter.z}%) &f| &4&l현재 다음 자기장 바깥에 있습니다!" to loop-player 39 | 40 | if {BR.flag.gametime} >= {BR.delay}: 41 | set {BR.flag.gametime} to 0 42 | if {BR.flag.phase} is 2: 43 | set {BR.delay} to 420 44 | if {BR.flag.phase} is 3: 45 | set {BR.delay} to 180 46 | if {BR.flag.phase} is 4: 47 | set {BR.delay} to 100 48 | if {BR.flag.phase} is 5: 49 | set {BR.delay} to 50 50 | if {BR.flag.phase} is 6: 51 | set {BR.delay} to 30 52 | brShrinkborder() 53 | wait 1 second 54 | 55 | every 4 minute: 56 | if {BR.flag.phase} is between 1 and 6: 57 | brSuply() 58 | 59 | command /br [] []: 60 | trigger: 61 | if arg 1 is not set: 62 | send "{@p} /br startdefault [size]" to player 63 | send "{@p} /br startim [size]" to player 64 | if arg 1 is "startdefault": 65 | set {BR.flag.phase} to 10 66 | wait 2 seconds 67 | brGameinit("default",arg 2) 68 | else if arg 1 is "startim": 69 | set {BR.flag.phase} to 10 70 | wait 2 seconds 71 | brGameinit("im",arg 2) 72 | 73 | 74 | 75 | command /chd: 76 | trigger: 77 | make player execute command "/setblock ~ ~ ~ tacz:gun_smith_table" 78 | 79 | command /총: 80 | trigger: 81 | make player execute command "/setblock ~ ~ ~ tacz:gun_smith_table" 82 | 83 | command /기본템설정: 84 | trigger: 85 | open chest inventory with 6 row named "기본템설정" to player 86 | loop {BR.items::*}: 87 | set slot (loop-counter)-1 of current inventory of player to loop-value 88 | 89 | command /기본템: 90 | trigger: 91 | copy {BR.items::*} to {_cpy::*} 92 | give {_cpy::*} to player 93 | 94 | command /rlqhsxpa: 95 | trigger: 96 | copy {BR.items::*} to {_cpy::*} 97 | give {_cpy::*} to player 98 | 99 | on inventory close: 100 | if name of current inventory of player is "기본템설정": 101 | delete {BR.items::*} 102 | loop 54 times: 103 | if slot (loop-counter)-1 of current inventory of player is not air: 104 | add slot (loop-counter)-1 of current inventory of player to {BR.items::*} 105 | 106 | -------------------------------------------------------------------------------- /border.sk: -------------------------------------------------------------------------------- 1 | options: 2 | p: &c( 배틀로얄 ) &f 3 | 4 | function setBordercenter(prevsize: number, xLoc1: number,zLoc1: number,xLoc2: number,zLoc2: number,time: number): 5 | set {BR.flag.isshrinking} to true 6 | set {_time} to round({_time}) 7 | set {_xstep} to ({_xLoc2} - {_xLoc1}) / {_time} 8 | set {_zstep} to ({_zLoc2} - {_zLoc1}) / {_time} 9 | loop {_time} times: 10 | set {_perc} to round(loop-number/{_time}*100) 11 | if mod(loop-number, 60) is 0: 12 | loop all players: 13 | set {_xc} to x-coordinate of loop-player's location 14 | set {_zc} to z-coordinate of loop-player's location 15 | if brIsinnextborder({_xc},{_zc},{BR.flag.phase}) is false: 16 | send title "&f" with subtitle "&4&l[!] 자기장안으로 진입해야합니다!" to loop-player for 1 second 17 | send action bar "&7자기장 크기: &c%{_prevsize}% &7> &c%{BR.flag.size}% &f| &7자기장 축소 진행률: &c%{_perc}%%% &f| &7자기장 중앙: &c( %{_xLoc2}%, %{_zLoc2}% )" to all players 18 | if {BR.debug} is true: 19 | stop 20 | add {_xstep} to {_xLoc1} 21 | add {_zstep} to {_zLoc1} 22 | set {BR.flag.borderCenter.x} to {_xLoc2} 23 | set {BR.flag.borderCenter.z} to {_zLoc2} 24 | execute console command "/worldborder center %{_xLoc1}% %{_zLoc1}%" 25 | wait 1 tick 26 | execute console command "/worldborder center %{_xLoc2}% %{_zLoc2}%" 27 | set {_nextsize} to {BR.data.borderSize::%({BR.flag.phase} + 1)%} 28 | set {_coords::*} to makeRandomcenter({BR.flag.size},{_nextsize},{BR.flag.borderCenter.x},{BR.flag.borderCenter.z}) 29 | set {BR.flag.nextborderCenter.x} to {_coords::1} 30 | set {BR.flag.nextborderCenter.z} to {_coords::2} 31 | set {BR.flag.isshrinking} to false 32 | function setBorder(size: number,time: number): 33 | set {_time} to round({_time}) 34 | execute console command "/worldborder set %{_size}% %{_time}%" 35 | 36 | function makeRandomcenter(prevSize: number,newSize: number,prevCenterx:number,prevCenterz:number) :: numbers: 37 | set {_x1} to {_prevCenterx} + ({_prevSize} / 2) 38 | set {_x2} to {_prevCenterx} - ({_prevSize} / 2) 39 | set {_z1} to {_prevCenterz} + ({_prevSize} / 2) 40 | set {_z2} to {_prevCenterz} - ({_prevSize} / 2) 41 | 42 | add {_newSize} / 2 to {x1} 43 | subtract {_newSize} / 2 from {x2} 44 | 45 | add {_newSize} / 2 to {z1} 46 | subtract {_newSize} / 2 from {z2} 47 | 48 | set {_rx} to random integer between {_x1} and {_x2} 49 | set {_rz} to random integer between {_z1} and {_z2} 50 | 51 | add {_rx} to {_ret::*} 52 | add {_rz} to {_ret::*} 53 | 54 | return {_ret::*} 55 | 56 | function makeIngameborder(phase: number,size: number,prevsize: number,centerx: number,centerz: number): 57 | set {BR.flag.phase} to {_phase} 58 | set {BR.flag.size} to {_size} 59 | broadcast "{@p} 자기장이 줄어듭니다!" 60 | set {_speed} to round(({_prevsize} - {_size})/{BR.flag.borderSpeed}*20) 61 | setBordercenter({_prevsize}, {BR.flag.borderCenter.x},{BR.flag.borderCenter.z},{_centerx},{_centerz},{_speed}) 62 | setBorder({_size},({_prevsize} - {_size})/{BR.flag.borderSpeed}) 63 | updateCompass() 64 | 65 | function brShrinkborder(): 66 | set {_prevsize} to {BR.flag.size} 67 | set {BR.flag.phase} to {BR.flag.phase} + 1 68 | set {_newsize} to {BR.data.borderSize::%{BR.flag.phase}%} 69 | set {BR.flag.borderSpeed} to 3.5 70 | set {BR.flag.size} to {_newsize} 71 | makeIngameborder({BR.flag.phase},{_newsize},{_prevsize},{BR.flag.nextborderCenter.x},{BR.flag.nextborderCenter.z}) 72 | 73 | function brBorderinit(): 74 | set {BR.flag.phase} to 1 75 | set {BR.flag.borderSize} to {BR.data.borderSize::%{BR.flag.phase}%} 76 | set {BR.flag.borderCenter.x} to random integer between -1000 and 1000 77 | set {BR.flag.borderCenter.z} to random integer between -1000 and 1000 78 | set {BR.flag.borderSpeed} to 1000 79 | makeIngameborder(1,{BR.flag.borderSize},{BR.flag.borderSize},{BR.flag.borderCenter.x},{BR.flag.borderCenter.z}) 80 | 81 | #teamInit(2) 82 | 83 | function brGetspawnloc(type: text) :: location: 84 | set {_space} to 500 #끝점에서 얼마나 여유를 두고 스폰시킬건지 85 | 86 | if {_type} is "++": 87 | set {_x} to {BR.flag.borderCenter.x} + ({BR.flag.borderSize} / 2) - {_space} 88 | set {_z} to {BR.flag.borderCenter.z} + ({BR.flag.borderSize} / 2) - {_space} 89 | if {_type} is "--": 90 | set {_x} to {BR.flag.borderCenter.x} - ({BR.flag.borderSize} / 2) + {_space} 91 | set {_z} to {BR.flag.borderCenter.z} - ({BR.flag.borderSize} / 2) + {_space} 92 | if {_type} is "+-": 93 | set {_x} to {BR.flag.borderCenter.x} + ({BR.flag.borderSize} / 2) - {_space} 94 | set {_z} to {BR.flag.borderCenter.z} - ({BR.flag.borderSize} / 2) + {_space} 95 | if {_type} is "-+": 96 | set {_x} to {BR.flag.borderCenter.x} - ({BR.flag.borderSize} / 2) + {_space} 97 | set {_z} to {BR.flag.borderCenter.z} + ({BR.flag.borderSize} / 2) - {_space} 98 | 99 | set {_tmploc} to location at {_x}, 256, {_z} of the world "world" 100 | while block at {_tmploc} is air: 101 | set {_y} to y-coordinate of {_tmploc} 102 | set y-coordinate of {_tmploc} to {_y} - 1 103 | set y-coordinate of {_tmploc} to {_y} + 1 104 | return {_tmploc} 105 | 106 | function brIsinnextborder(x: number,z: number,phase: number) :: boolean: 107 | set {_newsize} to {BR.data.borderSize::%{_phase}%} 108 | set {_centerx} to {BR.flag.nextborderCenter.x} 109 | set {_centerz} to {BR.flag.nextborderCenter.z} 110 | if {_x} is between ({_centerx} - {_newsize}/2) and ({_centerx} + {_newsize}/2): 111 | if {_z} is between ({_centerz} - {_newsize}/2) and ({_centerz} + {_newsize}/2): 112 | return true 113 | return false 114 | 115 | command /testborder: 116 | trigger: 117 | brBorderinit() 118 | command /testborder2: 119 | trigger: 120 | brShrinkborder() 121 | 122 | command /brdebug: 123 | trigger: 124 | set {BR.debug} to true 125 | wait 1 second 126 | set {BR.debug} to false 127 | set {BR.flag.isshrinking} to false 128 | 129 | command /brdebug2: 130 | trigger: 131 | set {BR.flag.gametime} to {BR.delay} - 5 --------------------------------------------------------------------------------