Advertisement
fleft17

Untitled

Jul 26th, 2014
261
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.27 KB | None | 0 0
  1. options:
  2. Prefix: &8[&bFavonius&8]&r
  3. MaxTries: 1001
  4. ChunkWaitTicks: 10
  5. ScatterWaitTicks: 1
  6.  
  7. # variables
  8. # {Teams::*} - list of integer - all team numbers currently active
  9. # {Team.%integer%.Set} - true/null - Team created?
  10. # {Team.%integer%::*} - list of "text" - player names in that team (TEXT!)
  11. # {Teams.InTeam::%player%} - integer/null - what team is player in?
  12.  
  13.  
  14. command /scatterteams <world> <integer> <integer>:
  15. usage: /scatterteams <world> <radius> <mindist>
  16. permission: skript.teams
  17. trigger:
  18. set {_Count} to 0
  19. loop {Teams::*}:
  20. {Team.%loop-value%::*} is set
  21. increase {_Count} by 1
  22. add {_Count} to {_Scatter.Teams::*}
  23. set {_Scatter.Team.%{_Count}%::*} to {Team.%loop-value%::*}
  24.  
  25. loop all players:
  26. {Teams.InTeam::%loop-player%} is not set
  27. add (name of loop-player) to {_Solos::*}
  28.  
  29.  
  30. broadcast "&7-----------------------------------"
  31. broadcast "{@Prefix} Teams are being scattered!"
  32. set {_Size} to ((size of {_Scatter.Teams::*})+(size of {_Solos::*}))
  33.  
  34. # this is copied from the above scatter
  35. loop {_Size} times:
  36. loop {@MaxTries} times:
  37. if loop-number-2 is equal to {@MaxTries}:
  38. message "{@Prefix} Could not get position &7[&f%loop-number-1%&9/&f%{_Size}%&7]"
  39. command "/scatter-playsound random.break"
  40. stop trigger
  41. set {_ThisLocation.Okay} to true
  42. set {_ThisLocation.Sky} to (the location at ((random integer between (0-(arg 2)) and ((arg 2)-1))+0.5), 255, ((random integer between (0-(arg 2)) and ((arg 2)-1))+0.5) of the world (arg 1))
  43. loop ((loop-number-1)-1) times:
  44. {_ThisLocation.Okay} is true
  45. distance between {_ThisLocation.Sky} and {_FinalLocation.Sky::%loop-number-3%} is less than (arg 3)
  46. delete {_ThisLocation.Okay}
  47. if {_ThisLocation.Okay} is true:
  48. set {_ThisLocation.Ground} to {_ThisLocation.Sky}
  49. while (block at {_ThisLocation.Ground}) is air:
  50. if y-coordinate of {_ThisLocation.Ground} is less than 4:
  51. delete {_ThisLocation.Okay}
  52. stop loop
  53. set {_ThisLocation.Ground} to location 1 below {_ThisLocation.Ground}
  54. if {_ThisLocation.Okay} is true:
  55. if (block at {_ThisLocation.Ground}) is lava, water or cactus:
  56. delete {_ThisLocation.Okay}
  57. if {_ThisLocation.Okay} is true:
  58. set {_FinalLocation.Sky::%loop-number-1%} to {_ThisLocation.Sky}
  59. set {_FinalLocation.Ground::%loop-number-1%} to (location 1 above {_ThisLocation.Ground})
  60. stop loop
  61. set {Scatter.DisableChunkUnloading} to true
  62. set {_ApproxTime} to {_Size}*{@ChunkWaitTicks}/20
  63. broadcast "{@Prefix} Scatter will take &a%{_ApproxTime}%&r seconds!"
  64. loop {_Size} times:
  65. if command sender is not online:
  66. broadcast "{@Prefix} Operation failed, chunkloading player logged out."
  67. command "/scatter-playsound random.break"
  68. stop trigger
  69. teleport (command sender) to {_FinalLocation.Ground::%loop-number%}
  70. message "{@Prefix} &aLoading: &7[&a%loop-number%&7/&b%{_Size}%&7]" to command sender
  71. wait {@ChunkWaitTicks} ticks
  72. broadcast "&7-----------------------------------"
  73. wait 40 ticks
  74. set {_TeamSize} to (size of {_Scatter.Teams::*})
  75. set {_SoloSize} to (size of {_Solos::*})
  76. set {_PositionCount} to 0
  77. set {_TeamCount} to 0
  78. set {_SoloCount} to 0
  79. loop {_Scatter.Teams::*}:
  80. increase {_PositionCount} by 1
  81. increase {_TeamCount} by 1
  82. loop {_Scatter.Team.%loop-value%::*}:
  83. set {_Player} to ("%loop-value-2%" parsed as offlineplayer)
  84. if {_Player} is not online:
  85. broadcast "{@Prefix} Scheduled late scatter of &a%{_Player}%."
  86. set {ScatterScheduler::%{_Player}%} to {_FinalLocation.Ground::%{_PositionCount}%}
  87. else:
  88. teleport {_Player} to {_FinalLocation.Ground::%{_PositionCount}%}
  89. execute console command "/sall note.bass 1"
  90. wait {@ScatterWaitTicks} ticks
  91. loop {_Solos::*}:
  92. increase {_PositionCount} by 1
  93. increase {_SoloCount} by 1
  94. set {_Player} to ("%loop-value%" parsed as offlineplayer)
  95. if {_Player} is not online:
  96. broadcast "{@Prefix} Scheduled late scatter of &a%{_Player}%!"
  97. set {ScatterScheduler::%{_Player}%} to {_FinalLocation.Ground::%{_PositionCount}%}
  98. else:
  99. teleport {_Player} to {_FinalLocation.Ground::%{_PositionCount}%}
  100. wait {@ScatterWaitTicks} ticks
  101.  
  102. broadcast "{@Prefix} All teams scattered!"
  103. broadcast "&7-----------------------------------"
  104. execute console command "/sall random.successful_hit 0.5"
  105. delete {Scatter.DisableChunkUnloading}
  106.  
  107.  
  108. on chunk unload:
  109. {Scatter.DisableChunkUnloading} is true
  110. cancel the event
  111.  
  112. on skript start:
  113. delete {Scatter.DisableChunkUnloading}
  114.  
  115. on join:
  116. {ScatterScheduler::%player%} is set
  117. teleport player to {ScatterScheduler::%player%}
  118. delete {ScatterScheduler::%player%}
  119. broadcast "{@Prefix}&r Scheduled late-scatter of &a%player%!"
  120.  
  121.  
  122.  
  123.  
  124.  
  125. options:
  126. Prefix: &8[&bFavonius&8]&r
  127. MaxTries: 1001
  128. ChunkWaitTicks: 10
  129. ScatterWaitTicks: 1
  130.  
  131. command /scatterffa <world> <integer> <integer>:
  132. description: Scatter command
  133. usage: /scatterffa <world> <radius> <mindist>
  134. permission: skript.scatter
  135. trigger:
  136. set {scattering} to true
  137. if (size of (all players)) is equal to 0:
  138. message "{@Prefix} Nobody online. Insert Sadface!"
  139. stop
  140. broadcast "&7-----------------------------------------------------"
  141. broadcast "{@Prefix} All players being scattered!"
  142. set {_Players::*} to all players
  143. set {_Size} to (size of {_Players::*})
  144. loop {_Size} times:
  145. loop {@MaxTries} times:
  146. if loop-number-2 is equal to {@MaxTries}:
  147. message "{@Prefix} Could not scatter &7[&f%loop-number-1%&7/&b%{_Size}%&7]"
  148. command "/scatter-playsound random.break"
  149. stop trigger
  150. set {_ThisLocation.Okay} to true
  151. set {_ThisLocation.Sky} to (the location at ((random integer between (0-(arg 2)) and ((arg 2)-1))+0.5), 255, ((random integer between (0-(arg 2)) and ((arg 2)-1))+0.5) of the world (arg 1))
  152. loop ((loop-number-1)-1) times:
  153. {_ThisLocation.Okay} is true
  154. distance between {_ThisLocation.Sky} and {_FinalLocation.Sky::%loop-number-3%} is less than (arg 3)
  155. delete {_ThisLocation.Okay}
  156. if {_ThisLocation.Okay} is true:
  157. set {_ThisLocation.Ground} to {_ThisLocation.Sky}
  158. while (block at {_ThisLocation.Ground}) is air:
  159. if y-coordinate of {_ThisLocation.Ground} is less than 4:
  160. delete {_ThisLocation.Okay}
  161. stop loop
  162. set {_ThisLocation.Ground} to location 1 below {_ThisLocation.Ground}
  163. if {_ThisLocation.Okay} is true:
  164. if (block at {_ThisLocation.Ground}) is lava, water or cactus:
  165. delete {_ThisLocation.Okay}
  166. if {_ThisLocation.Okay} is true:
  167. set {_FinalLocation.Sky::%loop-number-1%} to {_ThisLocation.Sky}
  168. set {_FinalLocation.Ground::%loop-number-1%} to (location 1 above {_ThisLocation.Ground})
  169. stop loop
  170. set {Scatter.DisableChunkUnloading} to true
  171. set {_ApproxTime} to {_Size}*{@ChunkWaitTicks}/20
  172. broadcast "{@Prefix} Scatter will take &a%{_ApproxTime}%&r seconds!"
  173. broadcast "&7-----------------------------------------------------"
  174. loop {_Size} times:
  175. if command sender is not online:
  176. broadcast "{@Prefix} Failed scatter! &a%command sender%&r logged out!"
  177. command "/scatter-playsound random.break"
  178. stop trigger
  179. teleport (command sender) to {_FinalLocation.Ground::%loop-number%}
  180. message "{@Prefix} Loading &7[&f%loop-number%&7/&a%{_Size}%&7]" to command sender
  181. wait {@ChunkWaitTicks} ticks
  182. broadcast "%{Fprefix}% 3…"
  183. make player execute command "/sall note.pling 0.5"
  184. wait 1 second
  185. broadcast "%{Fprefix}% 2…"
  186. make player execute command "/sall note.pling 1.0"
  187. wait 1 second
  188. broadcast "%{Fprefix}% 1…"
  189. make player execute command "/sall note.pling 1.5"
  190. wait 0.5 second
  191. broadcast "&7-----------------------------------------------------"
  192. set {_Count} to 0
  193. loop {_Players::*}:
  194. increase {_Count} by 1
  195. execute console command "/sall note.bass 1"
  196. if (loop-value) is not online:
  197. broadcast "{@Prefix} Not online: &7[&f%{_Count}%&9/&f%{_Size}%&7]&4 : &6%loop-value% &r- scheduling."
  198. set {ScatterScheduler::%loop-value%} to {_FinalLocation.Ground::%{_Count}%}
  199. else:
  200. teleport (loop-value) to {_FinalLocation.Ground::%{_Count}%}
  201. {_Count} is 1 or 5 or 10 or 15 or 20 or 25 or 30 or 35 or 40 or 45 or 50 or 55 or 60 or 65 or 70 or {_Size}:
  202. broadcast "{@Prefix} &7[&f%{_Count}%&7/&a%{_Size}%&7]&r Scattered!"
  203.  
  204. wait {@ScatterWaitTicks} tick
  205. broadcast "{@Prefix} All players scattered!"
  206. broadcast "&7-----------------------------------------------------"
  207. make player execute command "/sall fireworks.launch 1"
  208. wait 15 ticks
  209. delete {Scatter.DisableChunkUnloading}
  210. set {scattering} to false
  211. wait 1 second
  212. make player execute command "/sall fireworks.largeBlast 1"
  213.  
  214. command /scatter-playsound <text>:
  215. permission: skript.scatter.playsound
  216. trigger:
  217. loop all players:
  218. command "/playsound %arg 1% %loop-player%"
  219.  
  220. on chunk unload:
  221. {Scatter.DisableChunkUnloading} is true
  222. cancel the event
  223.  
  224. on join:
  225. {ScatterScheduler::%player%} is set
  226. teleport player to {ScatterScheduler::%player%}
  227. delete {ScatterScheduler::%player%}
  228. broadcast "{@Prefix} &aScheduled late-scatter of %player%."
  229.  
  230. on chat:
  231. {scattering} is true:
  232. player is not op:
  233. cancel the event
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement