Advertisement
Gamebuster

Puddles.sk v1.3.0

Nov 27th, 2014
606
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.87 KB | None | 0 0
  1. #Version 1.3.0
  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 customise 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 axes 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-Blacks that puddles can form under
  18. #REPLACEABLE-Blocks that puddles can replace CURRENTLY UNUSED AND DOESN'T DO ANNYTHING
  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
  21. replaceable = 0
  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 air:
  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 at {_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. set block at {_puddleLoc} to water
  52. set data value of block at {_puddleLoc} to 7
  53. if {puddle.debug} is on:
  54. message "Puddle added at %{_puddleLoc}%" to loop-player
  55. add {_puddleLoc} to {puddleLocations.%loop-player's world%::*}
  56.  
  57. every 1 second:
  58. loop worlds:
  59. set {_chance} to 20%
  60. if is raining in loop-world:
  61. if time in loop-world is between 20:00 and 8:00:
  62. set {_chance} to {_chance} * 0.25
  63. else if time in loop-world is between 11:00 and 16:00:
  64. set {_chance} to {_chance} * 0.75
  65. else:
  66. set {_chance} to {_chance} * 0.50
  67. else if is thundering in loop-world:
  68. if time in loop-world is between 20:00 and 8:00:
  69. set {_chance} to {_chance} * 0.05
  70. if time in loop-world is between 11:00 and 16:00:
  71. set {_chance} to {_chance} * 0.2
  72. else:
  73. set {_chance} to {_chance} * 0.1
  74. else if is sunny in loop-world:
  75. if time in loop-world is between 20:00 and 8:00:
  76. set {_chance} to {_chance} * 0.9
  77. else if time in loop-world is between 11:00 and 16:00:
  78. set {_chance} to {_chance} * 1.2
  79. else:
  80. set {_chance} to {_chance} * 1
  81.  
  82. else:
  83. set {_chance} to 20%
  84. chance of {_chance}:
  85. set {_loc} to a random location out of {puddleLocations.%loop-world%::*}
  86. if {_loc} is set:
  87. if block at {_loc} is water:
  88. if data value of block at {_loc} is 7:
  89. set block at {_loc} to air
  90. if {puddle.debug} is on:
  91. broadcast "Puddle removed at %{_loc}%"
  92. else if {puddle.debug} is on:
  93. broadcast "Puddle no longer exists at %{_loc}%"
  94. else if {puddle.debug} is on:
  95. broadcast "Puddle no longer exists at %{_loc}%"
  96. wait 1 tick
  97. remove all {_loc} from {puddleLocations.%loop-world%::*}
  98. if {weather.%loop-world%.timer} is set:
  99. if {weather.%loop-world%.timer} > 0:
  100. subtract 1 from {weather.%loop-world%.timer}
  101. else:
  102. execute the console command "/toggledownfall %loop-world%"
  103. clear {weather.%loop-world%.timer}
  104.  
  105.  
  106. command /puddles [<text>] [<text="%command sender's world%">]:
  107. aliases: /puddle
  108. trigger:
  109. if player is an op:
  110. if argument 1 is "clear":
  111. if argument 2 is "all":
  112. loop worlds:
  113. loop {puddleLocations.%loop-world%::*}:
  114. set block at loop-value to air
  115. remove all loop-value from {puddleLocations.%loop-world%::*}
  116. message "<light red>Cleared all puddles in all worlds..."
  117. else if argument 2 is not "all":
  118. loop {puddleLocations.%argument 2%::*}:
  119. set block at loop-value to air
  120. remove all loop-value from {puddleLocations.%argument 2%::*}
  121. message "<light red>Cleared all puddles in world ""%argument 2%"""
  122. else if argument 1 is "list":
  123. if argument 2 is "all":
  124. set {_amt} to 0
  125. loop worlds:
  126. loop {puddleLocations.%loop-world%::*}:
  127. add 1 to {_amt}
  128. message "(%{_amt}%). %loop-value% in world ""%loop-world%"""
  129. else:
  130. set {_amt} to 0
  131. loop {puddleLocations.%argument 2%::*}:
  132. add 1 to {_amt}
  133. message "(%{_amt}%). %loop-value%" to command sender
  134. message "<light green>Listed all puddles in world ""%argument 2%"""
  135. else if argument 1 is "create":
  136. set block at player's location to water
  137. set data value of block at player's location to 7
  138. message "%command sender% Created a puddle at %location of block at player's location%"
  139. add location of block at player's location to {puddleLocations.%event-world%::*}
  140. else:
  141. message "<light red>/puddles <clear|list|create>"
  142. else:
  143. message "<red>You do not have permission to do this"
  144.  
  145. on physics:
  146. if event-block is water:
  147. if data value of event-block is 7:
  148. set {_persist} to false
  149. set {_loc} to event-block's location
  150. subtract 0.5 from the z-coordinate of {_loc}
  151. loop {puddleLocations.%event-world%::*}:
  152. if "%loop-value%" = "%{_loc}%":
  153. if block below event-block is landonable:
  154. cancel the event
  155. set {_persist} to true
  156. if {_persist} is true:
  157. if {puddle.debug} is true:
  158. broadcast "Puddle persisting at %{_loc}%"
  159.  
  160. command /weather [<text>] [<text>] [<text="%event-world%">]:
  161. trigger:
  162. if command sender is an op:
  163. if argument 1 is "rain", "thunder", "lightning", "clear", "sunny", or "sun":
  164. if argument 2 parsed as number is an integer:
  165. if argument 3 parsed as world is a world:
  166. clear {weather.%world%.timer}
  167. if argument 1 is "rain":
  168. set the weather of argument 3 parsed as world to rain
  169. if argument 1 is "thunder" or "lightning":
  170. set the weather of argument 3 parsed as world to thunder
  171. if argument 1 is "clear", "sunny", or "sun":
  172. set the weather of argument 3 parsed as world to clear
  173. set {weather.%world%.timer} to argument 2 parsed as integer
  174. else:
  175. message "<light red>""argument 3"" is not an existing world"
  176. else:
  177. message "<light red>/weather %argument 1% <integer (seconds)>"
  178. else:
  179. message "<light red>/weather <weather type>"
  180.  
  181. on weather change:
  182. if {weather.%world%.timer} > 0:
  183. cancel the event
  184.  
  185.  
  186. command /pdebug <boolean>:
  187. trigger:
  188. if command sender is an op:
  189. set {puddle.debug} to argument 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement