forked from 2009Scape/Server
Farming produce is automatically noted if wearing an amulet of farming or amulet of nature
Since the leprechaun is right there and can do the same function, this just saves the annoying clicking of harvesting and using the produce on the leprechaun over and over. Note that the other functions of the amulet of farming or amulet of nature are not implemented yet.
This commit is contained in:
parent
3119a01e3f
commit
f258632fb5
1 changed files with 13 additions and 1 deletions
|
|
@ -82,9 +82,17 @@ class CropHarvester : OptionHandler() {
|
|||
sendMessage(player, "You lack the needed tool to harvest these crops.")
|
||||
return true
|
||||
}
|
||||
val necklace = getItemFromEquipment(player, EquipmentSlot.NECK)
|
||||
var amulet = false
|
||||
if (necklace != null && (necklace.name.lowercase().contains("amulet of farming") || necklace.name.lowercase().contains("amulet of nature"))) {
|
||||
amulet = true
|
||||
}
|
||||
val sendHarvestMessages = if (fPatch.type == PatchType.FLOWER_PATCH) false else true
|
||||
if (sendHarvestMessages && firstHarvest) {
|
||||
sendMessage(player, "You begin to harvest the $patchName.")
|
||||
if (amulet) {
|
||||
sendMessage(player, "The leprechaun exchanges your produce for banknotes.")
|
||||
}
|
||||
firstHarvest = false
|
||||
}
|
||||
animate(player, anim)
|
||||
|
|
@ -92,7 +100,11 @@ class CropHarvester : OptionHandler() {
|
|||
// TODO: If a flower patch is being harvested, delay the clearing of the
|
||||
// patch until after the animation has played - https://youtu.be/lg4GktlVNUY?t=75
|
||||
delay = 2
|
||||
addItem(player, reward.id)
|
||||
if (amulet) {
|
||||
addItem(player, note(reward).id)
|
||||
} else {
|
||||
addItem(player, reward.id)
|
||||
}
|
||||
rewardXP(player, Skills.FARMING, plantable.harvestXP)
|
||||
if (patch.patch.type in livesBased) {
|
||||
patch.rollLivesDecrement(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue