szumielxd

Diglet

Dec 19th, 2018
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.81 KB | None | 0 0
  1. options:
  2. block_in: location(7008, 100, 7015, world "katedra")
  3. block_out: location(6966, 100, 7014, world "katedra")
  4. tp_start: location(7010, 99, 7001, world "katedra", 90, 0)
  5. srodek: location(6987, 100, 7001, world "katedra")
  6.  
  7.  
  8. on load:
  9. set block at {@block_in} to air
  10. set block at {@block_out} to air
  11. delete {diglet.hp}
  12.  
  13.  
  14. command /odlicz <integer>:
  15. trigger:
  16. odliczanie(player, arg)
  17.  
  18.  
  19. command /adddiglet:
  20. permission: wlasciciel
  21. trigger:
  22. set {_b} to block at player
  23. if "%{diglet.spawny::*}%" do not contain "%location at {_b}%":
  24. add {_b}'s location to {diglet.spawny::*}
  25. send "&2Pomyslnie dodano lokalizacje &7%{_b}'s location% &2jako spawn digleta"
  26. else:
  27. send "&cJuz istnieje taka lokalizacja w liscie"
  28.  
  29.  
  30.  
  31. function odliczanie(p: player, i: integer):
  32. if metadata value "odliczanie.czas" of {_p} is true:
  33. stop
  34. if metadata value "odliczanie.czas" of {_p} is false:
  35. set metadata value "odliczanie.czas" of {_p} to true
  36. stop
  37. else:
  38. set metadata value "odliczanie.czas" of {_p} to false
  39. loop {_i} times:
  40. if "%region at {_p}%" do not contain "diglet":
  41. stop
  42. set {_s} to mod({_i} - loop-number, 60)
  43. set {_m} to floor(({_i} - loop-number)/60)
  44. if {_m} < 10:
  45. set {_m} to "0%{_m}%"
  46. if {_s} < 10:
  47. set {_s} to "0%{_s}%"
  48. if {diglet.hp} <= 0:
  49. play 100 smoke particle at {_p}
  50. wait 3 tick
  51. play 500 smoke particle at {_p}
  52. wait 3 tick
  53. play 1000 smoke particle at {_p}
  54. wait 3 tick
  55. play 2000 smoke particle at {_p}
  56. wait 3 tick
  57. play 5000 smoke particle at {_p}
  58. wait 3 tick
  59. play 5000 smoke particle at {_p}
  60. wait 5 ticks
  61. end({_p})
  62. apply blindness to {_p} for 5 seconds
  63. play 5000 smoke particle at {_p}
  64. wait 5 ticks
  65. play 5000 smoke particle at {_p}
  66. wait 5 ticks
  67. play 5000 smoke particle at {_p}
  68. clear metadata value "odliczanie.czas" of {_p}
  69. send actionbar "" to {_p}
  70. stop
  71. send actionbar "&4%{_m}%:%{_s}%:&kaa&r &e&lWytrzymalosc sali: &f&l%{diglet.hp}%" to {_p}
  72. if metadata value "odliczanie.czas" of {_p} is true:
  73. clear metadata value "odliczanie.czas" of {_p}
  74. send actionbar "" to {_p}
  75. stop
  76. wait 1 second
  77. send actionbar "" to {_p}
  78. clear metadata value "odliczanie.czas" of {_p}
  79.  
  80.  
  81.  
  82. #on xp spawn:
  83. # event-location is in region "diglet":
  84. # broadcast "xp"
  85. # cancel event
  86.  
  87. #on death of powered creeper:
  88. # set {_l::*} to regions at event-location
  89. # loop {_l::*}:
  90. # broadcast loop-value
  91. # loop-value is "diglet":
  92. # broadcast "wyczyszczono"
  93. # clear drops
  94. # event-location is in region "diglet":
  95. # broadcast "jest"
  96. # clear drops
  97.  
  98. command /remdiglet:
  99. permission: wlasciciel
  100. trigger:
  101. set {_b} to block at player
  102. if "%{diglet.spawny::*}%" contains "%location at {_b}%":
  103. remove location at {_b} from {diglet.spawny::*}
  104. send "&2Pomyslnie usunieto lokalizacje &7%{_b}'s location% &2jako spawn digleta"
  105. else:
  106. send "&cLokalizacja &7%{_b}'s location% &cnie jest dodana do listy"
  107.  
  108. command /listdiglet:
  109. permission: wlasciciel
  110. trigger:
  111. send "&a&lW sumie: &b&l%size of {diglet.spawny::*}%"
  112. loop {diglet.spawny::*}:
  113. send "&a&l%loop-index%. &2%loop-value%"
  114.  
  115.  
  116. function randMob(i: integer):
  117. if {_i} > size of {diglet.spawny::*}:
  118. set {_i} to size of {diglet.spawny::*}
  119. wait 1 tick
  120. set {_t} to random integer between 2 and 5
  121. set {_m} to random integer between 1 and size of {diglet.spawny::*}
  122. loop all entities in radius 0.7 of {diglet.spawny::%{_m}%}:
  123. type of loop-entity is creeper:
  124. set {_i} to "%{_i} - 1%" parsed as integer
  125. randMob({_i})
  126. stop
  127. spawn powered creeper at {diglet.spawny::%{_m}%}
  128. set {_c} to spawned entity
  129. set {_c}'s health to 0.01
  130. apply slowness 100 to {_c}
  131. if {_i} > 1:
  132. set {_i} to "%{_i} - 1%" parsed as integer
  133. randMob({_i})
  134. set {_t} to "%{_t}% seconds" parsed as timespan
  135. wait {_t}
  136. if {_c} is not alive:
  137. stop
  138. apply levitation 15 to {_c}
  139. loop 10 times:
  140. if block 2 meters above {_c} is not air:
  141. exit 2 sections
  142. wait 5 ticks
  143. if {_c} is not alive:
  144. stop
  145. remove (random integer between 2 and 5) * 5 from {diglet.hp}
  146. make fake explosion at {_c}
  147. teleport {_c} to location(0, -100, 0, {_c}'s world)
  148. kill {_c}
  149.  
  150.  
  151.  
  152. command /sztest <integer>:
  153. trigger:
  154. if {diglet.hp} is set:
  155. stop
  156. set block at {@block_in} to redstone block
  157. set {diglet.hp} to 100
  158. set {_cz} to 0
  159. loop all players in radius 20 around {@srodek}:
  160. if "%region at loop-player%" contains "diglet":
  161. odliczanie(loop-player, arg)
  162. while {_cz} < arg:
  163. if {diglet.hp} < 1:
  164. set metadata value "odliczanie.czas" of {_p} to true
  165. set block at {@block_in} to air
  166. delete {diglet.hp}
  167. stop
  168. set {_i} to random integer between 5 and 12
  169. add {_i} to {_cz}
  170. set {_i} to "%{_i}% seconds" parsed as timespan
  171. randMob(random integer between 1 and 4)
  172. wait {_i}
  173. set block at {@block_out} to redstone block
  174. wait 30 seconds
  175. delete {diglet.hp}
  176. set block at {@block_in} to air
  177. set block at {@block_out} to air
  178.  
  179.  
  180. function end(p: player):
  181. if metadata value "diglet.pozostalo" of {_p} >= 2:
  182. send {_p} title "&c&lGratulacje!" with subtitle "&7Szatan sie zalamal jak patrzyl na Twoje zmagania..." for 5 seconds
  183. wait 10 ticks
  184. run {_p} command "warp katedra" as op
  185. else:
  186. set {_m} to metadata value "diglet.pozostalo" of {_p}
  187. add 1 to {_m}
  188. set metadata value "diglet.pozostalo" of {_p} to {_m}
  189. send {_p} title "&4&lUmarles" with subtitle "&eCreepery pogrzebaly cie zywcem w gruzach. Zostalo Ci %3-{_m}% szans" for 5 seconds
  190. wait 10 ticks
  191. teleport {_p} to {@tp_start}
  192.  
  193.  
  194. on disconnect:
  195. clear metadata value "diglet.pozostalo" of player
  196.  
  197. on exit region "diglet_quest":
  198. clear metadata value "diglet.pozostalo" of player
  199.  
  200.  
  201. on explosion prime:
  202. if event-entity is a creeper:
  203. if "%region at creeper%" contain "diglet":
  204. cancel the event
Add Comment
Please, Sign In to add comment