Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- on rightclick on wheat or carrot plant or potato plant:
- player is in world "farmplots"
- if event-block is wheat:
- set {_item} to wheat
- set {_seed} to wheat seeds
- set {_amount} to 1
- else if event-block is carrot plant:
- set {_item} to carrot
- set {_seed} to carrot
- set {_amount} to 2
- else if event-block is potato plant:
- set {_item} to potato
- set {_seed} to potato
- set {_amount} to 3
- if event-block is fully grown wheat plant or fully grown carrot plant or fully grown potato plant:
- if {plants::locations::%location of event-block%} isn't set:
- send "&c&lPlease break the plant and place it again"
- stop
- if {last_harvest::%uuid of player%} is set:
- set {_wait} to difference between {last_harvest::%uuid of player%} and now
- else:
- set {_wait} to 5 ticks
- {_wait} >= 5 ticks
- if player's tool isn't a hoe:
- if {warn::harvest::%uuid of player%} is set:
- set {_wait} to difference between now and {warn::harvest::%uuid of player%}
- else:
- set {_wait} to 3 seconds
- if {_wait} >= 3 seconds:
- set {warn::harvest::%uuid of player%} to now
- send "&e&lWarning - &cYou should use a hoe to harvest plants"
- if {plants::locations::%location of event-block%} is set:
- if {plants::locations::%location of event-block%} isn't "normal":
- set {_plant::*} to {plants::locations::%location of event-block%} split at " "
- set {_seed} to {_plant::1}
- set {_level} to "%{_plant::2}%" parsed as integer
- else:
- set {_seed} to "normal"
- if {_seed} isn't "normal":
- if {levels::level::%uuid of player%} >= {plants::level_need::%{_seed}%}:
- if player's held item is a hoe:
- set {_r} to uncolored name of player's tool in lower case
- replace all "»" and "«" and "Hoe" and " " in {_r} with ""
- set {_rarity} to {plants::rarity_help::%{_r}%}
- else:
- set {_rarity} to 1
- set {_s} to uncolored {plants::rarity::%{_seed}%} in lower case
- if {_rarity} >= {plants::rarity_help::%{_s}%}:
- set {_xp} to {plants::xp::%{_seed}%} * {_level}
- else:
- send "&cYour hoe's rarity isn't high enough to harvest this plant"
- stop
- else:
- send "&cThe required level to harvest %{plants::name::%{_seed}%}% &cis &7%{plants::level_need::%{_seed}%}%"
- stop
- else:
- set {_xp} to 1
- set data value of event-block to 0
- if {plants::locations::%location of event-block%} isn't "normal":
- set {_loot.amount} to {plants::amount::%{_seed}%}*{_amount}*{_level}
- else:
- set {_loot.amount} to 1
- if player's tool is a hoe:
- set {_l} to uncolored line 1 of lore of player's tool
- replace all "Level: " in {_l} with ""
- set {_l} to {_l} parsed as number
- set {_lore::*} to hoeUpdate(player, {_xp})
- set line 1 of lore of player's tool to {_lore::1}
- set line 2 of lore of player's tool to {_lore::2}
- set {_l.2} to uncolored line 1 of lore of player's tool
- replace all "Level: " in {_l.2} with ""
- set {_l.2} to {_l.2} parsed as number
- if {_l} != {_l.2}:
- send player title "&b&lHoe Level Up!" for 2 seconds with 1 second fade in and 1 second fade out
- set {_num} to 3
- if line 3 of lore of player's tool is set:
- set {_t::*} to lore of player's tool split at "||"
- loop size of {_t::*} - 2 times:
- set {_l::%{_num}%} to line {_num} of lore of player's held item
- add 1 to {_num}
- loop {ce::enchants::*}:
- if "%{_l::*}%" contains "%loop-value%":
- loop {_l::*}:
- if loop-value-2 contains loop-value-1:
- set {_enchant} to loop-index-1
- set {_level} to loop-value-2
- replace all loop-value-1 and " " in {_level} with ""
- set {_level} to {_level} parsed as integer
- set {_ce::%{_enchant}%} to {_level}
- set {_enchants} to ""
- set {_enchant.used} to 0
- set {_enchants.amount} to size of {ce::enchants::*}
- if {_ce::fortune} is set:
- add 1 to {_enchant.used}
- set {_i} to a random integer between 1 and 100
- if {_i} <= {_ce::fortune} * 10:
- set {_loot.amount} to {_loot.amount} * 2
- set {_enchants} to "%{_enchants}% &fFortune"
- {_enchant.used} < {_enchants.amount}
- if {_ce::luck_of_the_land} is set:
- set {_i} to a random integer between 1 and 100
- if {_i} <= 3:
- if {_ce::luck_of_the_land} is 1:
- set {_rarity} to "bad"
- else if {_ce::luck_of_the_land} is 2:
- set {_rarity} to "ok"
- else if {_ce::luck_of_the_land} is 3:
- set {_rarity} to "good"
- set {_randomitem} to random element out of {common::%{_rarity}%::*}
- give {_randomitem} to player
- set {_enchants} to "%{_enchants}% &fLuck of the Land"
- {_enchant.used} < {_enchants.amount}
- if {_ce::mending_touch} is set:
- if {_ce::mending_touch} is 1:
- set event-block to stage 2 wheat plant
- else if {_ce::mending_touch} is 2:
- set event-block to stage 3 wheat plant
- else if {_ce::mending_touch} is 3:
- set event-block to stage 4 wheat plant
- set {_enchants} to "%{_enchants}% &fMending Touch"
- {_enchant.used} < {_enchants.amount}
- if {_ce::fast_money} is set:
- set {_i} to a random integer between 1 and 100
- set {_money} to {sell::price::%{_seed}%} * {_ce::fast_money} * 0.1
- add {_money} to player's balance
- set {_enchants} to "%{_enchants}% &6Fast Money"
- {_enchant.used} < {_enchants.amount}
- if {_ce::xp_crop} is set:
- set {_i} to a random integer between 1 and 100
- if {_i} <= {_ce::xp_crop} * 15:
- set {_xp} to {_xp} + ({_xp} * {_ce::xp_crop} / 10)
- set {_enchants} to "%{_enchants}% &6Xp Crop"
- {_enchant.used} < {_enchants.amount}
- if {_ce::credit_card} is set:
- set {_i} to a random integer between 1 and 100
- if {_i} <= rounded up {_ce::credit_card} * 5:
- add 1 to {credits::%uuid of player%}
- set {_enchants} to "%{_enchants}% &6Credit Card"
- {_enchants} is set
- if {_enchants} isn't "":
- if {settings::ce::%uuid of player%} isn't false:
- send action bar "{@ce} %{_enchants}%" to player
- if {plants::locations::%location of event-block%} is "normal":
- give {_loot.amount} of {_item} to player
- add 1 to {levels::xp::%uuid of player%}
- else:
- if {_seed} isn't "experience":
- set {_item} to {plants::item::%{_seed}%}
- give {_loot.amount} of {_item} to player
- else:
- add {plants::amount::%{_seed}%} * {_xp} * {_loot.amount} to {levels::xp::%uuid of player%}
- if {_seed} isn't "experience":
- add {_xp}*{_amount} to {levels::xp::%uuid of player%}
- loop 3 times:
- add 1 to {_b}
- if {daily::complete::%{_b}%::%uuid of player%} isn't true:
- if {daily::kind::%{_b}%} is "harvest":
- add 1 to {daily::progress::%{_b}%::%uuid of player%}
- if {daily::progress::%{_b}%::%uuid of player%} >= {daily::quests::%{_b}%}:
- set {daily::complete::%{_b}%::%uuid of player%} to true
- add {daily::reward::%{_b}%} to {credits::%uuid of player%}
- send "&b&lDaily Mission » %{daily::colors::%{_b}%}%%{daily::difficulty::%{_b}%}% &7quest completed (&a+%{daily::reward::%{_b}%}% credits&7)"
- set {last_harvest::%uuid of player%} to now
- add 1 to {harvested::%uuid of player%}
- xpUpdate(player)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement