Advertisement
fleft17

Untitled

Dec 2nd, 2014
277
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.45 KB | None | 0 0
  1. options:
  2. P: &7[&9BigRiver&7]&r
  3. Start1: &b%command sender%&r in &b%arg-3%:&r Radius: &b%arg-1%&r | Width: &b%arg-2%
  4. Start2: Get away from the BigRiver! Your game may crash!
  5. Cancel: River generation cancelled by &b%{BigRiver.Cancel}%!
  6. Cancelling: Cancelling BigRiver generation!
  7. Message.Delay: 5 seconds
  8.  
  9. command /bigriver <text> [<integer>] [<world>]:
  10. usage: /bigriver <map radius> <crack radius> <world> | /BigRiver cancel
  11. permission: skript.bigriver
  12. trigger:
  13. if arg-1 is "cancel":
  14. if {BigRiver.Running} is true:
  15. set {BigRiver.Cancel} to true
  16. stop trigger
  17. else:
  18. message "{@P} No generation is in progress!"
  19. stop trigger
  20. if arg-1 is set:
  21. if arg-2 is not set:
  22. message "{@P} /bigriver <map radius> <crack radius> <world>"
  23. stop trigger
  24.  
  25. broadcast "{@P} {@Start1}"
  26. broadcast "{@P} {@Start2}"
  27. set {BigRiver.Running} to true
  28. set {_MapRadius} to arg-1 parsed as integer
  29. set {_CrackRadius} to arg-2
  30. set {_World} to arg-3
  31. set {_TotalSlice} to 0
  32. set {_Slice} to 0
  33. if {_MapRadius} is less than 250:
  34. set {_Buffer} to 10
  35. else if {_MapRadius} is less than 500:
  36. set {_Buffer} to 6
  37. else if {_MapRadius} is less than 1000:
  38. set {_Buffer} to 4
  39. else:
  40. set {_Buffer} to 2
  41. wait 5 ticks
  42. set {_Tick} to now
  43. set {_Notify} to now
  44.  
  45. loop 256 times:
  46. if {BigRiver.Cancel} is set:
  47. set {BigRiver.Cancel} to (name of command sender)
  48. message "{@P} {@Cancelling}"
  49. broadcast "{@P} {@Cancel}"
  50. delete {BigRiver.Running}
  51. delete {BigRiver.Cancel}
  52. stop trigger
  53.  
  54. loop blocks from (block at (the location at ({_MapRadius}-0.5), (256-(loop-number)), ({_CrackRadius}-0.5) of the world {_World})) to (block at (the location at ({_MapRadius}-0.5), (256-(loop-number)), (0-{_CrackRadius}+0.5) of the world {_World})):
  55. loop blocks from loop-block-1 to (block (({_MapRadius}*2)-1) west of loop-block-1):
  56. set loop-block-2 to air
  57. y-coordinate of loop-block-2 is less than 64
  58. set loop-block-2 to water
  59.  
  60. add 1 to {_Slice}
  61. if {_Slice} is equal to {_Buffer}:
  62. add {_Slice} to {_TotalSlice}
  63. set {_Slice} to 0
  64. if {_Notify} was more than {@Message.Delay} ago:
  65. set {_Notify} to now
  66. broadcast "{@P} Progress: &bSlice %(loop-number)%/256"
  67. wait 1 tick
  68.  
  69. broadcast "{@P} River generation finished!"
  70. delete {BigRiver.Running}
  71. delete {BigRiver.Cancel}
  72.  
  73.  
  74. on physics:
  75. {BigRiver.Running} is true
  76. cancel the event
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement