Advertisement
OMan100

Untitled

Oct 20th, 2019
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.07 KB | None | 0 0
  1. on rightclick on wheat or carrot plant or potato plant:
  2. player is in world "farmplots"
  3. if event-block is wheat:
  4. set {_item} to wheat
  5. set {_seed} to wheat seeds
  6. set {_amount} to 1
  7. else if event-block is carrot plant:
  8. set {_item} to carrot
  9. set {_seed} to carrot
  10. set {_amount} to 2
  11. else if event-block is potato plant:
  12. set {_item} to potato
  13. set {_seed} to potato
  14. set {_amount} to 3
  15. if event-block is fully grown wheat plant or fully grown carrot plant or fully grown potato plant:
  16. if {plants::locations::%location of event-block%} isn't set:
  17. send "&c&lPlease break the plant and place it again"
  18. stop
  19. if {last_harvest::%uuid of player%} is set:
  20. set {_wait} to difference between {last_harvest::%uuid of player%} and now
  21. else:
  22. set {_wait} to 5 ticks
  23. {_wait} >= 5 ticks
  24. if player's tool isn't a hoe:
  25. if {warn::harvest::%uuid of player%} is set:
  26. set {_wait} to difference between now and {warn::harvest::%uuid of player%}
  27. else:
  28. set {_wait} to 3 seconds
  29. if {_wait} >= 3 seconds:
  30. set {warn::harvest::%uuid of player%} to now
  31. send "&e&lWarning - &cYou should use a hoe to harvest plants"
  32. if {plants::locations::%location of event-block%} is set:
  33. if {plants::locations::%location of event-block%} isn't "normal":
  34. set {_plant::*} to {plants::locations::%location of event-block%} split at " "
  35. set {_seed} to {_plant::1}
  36. set {_level} to "%{_plant::2}%" parsed as integer
  37. else:
  38. set {_seed} to "normal"
  39.  
  40. if {_seed} isn't "normal":
  41. if {levels::level::%uuid of player%} >= {plants::level_need::%{_seed}%}:
  42. if player's held item is a hoe:
  43. set {_r} to uncolored name of player's tool in lower case
  44. replace all "»" and "«" and "Hoe" and " " in {_r} with ""
  45. set {_rarity} to {plants::rarity_help::%{_r}%}
  46. else:
  47. set {_rarity} to 1
  48. set {_s} to uncolored {plants::rarity::%{_seed}%} in lower case
  49. if {_rarity} >= {plants::rarity_help::%{_s}%}:
  50. set {_xp} to {plants::xp::%{_seed}%} * {_level}
  51. else:
  52. send "&cYour hoe's rarity isn't high enough to harvest this plant"
  53. stop
  54. else:
  55. send "&cThe required level to harvest %{plants::name::%{_seed}%}% &cis &7%{plants::level_need::%{_seed}%}%"
  56. stop
  57. else:
  58. set {_xp} to 1
  59. set data value of event-block to 0
  60. if {plants::locations::%location of event-block%} isn't "normal":
  61. set {_loot.amount} to {plants::amount::%{_seed}%}*{_amount}*{_level}
  62. else:
  63. set {_loot.amount} to 1
  64. if player's tool is a hoe:
  65. set {_l} to uncolored line 1 of lore of player's tool
  66. replace all "Level: " in {_l} with ""
  67. set {_l} to {_l} parsed as number
  68. set {_lore::*} to hoeUpdate(player, {_xp})
  69. set line 1 of lore of player's tool to {_lore::1}
  70. set line 2 of lore of player's tool to {_lore::2}
  71. set {_l.2} to uncolored line 1 of lore of player's tool
  72. replace all "Level: " in {_l.2} with ""
  73. set {_l.2} to {_l.2} parsed as number
  74. if {_l} != {_l.2}:
  75. send player title "&b&lHoe Level Up!" for 2 seconds with 1 second fade in and 1 second fade out
  76. set {_num} to 3
  77. if line 3 of lore of player's tool is set:
  78. set {_t::*} to lore of player's tool split at "||"
  79. loop size of {_t::*} - 2 times:
  80. set {_l::%{_num}%} to line {_num} of lore of player's held item
  81. add 1 to {_num}
  82. loop {ce::enchants::*}:
  83. if "%{_l::*}%" contains "%loop-value%":
  84. loop {_l::*}:
  85. if loop-value-2 contains loop-value-1:
  86. set {_enchant} to loop-index-1
  87. set {_level} to loop-value-2
  88. replace all loop-value-1 and " " in {_level} with ""
  89. set {_level} to {_level} parsed as integer
  90. set {_ce::%{_enchant}%} to {_level}
  91. set {_enchants} to ""
  92. set {_enchant.used} to 0
  93. set {_enchants.amount} to size of {ce::enchants::*}
  94. if {_ce::fortune} is set:
  95. add 1 to {_enchant.used}
  96. set {_i} to a random integer between 1 and 100
  97. if {_i} <= {_ce::fortune} * 10:
  98. set {_loot.amount} to {_loot.amount} * 2
  99. set {_enchants} to "%{_enchants}% &fFortune"
  100. {_enchant.used} < {_enchants.amount}
  101. if {_ce::luck_of_the_land} is set:
  102. set {_i} to a random integer between 1 and 100
  103. if {_i} <= 3:
  104. if {_ce::luck_of_the_land} is 1:
  105. set {_rarity} to "bad"
  106. else if {_ce::luck_of_the_land} is 2:
  107. set {_rarity} to "ok"
  108. else if {_ce::luck_of_the_land} is 3:
  109. set {_rarity} to "good"
  110. set {_randomitem} to random element out of {common::%{_rarity}%::*}
  111. give {_randomitem} to player
  112. set {_enchants} to "%{_enchants}% &fLuck of the Land"
  113. {_enchant.used} < {_enchants.amount}
  114. if {_ce::mending_touch} is set:
  115. if {_ce::mending_touch} is 1:
  116. set event-block to stage 2 wheat plant
  117. else if {_ce::mending_touch} is 2:
  118. set event-block to stage 3 wheat plant
  119. else if {_ce::mending_touch} is 3:
  120. set event-block to stage 4 wheat plant
  121. set {_enchants} to "%{_enchants}% &fMending Touch"
  122. {_enchant.used} < {_enchants.amount}
  123. if {_ce::fast_money} is set:
  124. set {_i} to a random integer between 1 and 100
  125. set {_money} to {sell::price::%{_seed}%} * {_ce::fast_money} * 0.1
  126. add {_money} to player's balance
  127. set {_enchants} to "%{_enchants}% &6Fast Money"
  128. {_enchant.used} < {_enchants.amount}
  129. if {_ce::xp_crop} is set:
  130. set {_i} to a random integer between 1 and 100
  131. if {_i} <= {_ce::xp_crop} * 15:
  132. set {_xp} to {_xp} + ({_xp} * {_ce::xp_crop} / 10)
  133. set {_enchants} to "%{_enchants}% &6Xp Crop"
  134. {_enchant.used} < {_enchants.amount}
  135. if {_ce::credit_card} is set:
  136. set {_i} to a random integer between 1 and 100
  137. if {_i} <= rounded up {_ce::credit_card} * 5:
  138. add 1 to {credits::%uuid of player%}
  139. set {_enchants} to "%{_enchants}% &6Credit Card"
  140. {_enchants} is set
  141. if {_enchants} isn't "":
  142. if {settings::ce::%uuid of player%} isn't false:
  143. send action bar "{@ce} %{_enchants}%" to player
  144. if {plants::locations::%location of event-block%} is "normal":
  145. give {_loot.amount} of {_item} to player
  146. add 1 to {levels::xp::%uuid of player%}
  147. else:
  148. if {_seed} isn't "experience":
  149. set {_item} to {plants::item::%{_seed}%}
  150. give {_loot.amount} of {_item} to player
  151. else:
  152. add {plants::amount::%{_seed}%} * {_xp} * {_loot.amount} to {levels::xp::%uuid of player%}
  153. if {_seed} isn't "experience":
  154. add {_xp}*{_amount} to {levels::xp::%uuid of player%}
  155. loop 3 times:
  156. add 1 to {_b}
  157. if {daily::complete::%{_b}%::%uuid of player%} isn't true:
  158. if {daily::kind::%{_b}%} is "harvest":
  159. add 1 to {daily::progress::%{_b}%::%uuid of player%}
  160. if {daily::progress::%{_b}%::%uuid of player%} >= {daily::quests::%{_b}%}:
  161. set {daily::complete::%{_b}%::%uuid of player%} to true
  162. add {daily::reward::%{_b}%} to {credits::%uuid of player%}
  163. send "&b&lDaily Mission » %{daily::colors::%{_b}%}%%{daily::difficulty::%{_b}%}% &7quest completed (&a+%{daily::reward::%{_b}%}% credits&7)"
  164. set {last_harvest::%uuid of player%} to now
  165. add 1 to {harvested::%uuid of player%}
  166. xpUpdate(player)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement