Advertisement
Gamebuster

Puddles.sk v1.4.0.4

Feb 15th, 2015
517
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.03 KB | None | 0 0
  1. #Version 1.4.0.4
  2. #In order to download or use this software, you must agree to it's license: http://pastebin.com/raw.php?i=JGSLhFdU
  3. #Edit options and aliases to customize the skript
  4.  
  5. options:
  6. rangeXZ : 100 #The distance on both horizontal axes in which puddles can form
  7. rangeY : 20 #The distance on the Y axis in which puddles can form
  8. #COMMENT FOR BELOW OPTION #The list of biomes that puddles cannot form in, make sure you have OR and not AND at the end
  9. disallowed biome : Desert, Desert Mountains, Desert Hills, Savanna, Savanna Mountains, Savanna Plateau, Savanna Plateau Mountains, Mesa, Mesa Bryce, Mesa Plateau, Mesa Plateau Mountains, Mesa Plateau forest, Mesa Plateau forest mountains, Cold Taiga, Cold Taiga Mountains, Cold Taiga Hills, Ice Plains, Ice Plains Spikes, Ice Mountains, Cold Beach, Frozen River, or hell
  10.  
  11. aliases:
  12. #USE NUMERICAL BLOCK IDS FOR THIS LIST
  13. #
  14. #
  15. #
  16. #LANDONABLE-Blocks that puddles can land on
  17. #FALLTHROUGHABLE-Blocks that puddles can form under
  18. #REPLACEABLE-Blocks that puddles can replace
  19. landonable = 1, 2, 3, 4, 7, 12, 5, 17, 162, 13, 97, 98, 16, 15, 73, 14, 129, 56, 21
  20. fallthroughable = 0, 18, 161, 8, 9, 175
  21. replaceable = 0, 31, 32, 37, 38, 78:0, 175, #55 #(redstone not replaceable by default)
  22.  
  23. every 1 tick:
  24. loop players:
  25. if is raining or thundering in loop-player's world:
  26. set {_valid.%loop-player%} to true
  27. set {_loc} to location of loop-player
  28. set {_horizontalX} to a random integer between (-{@rangeXZ} + loop-player's location's x-coordinate) and ({@rangeXZ} + loop-player's location's x-coordinate)
  29. set {_horizontalZ} to a random integer between (-{@rangeXZ} + loop-player's location's z-coordinate) and ({@rangeXZ} + loop-player's location's z-coordinate)
  30. set {_vertical} to a random integer between (-{@rangeY} + loop-player's location's y-coordinate) and ({@rangeY} + loop-player's location's y-coordinate)
  31. set {_world} to loop-player's world
  32. set {_puddleLoc} to loop-player's location
  33. set the x-coordinate of {_puddleLoc} to {_horizontalX} - 0.5
  34. set the y-coordinate of {_puddleLoc} to {_vertical} - 0.5
  35. set the z-coordinate of {_puddleLoc} to {_horizontalZ}
  36. if block at {_puddleLoc} is replaceable:
  37. if block below {_puddleLoc} is landonable:
  38. if biome at {_puddleLoc} is {@disallowed biome}:
  39. set {_valid.%loop-player%} to false
  40. else if biome at {_puddleLoc} is Extreme Hills, Extreme Hills Mountains, Extreme Hills Plus, or Extreme Hills Plus Mountains:
  41. if {_vertical} >= 93:
  42. set {_valid.%loop-player%} to false
  43. loop blocks above block above {_puddleLoc}:
  44. if loop-block is not fallthroughable:
  45. set {_valid.%loop-player%} to false
  46. else:
  47. set {_valid.%loop-player%} to false
  48. else:
  49. set {_valid.%loop-player%} to false
  50. if {_valid.%loop-player%} is true:
  51. if {puddle.debug} is on:
  52. message "Puddle added at %{_puddleLoc}% replacing %block at {_puddleLoc}%" to loop-player
  53. add {_puddleLoc} to {puddleLocations.%loop-player's world%::*}
  54. set block at {_puddleLoc} to air
  55. wait 1 tick
  56. set block at {_puddleLoc} to water
  57. set data value of block at {_puddleLoc} to 7
  58.  
  59. command /puddletest:
  60. trigger:
  61. if command sender is an op:
  62. set {_valid.%player%} to true
  63. set {_loc} to location of player
  64. set {_world} to player's world
  65. set {_puddleLoc} to player's location
  66. if block at {_puddleLoc} is replaceable:
  67. if block below {_puddleLoc} is landonable:
  68. if biome at {_puddleLoc} is {@disallowed biome}:
  69. set {_valid.%player%} to false
  70. else if biome at {_puddleLoc} is Extreme Hills, Extreme Hills Mountains, Extreme Hills Plus, or Extreme Hills Plus Mountains:
  71. if {_vertical} >= 93:
  72. set {_valid.%player%} to false
  73. loop blocks above block above {_puddleLoc}:
  74. if loop-block is not fallthroughable:
  75. message "%loop-block% (%loop-block's id%:%loop-block's damage value%) is not fallthroughable"
  76. set {_valid.%player%} to false
  77. add loop-block to {_invalidBlocks::*}
  78. if {_valid.%player%} is false:
  79. loop 4 times:
  80. loop {_invalidBlocks::*}:
  81. make player see block at loop-value's location as red wool
  82. wait 0.5 second
  83. loop {_invalidBlocks::*}:
  84. make player see block at loop-value's location as loop-value
  85. wait 0.5 second
  86. else:
  87. set {_valid.%player%} to false
  88. message "puddle cannot land on %block below {_puddleLoc}%"
  89. wait 1 tick
  90. loop 4 times:
  91. make player see block below {_puddleLoc} as red wool
  92. wait 0.5 second
  93. make player see block below {_puddleLoc} as block below {_puddleLoc}
  94. wait 0.5 second
  95. else:
  96. message "%block at {_puddleLoc}% is not replaceable"
  97. loop 4 times:
  98. make player see block at {_puddleLoc} as red wool
  99. wait 0.5 second
  100. make player see block at {_puddleLoc} as block at {_puddleLoc}
  101. wait 0.5 second
  102. set {_valid.%player%} to false
  103. if {_valid.%player%} is true:
  104. message "puddle is placeable at your feet"
  105. add {_puddleLoc} to {puddleLocations.%player's world%::*}
  106. else:
  107. message "<red>You do not have permission to do this"
  108.  
  109. every 1 second:
  110. loop worlds:
  111. set {_chance} to 20%
  112. if is raining in loop-world:
  113. if time in loop-world is between 20:00 and 8:00:
  114. set {_chance} to {_chance} * 0.25
  115. else if time in loop-world is between 11:00 and 16:00:
  116. set {_chance} to {_chance} * 0.75
  117. else:
  118. set {_chance} to {_chance} * 0.50
  119. else if is thundering in loop-world:
  120. if time in loop-world is between 20:00 and 8:00:
  121. set {_chance} to {_chance} * 0.05
  122. if time in loop-world is between 11:00 and 16:00:
  123. set {_chance} to {_chance} * 0.2
  124. else:
  125. set {_chance} to {_chance} * 0.1
  126. else if is sunny in loop-world:
  127. if time in loop-world is between 20:00 and 8:00:
  128. set {_chance} to {_chance} * 0.9
  129. else if time in loop-world is between 11:00 and 16:00:
  130. set {_chance} to {_chance} * 1.2
  131. else:
  132. set {_chance} to {_chance} * 1
  133.  
  134. else:
  135. stop
  136. chance of {_chance}:
  137. set {_loc} to a random location out of {puddleLocations.%loop-world%::*}
  138. if {_loc} is set:
  139. if block at {_loc} is water:
  140. if data value of block at {_loc} is 7:
  141. set block at {_loc} to air
  142. if {puddle.debug} is on:
  143. broadcast "Puddle removed at %{_loc}%"
  144. else if {puddle.debug} is on:
  145. broadcast "Puddle no longer exists at %{_loc}%"
  146. else if {puddle.debug} is on:
  147. broadcast "Puddle no longer exists at %{_loc}%"
  148. wait 1 tick
  149. remove all {_loc} from {puddleLocations.%loop-world%::*}
  150. if {weather.%loop-world%.timer} is set:
  151. if {weather.%loop-world%.timer} > 0:
  152. subtract 1 from {weather.%loop-world%.timer}
  153. else:
  154. execute the console command "/toggledownfall %loop-world%"
  155. clear {weather.%loop-world%.timer}
  156.  
  157.  
  158. command /puddles [<text>] [<text="%command sender's world%">]:
  159. aliases: /puddle
  160. trigger:
  161. if player is an op:
  162. if argument 1 is "clear":
  163. if argument 2 is "all":
  164. loop worlds:
  165. loop {puddleLocations.%loop-world%::*}:
  166. set block at loop-value to air
  167. remove all loop-value from {puddleLocations.%loop-world%::*}
  168. message "<light red>Cleared all puddles in all worlds..."
  169. else if argument 2 is not "all":
  170. loop {puddleLocations.%argument 2%::*}:
  171. set block at loop-value to air
  172. remove all loop-value from {puddleLocations.%argument 2%::*}
  173. message "<light red>Cleared all puddles in world ""%argument 2%"""
  174. else if argument 1 is "list":
  175. if argument 2 is "all":
  176. set {_amt} to 0
  177. loop worlds:
  178. loop {puddleLocations.%loop-world%::*}:
  179. add 1 to {_amt}
  180. message "(%{_amt}%). %loop-value% in world ""%loop-world%"""
  181. else:
  182. set {_amt} to 0
  183. loop {puddleLocations.%argument 2%::*}:
  184. add 1 to {_amt}
  185. message "(%{_amt}%). %loop-value%" to command sender
  186. message "<light green>Listed all puddles in world ""%argument 2%"""
  187. else if argument 1 is "create":
  188. set block at player's location to water
  189. set data value of block at player's location to 7
  190. message "%command sender% Created a puddle at %location of block at player's location%"
  191. add location of block at player's location to {puddleLocations.%event-world%::*}
  192. else:
  193. message "<light red>/puddles <clear|list|create>"
  194. else:
  195. message "<red>You do not have permission to do this"
  196.  
  197. on physics:
  198. if event-block is water:
  199. if data value of event-block is 7:
  200. set {_persist} to false
  201. set {_loc} to event-block's location
  202. subtract 0.5 from the z-coordinate of {_loc}
  203. loop {puddleLocations.%event-world%::*}:
  204. if "%loop-value%" = "%{_loc}%":
  205. if block below event-block is landonable:
  206. cancel the event
  207. set {_persist} to true
  208. if {_persist} is true:
  209. if {puddle.debug} is true:
  210. broadcast "Puddle persisting at %{_loc}%"
  211.  
  212. command /pdebug <boolean>:
  213. trigger:
  214. if command sender is an op:
  215. set {puddle.debug} to argument 1
  216. else:
  217. message "<red>You do not have permission to do this"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement