diff --git a/Server/src/main/kotlin/rs09/game/interaction/item/withitem/HaySackOnSpear.kt b/Server/src/main/kotlin/rs09/game/interaction/item/withitem/HaySackOnSpear.kt new file mode 100644 index 000000000..331f80cd3 --- /dev/null +++ b/Server/src/main/kotlin/rs09/game/interaction/item/withitem/HaySackOnSpear.kt @@ -0,0 +1,22 @@ +package rs09.game.interaction.item.withitem + +import api.Container +import api.ContentAPI +import org.rs09.consts.Items +import rs09.game.interaction.InteractionListener + +class HaySackOnSpear : InteractionListener() { + val HAYSACK = Items.HAY_SACK_6057 + val SPEAR = Items.BRONZE_SPEAR_1237 + + override fun defineListeners() { + onUseWith(ITEM, HAYSACK, SPEAR){ player, used, _ -> + if(ContentAPI.removeItem(player, used.asItem(), Container.INVENTORY)){ + ContentAPI.addItem(player, Items.HAY_SACK_6058, 1) + ContentAPI.sendMessage(player, "You stab the hay sack with a bronze spear") + ContentAPI.removeItem(player, SPEAR, Container.INVENTORY) + } + return@onUseWith true + } + } +} \ No newline at end of file diff --git a/Server/src/main/kotlin/rs09/game/interaction/item/withitem/WatermelonOnSack.kt b/Server/src/main/kotlin/rs09/game/interaction/item/withitem/WatermelonOnSack.kt new file mode 100644 index 000000000..be5dca0d7 --- /dev/null +++ b/Server/src/main/kotlin/rs09/game/interaction/item/withitem/WatermelonOnSack.kt @@ -0,0 +1,27 @@ +package rs09.game.interaction.item.withitem + +import api.Container +import api.ContentAPI +import core.game.node.entity.skill.Skills +import org.rs09.consts.Items +import rs09.game.interaction.InteractionListener + +class WatermelonOnSack : InteractionListener() { + val SACK = Items.HAY_SACK_6058 + val WATERMELON = Items.WATERMELON_5982 + + override fun defineListeners() { + onUseWith(ITEM, SACK, WATERMELON){player, used, _ -> + if(ContentAPI.getStatLevel(player, Skills.FARMING) >= 23){ + ContentAPI.removeItem(player,SACK, Container.INVENTORY) + ContentAPI.removeItem(player,WATERMELON,Container.INVENTORY) + ContentAPI.addItem(player, Items.SCARECROW_6059) + ContentAPI.rewardXP(player, Skills.FARMING, 25.0) + ContentAPI.sendMessage(player, "You stab the watermelon on top of the spear, finishing your scarecrow") + }else{ + ContentAPI.sendMessage(player, "Your Farming level is not high enough to do this") + } + return@onUseWith true + } + } +} \ No newline at end of file diff --git a/Server/src/main/kotlin/rs09/game/node/entity/skill/runecrafting/abyss/AbyssPlugin.kt b/Server/src/main/kotlin/rs09/game/node/entity/skill/runecrafting/abyss/AbyssPlugin.kt index d3342ea4a..4ad941569 100644 --- a/Server/src/main/kotlin/rs09/game/node/entity/skill/runecrafting/abyss/AbyssPlugin.kt +++ b/Server/src/main/kotlin/rs09/game/node/entity/skill/runecrafting/abyss/AbyssPlugin.kt @@ -26,9 +26,10 @@ import rs09.game.world.GameWorld */ class AbyssPlugin : InteractionListener() { - val OBSTACLE = AbbysalObstacle.values().filter { it != AbbysalObstacle.MINE && it != AbbysalObstacle.SQUEEZE }.map { it.option }.toTypedArray() + val OBSTACLE = AbbysalObstacle.values().filter { it != AbbysalObstacle.MINE && it != AbbysalObstacle.SQUEEZE && it != AbbysalObstacle.PASSAGE}.map { it.option }.toTypedArray() val miningObstacle = 7158 val agilityObstacle = 7164 + val passage = 7154 override fun defineListeners() { definePlugin(AbyssalNPC()) @@ -62,6 +63,11 @@ class AbyssPlugin : InteractionListener() { obstacle!!.handle(player, node as Scenery) return@on true } + on(passage, SCENERY, "go-through",){ player, node -> + val obstacle = AbbysalObstacle.forObject(node as Scenery) + obstacle!!.handle(player, node as Scenery) + return@on true + } }