yozora_1202

Untitled

Jul 14th, 2018
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.43 KB | None | 0 0
  1. options:
  2. prefix: &7[&9Fish&7]
  3. defaultIcon: raw fish
  4. defaultMinChance: 1
  5. defaultMaxChance: 100
  6. defaultBiome1: ocean
  7. defaultBiome2: deep ocean
  8. defaultBiome3: river
  9.  
  10. function menu(p: player, pg: integer, type: text):
  11. set {_i} to {_pg}*(3*9) - ((3*9)- 1)
  12. if {_type} is "MENU":
  13. create a gui with virtual chest with 4 rows named "&1Fish Menu Page %{_pg}%":
  14. loop 3*9 times:
  15. if {fish::list::%{_i}%} is set:
  16. if {fish::list::%{_i}%::biome::1} is set:
  17. set {_biome::1} to {fish::list::%{_i}%::biome::1}
  18. if {fish::list::%{_i}%::biome::2} is set:
  19. set {_biome::2} to {fish::list::%{_i}%::biome::2}
  20. if {fish::list::%{_i}%::biome::3} is set:
  21. set {_biome::3} to {fish::list::%{_i}%::biome::3}
  22. make next gui to {fish::list::%{_i}%::icon} named "&b%{fish::list::%{_i}%}%" with lore "||&3&lBiome||&f- &7%{_biome::1}%||&f- &7%{_biome::2}%||&f- &7%{_biome::3}%||&e&lChance&c %{fish::list::%{_i}%::chance::min}%%% - %{fish::list::%{_i}%::chance::max}%%%||||&7%{fish::list::%{_i}%::description}%":
  23. if {_p} has permission "fish.get":
  24. give {fish::list::%{_i}%::fish} to {_p}
  25. add 1 to {_i}
  26. make gui slot 4*9 - 1 to green glass pane named "&aNext Page &8[&c%{_pg} + 1%&8]":
  27. menu({_p}, "%{_pg} + 1%" parsed as integer, "%{_type}%")
  28. if {_pg} > 1:
  29. make gui slot 4*9 - 9 to red glass pane named "&3Previous Page &8[&c%{_pg} - 1%&8]":
  30. menu({_p}, "%{_pg} - 1%" parsed as integer, "%{_type}%")
  31. open last gui to {_p}
  32. stop
  33.  
  34. on fishing:
  35. if "%fishing state%" is "CAUGHT_FISH":
  36. set {_biome} to event-player's biome
  37. loop {fish::list::*}:
  38. if "%{fish::list::%loop-index%::biome::1}%" or "%{fish::list::%loop-index%::biome::2}%" or "%{fish::list::%loop-index%::biome::3}%" is "%{_biome}%":
  39. add loop-index to {_caught::*}
  40. set {_fish} to random element of {_caught::*}
  41. set {_chance} to random number between {fish::list::%{_fish}%::chance::min} and {fish::list::%{_fish}%::chance::max}
  42. chance of {_chance}%:
  43. send "&eYou've caught an &b%{fish::list::%{_fish}%}%"
  44. clear caught item
  45. drop {fish::list::%{_fish}%::fish} at event-player
  46. stop
  47.  
  48. command /fish [<text>] [<text>] [<Text>]:
  49. trigger:
  50. if arg 1 isn't set:
  51. menu(player, 1, "MENU")
  52. stop
  53. if player has permission "fish.admin":
  54. if arg 1 is "chance":
  55. if arg 2 is set:
  56. if arg 3 is set:
  57. set {_chance::*} to arg 3 split at "-"
  58. loop {fish::list::*}:
  59. if {fish::list::%loop-index%} is "%arg 2%":
  60. set {fish::list::%loop-index%::chance::min} to {_chance::1} parsed as number
  61. set {fish::list::%loop-index%::chance::max} to {_chance::2} parsed as number
  62. send "{@prefix} &eChance of &b%Arg 2% &e has been updated to &6%{_chance::1}%%% - %{_chance::2}%%%"
  63. stop
  64. if arg 1 is "biome":
  65. if arg 2 is set:
  66. if arg 3 is set:
  67. set {_biome::*} to arg 3 split at ":"
  68. loop {fish::list::*}:
  69. if {fish::list::%loop-index%} is "%Arg 2%":
  70. set {fish::list::%loop-index%::biome::%{_biome::1}%} to "%{_biome::2}%"
  71. send "{@prefix} &eBiome of &b%arg 2% &efor index &c%{_biome::1}% &ehas been updated"
  72. send "{@prefix} &b%arg 2% &enow can be found at &6%{fish::list::%loop-index%::biome::*}%"
  73. stop
  74. if arg 1 is "seticon":
  75. if arg 2 is set:
  76. loop {fish::list::*}:
  77. if {fish::list::%loop-index%} is "%arg 2%":
  78. set {fish::list::%loop-index%::icon} to 1 of player's tool
  79. send "{@prefix} &eIcon for &b%arg 2% &ehas been updated"
  80. stop
  81. if arg 1 is "desc" or "Description":
  82. if arg 2 is set:
  83. if arg 3 is set:
  84. loop {fish::list::*}:
  85. if {fish::list::%loop-index%} is "%arg 2%":
  86. set {fish::list::%loop-index%::description} to colored arg 3
  87. set {fish::list::%loop-index%::fish} to {fish::list::%loop-index%::icon} named "&b%{fish::list::%loop-index%}%" with lore "||&7%{fish::list::%loop-index%::description}%"
  88. send "{@prefix} &eDescription for &b%arg 2% &ehas been updated"
  89. stop
  90. if arg 1 is "add" or "new" or "create":
  91. if arg 2 is set:
  92. if "%{fish::list::*}%" contains "%arg 2%":
  93. send "{@prefix} &cFish named &b%arg 2%&c already created"
  94. stop
  95. add arg 2 to {fish::list::*}
  96. loop {fish::list::*}:
  97. if {fish::list::%loop-index%} is "%arg 2%":
  98. set {_icon} to {@defaultIcon}
  99. if player's tool is fish:
  100. set {_icon} to 1 of player's tool
  101. set {fish::list::%loop-index%::icon} to {_icon}
  102. set {fish::list::%loop-index%::biome::1} to {@defaultBiome1}
  103. set {fish::list::%loop-index%::biome::2} to {@defaultBiome2}
  104. set {fish::list::%loop-index%::biome::3} to {@defaultBiome3}
  105.  
  106. set {fish::list::%loop-index%::fish} to {fish::list::%loop-index%::icon} named "&b%{fish::list::%loop-index%}%" with lore "||&7%{fish::list::%loop-index%::description}%"
  107. set {fish::list::%loop-index%::description} to "&r"
  108.  
  109. set {fish::list::%loop-index%::chance::min} to {@defaultMinChance}
  110. set {fish::list::%loop-index%::chance::max} to {@defaultMaxChance}
  111. send "{@prefix} &aNew fish has been added named &b%arg 2%"
  112. stop
  113. if arg 1 is "del" or "delete" or "remove" or "rem":
  114. if arg 2 is set:
  115. loop {fish::list::*}:
  116. if {fish::list::%loop-index%} is "%arg 2%":
  117. delete {fish::list::%loop-index%}
  118. clear {fish::list::%loop-index%::*}
  119. send "{@prefix} &cFish &b%arg 2% &chas been removed"
  120. stop
Add Comment
Please, Sign In to add comment