Added ability to actually make scarecrows now/Fixed a bug caused by the AbyssPlugin
This commit is contained in:
@@ -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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+7
-1
@@ -26,9 +26,10 @@ import rs09.game.world.GameWorld
|
|||||||
*/
|
*/
|
||||||
class AbyssPlugin : InteractionListener() {
|
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 miningObstacle = 7158
|
||||||
val agilityObstacle = 7164
|
val agilityObstacle = 7164
|
||||||
|
val passage = 7154
|
||||||
|
|
||||||
override fun defineListeners() {
|
override fun defineListeners() {
|
||||||
definePlugin(AbyssalNPC())
|
definePlugin(AbyssalNPC())
|
||||||
@@ -62,6 +63,11 @@ class AbyssPlugin : InteractionListener() {
|
|||||||
obstacle!!.handle(player, node as Scenery)
|
obstacle!!.handle(player, node as Scenery)
|
||||||
return@on true
|
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
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user