Advertisement
Guest User

Untitled

a guest
Jul 21st, 2019
228
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.88 KB | None | 0 0
  1. function gwManifest():
  2. set {games::repo::glasswars::corner1} to location(4964, 0, 4964, {world})
  3. set {games::repo::glasswars::corner2} to location(5044, 3, 5044, {world})
  4. set {games::repo::glasswars::waitarea} to location(5000, 211.5, 5000, {world})
  5. set {games::repo::glasswars::mid} to location(5001, 4, 5001, {world})
  6. set {games::repo::glasswars::teams} to true
  7. set {games::repo::glasswars::teams::red} to true
  8. set {games::repo::glasswars::teams::red::mapres} to location(5000, 4, 4973, {world})
  9. set {games::repo::glasswars::teams::red::col} to "&c"
  10. set {games::repo::glasswars::teams::red::block} to red stained glass
  11. set {games::repo::glasswars::teams::blue} to true
  12. set {games::repo::glasswars::teams::blue::mapres} to location(5019, 4, 4981, {world})
  13. set {games::repo::glasswars::teams::blue::col} to "&9"
  14. set {games::repo::glasswars::teams::blue::block} to blue stained glass
  15. set {games::repo::glasswars::teams::yellow} to true
  16. set {games::repo::glasswars::teams::yellow::mapres} to location(5027, 4, 5000, {world})
  17. set {games::repo::glasswars::teams::yellow::col} to "&e"
  18. set {games::repo::glasswars::teams::yellow::block} to yellow stained glass
  19. set {games::repo::glasswars::teams::green} to true
  20. set {games::repo::glasswars::teams::green::mapres} to location(5019, 4, 5019, {world})
  21. set {games::repo::glasswars::teams::green::col} to "&a"
  22. set {games::repo::glasswars::teams::green::block} to green stained glass
  23. set {games::repo::glasswars::teams::purple} to true
  24. set {games::repo::glasswars::teams::purple::mapres} to location(5000, 4, 5027, {world})
  25. set {games::repo::glasswars::teams::purple::col} to "&5"
  26. set {games::repo::glasswars::teams::purple::block} to purple stained glass
  27. set {games::repo::glasswars::teams::pink} to true
  28. set {games::repo::glasswars::teams::pink::mapres} to location(4981, 4, 5019, {world})
  29. set {games::repo::glasswars::teams::pink::col} to "&d"
  30. set {games::repo::glasswars::teams::pink::block} to pink stained glass
  31. set {games::repo::glasswars::teams::orange} to true
  32. set {games::repo::glasswars::teams::orange::mapres} to location(4973, 4, 5000, {world})
  33. set {games::repo::glasswars::teams::orange::col} to "&6"
  34. set {games::repo::glasswars::teams::orange::block} to orange stained glass
  35. set {games::repo::glasswars::teams::black} to true
  36. set {games::repo::glasswars::teams::black::mapres} to location(4981, 4, 4981, {world})
  37. set {games::repo::glasswars::teams::black::col} to "&0"
  38. set {games::repo::glasswars::teams::black::block} to black stained glass
  39. set {games::repo::glasswars::items} to true
  40. add 6 sandstone to {games::repo::glasswars::items::*}
  41. add 4 oak planks to {games::repo::glasswars::items::*}
  42. add 1 leather chestplate to {games::repo::glasswars::items::*}
  43. add 1 leather leggings to {games::repo::glasswars::items::*}
  44. add 1 carrot on a stick named "&aLevitation Stick" to {games::repo::glasswars::items::*}
  45. add 1 diamond to {games::repo::glasswars::items::*}
  46. add 1 water bucket to {games::repo::glasswars::items::*}
  47. add 1 bow to {games::repo::glasswars::items::*}
  48. add 4 arrows to {games::repo::glasswars::items::*}
  49. set {_slappy} to 1 fish
  50. enchant {_slappy} with knockback 2
  51. add {_slappy} to {games::repo::glasswars::items::*}
  52. add 1 stone sword to {games::repo::glasswars::items::*}
  53. add 1 iron sword to {games::repo::glasswars::items::*}
  54. add 1 diamond pickaxe to {games::repo::glasswars::items::*}
  55. add 1 speed potion to {games::repo::glasswars::items::*}
  56. add 1 iron axe to {games::repo::glasswars::items::*}
  57. add 1 chainmail boots to {games::repo::glasswars::items::*}
  58.  
  59. function gwRun(matchnum: number):
  60. set {games::matches::match%{_matchnum}%::state} to 3
  61. set {games::matches::match%{_matchnum}%::itemtimer} to 7
  62. set {games::matches::match%{_matchnum}%::gwteam} to true
  63. set {_wa} to {games::repo::glasswars::waitarea}
  64. set {_adder} to (({games::matches::match%{_matchnum}%::gamelabel} - 1) * 250)
  65. add {_adder} to {_wa}'s x-coordinate
  66. add "red" to {_teams::*}
  67. add "blue" to {_teams::*}
  68. add "yellow" to {_teams::*}
  69. add "green" to {_teams::*}
  70. add "purple" to {_teams::*}
  71. add "pink" to {_teams::*}
  72. add "orange" to {_teams::*}
  73. add "black" to {_teams::*}
  74. loop {games::repo::glasswars::teams::*}:
  75. set {games::matches::match%{_matchnum}%::gwteam::%loop-index%} to true
  76. set {_start} to 1
  77. set {_theend} to size of {_teams::*}
  78. loop {games::matches::match%{_matchnum}%::queued::*}:
  79. teleport loop-value to {_wa}
  80. generalReadyPlayer(loop-value, "adventure")
  81. set {player::%{_p}%::meta::glasswars} to true
  82. gwJoinTeam(loop-value, {_teams::%{_start}%})
  83. add 1 to {_start}
  84. if {_start} > {_theend}:
  85. set {_start} to 1
  86. wait 3 seconds
  87. set {_step} to 4
  88. set {_term} to 28
  89. set {_maxattempts} to 10
  90. set {_start} to 1
  91. set {_lc1} to {games::repo::glasswars::corner1}
  92. set {_mx1} to x-coordinate of {_lc1}
  93. set {_my1} to y-coordinate of {_lc1}
  94. set {_mz1} to z-coordinate of {_lc1}
  95. set {_lc2} to {games::repo::glasswars::corner2}
  96. set {_mx2} to x-coordinate of {_lc2}
  97. set {_my2} to y-coordinate of {_lc2}
  98. set {_mz2} to z-coordinate of {_lc2}
  99. add {_adder} to {_mx1}
  100. add {_adder} to {_mx2}
  101. while {_start} < {_maxattempts}:
  102. console command "/fill %{_mx1}% %{_my1}% %{_mz1}% %{_mx2}% %{_my2}% %{_mz2}% air"
  103. add {_step} to {_my1}
  104. add {_step} to {_my2}
  105. if {_my2} > {_term}:
  106. exit loop
  107. add 1 to {_start}
  108. loop {games::repo::glasswars::teams::*}:
  109. set {_loc} to {games::repo::glasswars::teams::%loop-index%::mapres}
  110. set {_lex} to {_loc}'s x-coordinate
  111. set {_ley} to {_loc}'s y-coordinate
  112. set {_lez} to {_loc}'s z-coordinate
  113. add {_adder} to {_lex}
  114. console command "/execute as @e[tag=anchor,type=minecraft:armor_stand,limit=1] run setblock %{_lex}% %{_ley}% %{_lez}% structure_block{metadata:"""",mirror:""NONE"",ignoreEntities:1b,powered:0b,seed:0L,author:""ThatOneTqnk"",rotation:""NONE"",posX:0,mode:""LOAD"",posY:1,sizeX:9,posZ:0,integrity:1.0f,showair:0b,x:-117,name:""minecraft:gw%loop-index%"",y:4,z:-70,id:""minecraft:structure_block"",sizeY:10,sizeZ:9,showboundingbox:1b}"
  115. console command "/execute as @e[tag=anchor,type=minecraft:armor_stand,limit=1] run setblock %{_lex}% %({_ley} - 1)% %{_lez}% redstone_block"
  116. console command "/execute as @e[tag=anchor,type=minecraft:armor_stand,limit=1] run fill %{_lex}% %{_ley}% %{_lez}% %{_lex}% %({_ley} - 1)% %{_lez}% air"
  117. set {_mloc} to {games::repo::glasswars::mid}
  118. set {_mlex} to {_mloc}'s x-coordinate
  119. set {_mley} to {_mloc}'s y-coordinate
  120. set {_mlez} to {_mloc}'s z-coordinate
  121. add {_adder} to {_mlex}
  122. console command "/execute as @e[tag=anchor,type=minecraft:armor_stand,limit=1] run setblock %{_mlex}% %{_mley}% %{_mlez}% structure_block{metadata:"""",mirror:""NONE"",ignoreEntities:1b,powered:0b,seed:0L,author:""ThatOneTqnk"",rotation:""NONE"",posX:0,mode:""LOAD"",posY:1,sizeX:9,posZ:0,integrity:1.0f,showair:0b,x:-117,name:""minecraft:gwmid"",y:4,z:-70,id:""minecraft:structure_block"",sizeY:10,sizeZ:9,showboundingbox:1b}"
  123. console command "/execute as @e[tag=anchor,type=minecraft:armor_stand,limit=1] run setblock %{_mlex}% %({_mley} - 1)% %{_mlez}% redstone_block"
  124. console command "/execute as @e[tag=anchor,type=minecraft:armor_stand,limit=1] run fill %{_mlex}% %{_mley}% %{_mlez}% %{_mlex}% %({_mley} - 1)% %{_mlez}% air"
  125. wait 1 second
  126. loop {games::matches::match%{_matchnum}%::queued::*}:
  127. gwRespawnMe({_matchnum}, loop-value)
  128. set {games::matches::match%{_matchnum}%::state} to 4
  129.  
  130. function gwRespawnMe(matchnum: number, p: player):
  131. set {_team} to {player::%{_p}%::meta::glasswars::team}
  132. generalReadyPlayer({_p}, "survival")
  133. set {_loc} to {games::repo::glasswars::teams::%{_team}%::mapres}
  134. add 4 to {_loc}'s x-coordinate
  135. add 12 to {_loc}'s y-coordinate
  136. add 4 to {_loc}'s z-coordinate
  137. set {_adder} to (({games::matches::match%{_matchnum}%::gamelabel} - 1) * 250)
  138. add {_adder} to {_loc}'s x-coordinate
  139. teleport {_p} to {_loc}
  140. give {_p} 6 sandstone
  141.  
  142.  
  143. function gwPeriodical(matchnum: number):
  144. if {games::matches::match%{_matchnum}%::state} = 4:
  145. gwCheckGlasses({_matchnum})
  146. remove 1 from {games::matches::match%{_matchnum}%::itemtimer}
  147. if {games::matches::match%{_matchnum}%::itemtimer} <= 0:
  148. set {games::matches::match%{_matchnum}%::itemtimer} to 7
  149. gwItem({_matchnum})
  150.  
  151. function gwCheckGlasses(matchnum: number):
  152. set {_adder} to (({games::matches::match%{_matchnum}%::gamelabel} - 1) * 250)
  153. loop {games::repo::glasswars::teams::*}:
  154. if {games::matches::match%{_matchnum}%::gwteam::%loop-index%} is true:
  155. set {_leloc} to {games::repo::glasswars::teams::%loop-index%::mapres}
  156. add {_adder} to {_leloc}'s x-coordinate
  157. add 4 to {_leloc}'s x-coordinate
  158. add 10 to {_leloc}'s y-coordinate
  159. add 4 to {_leloc}'s z-coordinate
  160. set {_gamer} to true if block at {_leloc} is {games::repo::glasswars::teams::%loop-index%::block} else false
  161. if {_gamer} is false:
  162. set {games::matches::match%{_matchnum}%::gwteam::%loop-index%} to false
  163.  
  164. function gwItem(matchnum: number):
  165. loop {games::matches::match%{_matchnum}%::queued::*}:
  166. if loop-value is alive:
  167. set {_lei} to a random element out of {games::repo::glasswars::items::*}
  168. give {_lei} to loop-value's inventory
  169. # might as well test endgame
  170. gwCheckEndGame({_matchnum})
  171.  
  172.  
  173. function gwJoinTeam(p: player, teamname: text):
  174. set {_c} to {games::repo::glasswars::teams::%{_teamname}%::col}
  175. set {_p} tab name to "%{_c}%%{_p}%"
  176. set {player::%{_p}%::meta::glasswars::team} to {_teamname}
  177.  
  178.  
  179. on break:
  180. if {player::%player%::gametype} is "glasswars":
  181. if event-block is iron block:
  182. cancel event
  183. stop
  184. set {_found} to false
  185. set {_targetteam} to ""
  186. loop {games::repo::glasswars::teams::*}:
  187. if event-block is {games::repo::glasswars::teams::%loop-index%::block}:
  188. set {_targetteam} to loop-index
  189. set {_found} to true
  190. if {_found} is true:
  191. set {_matchnum} to {player::%player%::ingame}
  192. set {_team} to {player::%player%::meta::glasswars::team}
  193. set {_theblocc} to {games::repo::glasswars::teams::%{_team}%::block}
  194. if event-block is {_theblocc}:
  195. cancel event
  196. stop
  197. set {_c} to {games::repo::glasswars::teams::%{_team}%::col}
  198. set {_cc} to {games::repo::glasswars::teams::%{_targetteam}%::col}
  199. set {_upper} to the first character of {_targetteam}
  200. set {_upper} to "%{_upper}%" in upper case
  201. set {_rest} to subtext of {_targetteam} from characters 2 to (the length of {_targetteam})
  202. sendToQueued("", {_matchnum})
  203. sendToQueued("%{_c}%%player% &7destroyed %{_cc}%%{_upper}%%{_rest}%'s glass!", {_matchnum})
  204. sendToQueued("", {_matchnum})
  205. playToQueued("entity.ender_dragon.growl", {_matchnum}, 1, 10)
  206. set {_tspan} to 2 seconds
  207. loop {games::matches::match%{_matchnum}%::queued::*}:
  208. if {player::%loop-value%::meta::glasswars::team} is {_targetteam}:
  209. sendTitleWithSubtitle(loop-value, "&cGLASS DESTROYED!", "You will no longer respawn!", {_tspan})
  210. wait 2 ticks
  211. gwCheckGlasses({_matchnum})
  212.  
  213.  
  214. on death:
  215. if {player::%victim%::gametype} is "glasswars":
  216. set {_matchnum} to {player::%victim%::ingame}
  217. if {games::matches::match%{_matchnum}%::state} >= 3:
  218. set {_vt} to {player::%victim%::meta::glasswars::team}
  219. set {_vcc} to {games::repo::glasswars::teams::%{_vt}%::col}
  220. set {_dmsg} to ""
  221. if attacker is set:
  222. set {_at} to {player::%attacker%::meta::glasswars::team}
  223. set {_acc} to {games::repo::glasswars::teams::%{_at}%::col}
  224. set {_dpart} to deathGrabRandHomicide()
  225. set {_dmsg} to "%{_vcc}%%victim% %{_dpart}% %{_acc}%%attacker%"
  226. else:
  227. set {_dpart} to deathGrabRandSolo()
  228. set {_dmsg} to "%{_vcc}%%victim% %{_dpart}%"
  229. sendToQueued({_dmsg}, {_matchnum})
  230. gwShouldRespawn(victim, {_matchnum})
  231.  
  232. function gwShouldRespawn(p: player, matchnum: number):
  233. set {_team} to {player::%{_p}%::meta::glasswars::team}
  234. if {games::matches::match%{_matchnum}%::gwteam::%{_team}%} is true:
  235. set {player::%{_p}%::meta::glasswars::resp} to true
  236. else:
  237. set {player::%{_p}%::meta::glasswars::resp} to false
  238. wait 2 ticks
  239. softReset({_p})
  240. gwCheckEndGame({_matchnum})
  241.  
  242. function gwCheckEndGame(matchnum: number):
  243. loop {games::matches::match%{_matchnum}%::queued::*}:
  244. set {_team} to {player::%loop-value%::meta::glasswars::team}
  245. if {_tlist::%{_team}%} is not set:
  246. set {_tlist::%{_team}%} to true
  247. if size of {_tlist::*} <= 1:
  248. gwEndGame({_matchnum}, {_team})
  249.  
  250. function gwQuit(matchnum: number, p: player):
  251. remove {_p} from {games::matches::match%{_matchnum}%::queued::*}
  252. gwCheckEndGame({_matchnum})
  253.  
  254. function gwEndGame(matchnum: number, winner: text):
  255. set {games::matches::match%{_matchnum}%::state} to -1
  256. set {_col} to "&7"
  257. set {_gm} to {games::matches::match%{_matchnum}%::gamelabel}
  258. loop {games::matches::match%{_matchnum}%::queued::*}:
  259. softReset(loop-value)
  260. if {_winner} is set:
  261. set {_col} to {games::repo::glasswars::teams::%{_winner}%::col}
  262. set {_upper} to the first character of {_winner}
  263. set {_upper} to "%{_upper}%" in upper case
  264. set {_rest} to subtext of {_winner} from characters 2 to (the length of {_winner})
  265. sendToLobby("%{_col}%%{_upper}%%{_rest}% &7won &6Glass&eWars! &7(Match &e%{_gm}%&7)")
  266. playToLobby("entity.player.levelup", 1.6, 10)
  267. clear {games::matches::match%{_matchnum}%::queued::*}
  268. set {games::matches::match%{_matchnum}%::state} to 0
  269.  
  270.  
  271. on respawn:
  272. if {player::%player%::gametype} is "glasswars":
  273. if {player::%player%::meta::glasswars::resp} is true:
  274. wait 2 ticks
  275. gwRespawnMe({player::%player%::ingame}, player)
  276.  
  277. on right click:
  278. if {player::%player%::gametype} is "glasswars":
  279. if event-item is carrot on a stick:
  280. if name of item is "&aLevitation Stick":
  281. remove 1 carrot on a stick from player's inventory
  282. apply potion of levitation of tier 2 without particles to player for 7 seconds
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement