mirror of
https://gitlab.com/2009scape/2009scape.git
synced 2025-12-16 11:30:17 -07:00
Merged listener types into just InteractionListener.kt
This commit is contained in:
parent
866962ff2b
commit
159bd80e90
21 changed files with 63 additions and 86 deletions
|
|
@ -8,7 +8,7 @@ import core.game.node.item.Item
|
||||||
import core.game.system.task.Pulse
|
import core.game.system.task.Pulse
|
||||||
import core.game.world.update.flag.context.Animation
|
import core.game.world.update.flag.context.Animation
|
||||||
import org.rs09.consts.Items
|
import org.rs09.consts.Items
|
||||||
import rs09.game.interaction.OptionListener
|
import rs09.game.interaction.InteractionListener
|
||||||
import rs09.game.world.GameWorld
|
import rs09.game.world.GameWorld
|
||||||
|
|
||||||
private val VALID_LOGS = intArrayOf(Items.LOGS_1511, Items.OAK_LOGS_1521,Items.WILLOW_LOGS_1519,Items.MAPLE_LOGS_1517,Items.YEW_LOGS_1515,Items.MAGIC_LOGS_1513)
|
private val VALID_LOGS = intArrayOf(Items.LOGS_1511, Items.OAK_LOGS_1521,Items.WILLOW_LOGS_1519,Items.MAPLE_LOGS_1517,Items.YEW_LOGS_1515,Items.MAGIC_LOGS_1513)
|
||||||
|
|
@ -19,7 +19,7 @@ private val LIGHT_ANIM = Animation(7307)
|
||||||
* Handles interactions for beacons
|
* Handles interactions for beacons
|
||||||
* @author Ceikry
|
* @author Ceikry
|
||||||
*/
|
*/
|
||||||
class AFUBeaconListeners : OptionListener(){
|
class AFUBeaconListeners : InteractionListener(){
|
||||||
|
|
||||||
override fun defineListeners() {
|
override fun defineListeners() {
|
||||||
on(OBJECT,"add-logs","light"){player,node ->
|
on(OBJECT,"add-logs","light"){player,node ->
|
||||||
|
|
|
||||||
|
|
@ -9,14 +9,14 @@ import core.game.world.map.Direction
|
||||||
import core.game.world.map.Location
|
import core.game.world.map.Location
|
||||||
import core.game.world.update.flag.context.Animation
|
import core.game.world.update.flag.context.Animation
|
||||||
import org.rs09.consts.Items
|
import org.rs09.consts.Items
|
||||||
import rs09.game.interaction.OptionListener
|
import rs09.game.interaction.InteractionListener
|
||||||
import java.util.*
|
import java.util.*
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handles repairing and climbing of the 3 beacon shortcuts needed to access them
|
* Handles repairing and climbing of the 3 beacon shortcuts needed to access them
|
||||||
* @author Ceikry
|
* @author Ceikry
|
||||||
*/
|
*/
|
||||||
class AFURepairClimbHandler : OptionListener() {
|
class AFURepairClimbHandler : InteractionListener() {
|
||||||
|
|
||||||
val repairIDs = intArrayOf(38480,38470,38494)
|
val repairIDs = intArrayOf(38480,38470,38494)
|
||||||
val climbIDs = intArrayOf(38469,38471,38486,38481,38469)
|
val climbIDs = intArrayOf(38469,38471,38486,38481,38469)
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ import core.game.world.map.Location
|
||||||
import core.game.world.update.flag.context.Animation
|
import core.game.world.update.flag.context.Animation
|
||||||
import core.plugin.Initializable
|
import core.plugin.Initializable
|
||||||
import org.rs09.consts.Items
|
import org.rs09.consts.Items
|
||||||
import rs09.game.interaction.OptionListener
|
import rs09.game.interaction.InteractionListener
|
||||||
import rs09.game.node.entity.player.info.stats.FISHING_TRAWLER_LEAKS_PATCHED
|
import rs09.game.node.entity.player.info.stats.FISHING_TRAWLER_LEAKS_PATCHED
|
||||||
import rs09.game.node.entity.player.info.stats.STATS_BASE
|
import rs09.game.node.entity.player.info.stats.STATS_BASE
|
||||||
import rs09.tools.stringtools.colorize
|
import rs09.tools.stringtools.colorize
|
||||||
|
|
@ -22,7 +22,7 @@ import kotlin.math.ceil
|
||||||
* Option handler for fishing trawler
|
* Option handler for fishing trawler
|
||||||
* @author Ceikry
|
* @author Ceikry
|
||||||
*/
|
*/
|
||||||
class FishingTrawlerOptionHandler : OptionListener() {
|
class FishingTrawlerInteractionHandler : InteractionListener() {
|
||||||
val ENTRANCE_PLANK = 2178
|
val ENTRANCE_PLANK = 2178
|
||||||
val EXIT_PLANK = 2179
|
val EXIT_PLANK = 2179
|
||||||
val HOLE = 2167
|
val HOLE = 2167
|
||||||
|
|
@ -10,7 +10,7 @@ import core.game.system.task.Pulse
|
||||||
import core.game.world.map.zone.ZoneBorders
|
import core.game.world.map.zone.ZoneBorders
|
||||||
import core.plugin.Plugin
|
import core.plugin.Plugin
|
||||||
import org.rs09.consts.Items
|
import org.rs09.consts.Items
|
||||||
import rs09.game.interaction.OptionListener
|
import rs09.game.interaction.InteractionListener
|
||||||
import rs09.game.system.config.ItemConfigParser
|
import rs09.game.system.config.ItemConfigParser
|
||||||
import rs09.game.world.GameWorld
|
import rs09.game.world.GameWorld
|
||||||
|
|
||||||
|
|
@ -19,7 +19,7 @@ import rs09.game.world.GameWorld
|
||||||
* @author Ceikry
|
* @author Ceikry
|
||||||
* @author Woah
|
* @author Woah
|
||||||
*/
|
*/
|
||||||
class EquipHandler : OptionListener() {
|
class EquipHandler : InteractionListener() {
|
||||||
|
|
||||||
override fun defineListeners() {
|
override fun defineListeners() {
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,13 +7,13 @@ import core.game.node.entity.player.Player
|
||||||
import core.game.node.entity.player.link.diary.DiaryType
|
import core.game.node.entity.player.link.diary.DiaryType
|
||||||
import core.game.node.item.Item
|
import core.game.node.item.Item
|
||||||
import org.rs09.consts.Items
|
import org.rs09.consts.Items
|
||||||
import rs09.game.interaction.OptionListener
|
import rs09.game.interaction.InteractionListener
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handles the work-for actions for the NPCs
|
* Handles the work-for actions for the NPCs
|
||||||
* @author Ceikry
|
* @author Ceikry
|
||||||
*/
|
*/
|
||||||
class WorkForOptionListener : OptionListener() {
|
class WorkForInteractionListener : InteractionListener() {
|
||||||
val possibleWeaponLooks = arrayListOf(
|
val possibleWeaponLooks = arrayListOf(
|
||||||
Items.BRONZE_SCIMITAR_1321,
|
Items.BRONZE_SCIMITAR_1321,
|
||||||
Items.STEEL_SCIMITAR_1325,
|
Items.STEEL_SCIMITAR_1325,
|
||||||
|
|
@ -7,7 +7,7 @@ import core.game.system.task.Pulse
|
||||||
import core.game.world.map.Location
|
import core.game.world.map.Location
|
||||||
import core.game.world.update.flag.context.Animation
|
import core.game.world.update.flag.context.Animation
|
||||||
import org.rs09.consts.Items
|
import org.rs09.consts.Items
|
||||||
import rs09.game.interaction.OptionListener
|
import rs09.game.interaction.InteractionListener
|
||||||
import rs09.game.world.GameWorld.Pulser
|
import rs09.game.world.GameWorld.Pulser
|
||||||
|
|
||||||
private const val LOADER = 11162
|
private const val LOADER = 11162
|
||||||
|
|
@ -20,7 +20,7 @@ private val FILL_ANIM = Animation(1649)
|
||||||
private val WIND_ANIM = Animation(1648)
|
private val WIND_ANIM = Animation(1648)
|
||||||
private val SCOOP_ANIM = Animation(1650)
|
private val SCOOP_ANIM = Animation(1650)
|
||||||
|
|
||||||
class BoneGrinderListener : OptionListener() {
|
class BoneGrinderListener : InteractionListener() {
|
||||||
|
|
||||||
override fun defineListeners() {
|
override fun defineListeners() {
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ package rs09.game.interaction
|
||||||
import core.game.node.Node
|
import core.game.node.Node
|
||||||
import core.game.node.entity.player.Player
|
import core.game.node.entity.player.Player
|
||||||
|
|
||||||
abstract class OptionListener : Listener{
|
abstract class InteractionListener : Listener{
|
||||||
val ITEM = 0
|
val ITEM = 0
|
||||||
val OBJECT = 1
|
val OBJECT = 1
|
||||||
val NPC = 2
|
val NPC = 2
|
||||||
|
|
@ -19,4 +19,10 @@ abstract class OptionListener : Listener{
|
||||||
fun on(type: Int, vararg option: String, handler: (Player, Node) -> Boolean){
|
fun on(type: Int, vararg option: String, handler: (Player, Node) -> Boolean){
|
||||||
Listeners.add(option,type,handler)
|
Listeners.add(option,type,handler)
|
||||||
}
|
}
|
||||||
|
fun on(used: Int, with: Int, type: Int, handler: (Player, Node, Node) -> Boolean){
|
||||||
|
Listeners.add(used,with,type,handler)
|
||||||
|
}
|
||||||
|
fun on(type: Int,used: Int,vararg with: Int, handler: (Player, Node, Node) -> Boolean){
|
||||||
|
Listeners.add(type,used,with,handler)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,16 +0,0 @@
|
||||||
package rs09.game.interaction
|
|
||||||
|
|
||||||
import core.game.node.Node
|
|
||||||
import core.game.node.entity.player.Player
|
|
||||||
|
|
||||||
abstract class UseWithListener : Listener {
|
|
||||||
val ITEM = 0
|
|
||||||
val OBJECT = 1
|
|
||||||
val NPC = 2
|
|
||||||
fun on(used: Int, with: Int, type: Int, handler: (Player, Node, Node) -> Boolean){
|
|
||||||
Listeners.add(used,with,type,handler)
|
|
||||||
}
|
|
||||||
fun on(type: Int,used: Int,vararg with: Int, handler: (Player, Node, Node) -> Boolean){
|
|
||||||
Listeners.add(type,used,with,handler)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
package rs09.game.interaction.city
|
package rs09.game.interaction.city
|
||||||
|
|
||||||
import core.game.world.map.Location
|
import core.game.world.map.Location
|
||||||
import rs09.game.interaction.OptionListener
|
import rs09.game.interaction.InteractionListener
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* File to be used for anything Isafdar related.
|
* File to be used for anything Isafdar related.
|
||||||
|
|
@ -9,7 +9,7 @@ import rs09.game.interaction.OptionListener
|
||||||
* @author Sir Kermit
|
* @author Sir Kermit
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class IsafdarListeners : OptionListener() {
|
class IsafdarListeners : InteractionListener() {
|
||||||
|
|
||||||
val CAVE_ENTRANCE = 4006
|
val CAVE_ENTRANCE = 4006
|
||||||
val CAVE_EXIT = 4007
|
val CAVE_EXIT = 4007
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import core.game.node.entity.impl.ForceMovement
|
||||||
import core.game.world.map.Direction
|
import core.game.world.map.Direction
|
||||||
import core.game.world.map.Location
|
import core.game.world.map.Location
|
||||||
import core.game.world.update.flag.context.Animation
|
import core.game.world.update.flag.context.Animation
|
||||||
import rs09.game.interaction.OptionListener
|
import rs09.game.interaction.InteractionListener
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* File to be used for anything Morytania related.
|
* File to be used for anything Morytania related.
|
||||||
|
|
@ -12,7 +12,7 @@ import rs09.game.interaction.OptionListener
|
||||||
* @author Sir Kermit
|
* @author Sir Kermit
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class MorytaniaListeners : OptionListener() {
|
class MorytaniaListeners : InteractionListener() {
|
||||||
|
|
||||||
val GROTTO_ENTRANCE = 3516
|
val GROTTO_ENTRANCE = 3516
|
||||||
val GROTTO_EXIT = 3526
|
val GROTTO_EXIT = 3526
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,12 @@
|
||||||
package rs09.game.interaction.item
|
package rs09.game.interaction.item
|
||||||
|
|
||||||
import rs09.game.interaction.OptionListener
|
import rs09.game.interaction.InteractionListener
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handles the bracelet of clay operate option.
|
* Handles the bracelet of clay operate option.
|
||||||
* @author Ceikry
|
* @author Ceikry
|
||||||
*/
|
*/
|
||||||
class BraceletOfClayPlugin : OptionListener() {
|
class BraceletOfClayPlugin : InteractionListener() {
|
||||||
|
|
||||||
val BRACELET = 11074
|
val BRACELET = 11074
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,14 +2,14 @@ package rs09.game.interaction.item
|
||||||
|
|
||||||
import core.game.content.global.EnchantedJewellery
|
import core.game.content.global.EnchantedJewellery
|
||||||
import rs09.game.content.global.EnchantedJewelleryDialogueFile
|
import rs09.game.content.global.EnchantedJewelleryDialogueFile
|
||||||
import rs09.game.interaction.OptionListener
|
import rs09.game.interaction.InteractionListener
|
||||||
import java.util.*
|
import java.util.*
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Listener for enchanted jewellery options
|
* Listener for enchanted jewellery options
|
||||||
* @author Ceikry
|
* @author Ceikry
|
||||||
*/
|
*/
|
||||||
class EnchantedJewelleryListener : OptionListener() {
|
class EnchantedJewelleryListener : InteractionListener() {
|
||||||
val IDs: IntArray
|
val IDs: IntArray
|
||||||
|
|
||||||
init {
|
init {
|
||||||
|
|
|
||||||
|
|
@ -4,18 +4,19 @@ import core.game.node.entity.player.link.diary.DiaryType
|
||||||
import core.game.node.item.Item
|
import core.game.node.item.Item
|
||||||
import core.game.world.map.zone.ZoneBorders
|
import core.game.world.map.zone.ZoneBorders
|
||||||
import org.rs09.consts.Items
|
import org.rs09.consts.Items
|
||||||
import rs09.game.interaction.OptionListener
|
import rs09.game.interaction.InteractionListener
|
||||||
import rs09.game.interaction.UseWithListener
|
|
||||||
import java.util.*
|
import java.util.*
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handles coal truck interactions
|
* Handles coal truck interactions
|
||||||
* @author ceik
|
* @author ceik
|
||||||
*/
|
*/
|
||||||
class CoalTrucksHandler : OptionListener() {
|
class CoalTruckInteractionListeners : InteractionListener() {
|
||||||
|
|
||||||
val SEERS_VILLAGE_COAL_TRUCK_2114 = 2114
|
val SEERS_VILLAGE_COAL_TRUCK_2114 = 2114
|
||||||
val seersVillageTrucks = ZoneBorders(2690,3502,2699,3508)
|
val seersVillageTrucks = ZoneBorders(2690,3502,2699,3508)
|
||||||
|
val COAL_TRUCK_2114 = 2114
|
||||||
|
val COAL = Items.COAL_453
|
||||||
|
|
||||||
override fun defineListeners() {
|
override fun defineListeners() {
|
||||||
on(SEERS_VILLAGE_COAL_TRUCK_2114, OBJECT, "remove-coal") { player, node ->
|
on(SEERS_VILLAGE_COAL_TRUCK_2114, OBJECT, "remove-coal") { player, node ->
|
||||||
|
|
@ -52,38 +53,28 @@ class CoalTrucksHandler : OptionListener() {
|
||||||
player.dialogueInterpreter.sendDialogue("There is currently $coalInTruck coal in the truck.", "The truck has space for " + (120 - coalInTruck) + " more coal.")
|
player.dialogueInterpreter.sendDialogue("There is currently $coalInTruck coal in the truck.", "The truck has space for " + (120 - coalInTruck) + " more coal.")
|
||||||
return@on true
|
return@on true
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
//TODO:
|
on(COAL,COAL_TRUCK_2114,OBJECT){player,_,_ ->
|
||||||
class CoalTruckListener : UseWithListener() {
|
var coalInTruck = player.getAttribute("coal-truck-inventory", 0)
|
||||||
val COAL_TRUCK_2114 = 2114
|
|
||||||
val COAL = Items.COAL_453
|
|
||||||
|
|
||||||
override fun defineListeners() {
|
var coalInInventory = player.inventory.getAmount(Items.COAL_453)
|
||||||
|
|
||||||
on(COAL,COAL_TRUCK_2114,OBJECT){player,_,_ ->
|
if(coalInInventory + coalInTruck >= 120){
|
||||||
var coalInTruck = player.getAttribute("coal-truck-inventory", 0)
|
coalInInventory = 120 - coalInTruck
|
||||||
|
player.packetDispatch.sendMessage("You have filled up the coal truck.")
|
||||||
|
|
||||||
var coalInInventory = player.inventory.getAmount(Items.COAL_453)
|
//handle coal truck task for seer's village
|
||||||
|
if (!player.achievementDiaryManager.getDiary(DiaryType.SEERS_VILLAGE).isComplete(1, 2)
|
||||||
if(coalInInventory + coalInTruck >= 120){
|
&& player.viewport.region.id == 10294) { // region 10294 is at coal truck mine, region 10806 is in seers village
|
||||||
coalInInventory = 120 - coalInTruck
|
player.setAttribute("/save:diary:seers:coal-truck-full", true)
|
||||||
player.packetDispatch.sendMessage("You have filled up the coal truck.")
|
|
||||||
|
|
||||||
//handle coal truck task for seer's village
|
|
||||||
if (!player.achievementDiaryManager.getDiary(DiaryType.SEERS_VILLAGE).isComplete(1, 2)
|
|
||||||
&& player.viewport.region.id == 10294) { // region 10294 is at coal truck mine, region 10806 is in seers village
|
|
||||||
player.setAttribute("/save:diary:seers:coal-truck-full", true)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
player.inventory.remove(Item(Items.COAL_453,coalInInventory))
|
|
||||||
coalInTruck += coalInInventory
|
|
||||||
|
|
||||||
player.setAttribute("/save:coal-truck-inventory",coalInTruck)
|
|
||||||
return@on true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
player.inventory.remove(Item(Items.COAL_453,coalInInventory))
|
||||||
|
coalInTruck += coalInInventory
|
||||||
|
|
||||||
|
player.setAttribute("/save:coal-truck-inventory",coalInTruck)
|
||||||
|
return@on true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -3,14 +3,14 @@ package rs09.game.interaction.`object`
|
||||||
import core.game.node.entity.player.link.diary.DiaryType
|
import core.game.node.entity.player.link.diary.DiaryType
|
||||||
import core.game.node.entity.player.link.emote.Emotes
|
import core.game.node.entity.player.link.emote.Emotes
|
||||||
import core.game.world.map.RegionManager
|
import core.game.world.map.RegionManager
|
||||||
import rs09.game.interaction.OptionListener
|
import rs09.game.interaction.InteractionListener
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handles taunting of the demon in the wizard's tower
|
* Handles taunting of the demon in the wizard's tower
|
||||||
* @author afaroutdude / Ceikry
|
* @author afaroutdude / Ceikry
|
||||||
*/
|
*/
|
||||||
private const val BARS = 37668
|
private const val BARS = 37668
|
||||||
class DemonTauntHandler : OptionListener(){
|
class DemonTauntHandler : InteractionListener(){
|
||||||
|
|
||||||
override fun defineListeners() {
|
override fun defineListeners() {
|
||||||
on(BARS,OBJECT,"taunt-through"){player,_ ->
|
on(BARS,OBJECT,"taunt-through"){player,_ ->
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import core.game.component.Component
|
||||||
import core.game.node.entity.player.Player
|
import core.game.node.entity.player.Player
|
||||||
import core.game.node.entity.player.link.TeleportManager.TeleportType
|
import core.game.node.entity.player.link.TeleportManager.TeleportType
|
||||||
import core.game.world.map.Location
|
import core.game.world.map.Location
|
||||||
import rs09.game.interaction.OptionListener
|
import rs09.game.interaction.InteractionListener
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handles interactions with fairy rings
|
* Handles interactions with fairy rings
|
||||||
|
|
@ -15,7 +15,7 @@ private val RINGS = intArrayOf(12003, 12094, 12095, 14058, 14061, 14064, 14067,
|
||||||
private const val MAIN_RING = 12128
|
private const val MAIN_RING = 12128
|
||||||
|
|
||||||
|
|
||||||
class FairyRingPlugin : OptionListener() {
|
class FairyRingPlugin : InteractionListener() {
|
||||||
|
|
||||||
override fun defineListeners() {
|
override fun defineListeners() {
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,12 +9,12 @@ import core.game.node.item.Item
|
||||||
import core.game.system.task.Pulse
|
import core.game.system.task.Pulse
|
||||||
import core.game.world.update.flag.context.Animation
|
import core.game.world.update.flag.context.Animation
|
||||||
import org.rs09.consts.Items
|
import org.rs09.consts.Items
|
||||||
import rs09.game.interaction.OptionListener
|
import rs09.game.interaction.InteractionListener
|
||||||
import rs09.game.world.GameWorld
|
import rs09.game.world.GameWorld
|
||||||
import java.util.concurrent.TimeUnit
|
import java.util.concurrent.TimeUnit
|
||||||
|
|
||||||
private const val CHEST = 2827
|
private const val CHEST = 2827
|
||||||
class GutanothChestOptionHandler : OptionListener(){
|
class GutanothChestInteractionHandler : InteractionListener(){
|
||||||
|
|
||||||
override fun defineListeners() {
|
override fun defineListeners() {
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,14 +7,14 @@ import core.game.node.item.Item
|
||||||
import core.game.system.task.Pulse
|
import core.game.system.task.Pulse
|
||||||
import core.game.world.update.flag.context.Animation
|
import core.game.world.update.flag.context.Animation
|
||||||
import org.rs09.consts.Items
|
import org.rs09.consts.Items
|
||||||
import rs09.game.interaction.OptionListener
|
import rs09.game.interaction.InteractionListener
|
||||||
import rs09.game.world.GameWorld
|
import rs09.game.world.GameWorld
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handles the chopping down of dense jungle, mainly to grant access to the Kharazi Jungle.
|
* Handles the chopping down of dense jungle, mainly to grant access to the Kharazi Jungle.
|
||||||
* @author Ceikry
|
* @author Ceikry
|
||||||
*/
|
*/
|
||||||
class JungleBushHandler : OptionListener(){
|
class JungleBushHandler : InteractionListener(){
|
||||||
val chopped_bush = 2895
|
val chopped_bush = 2895
|
||||||
val chop_a = Animation(910)
|
val chop_a = Animation(910)
|
||||||
val chop_b = Animation(2382)
|
val chop_b = Animation(2382)
|
||||||
|
|
|
||||||
|
|
@ -6,13 +6,13 @@ import core.game.node.item.GroundItemManager
|
||||||
import core.game.node.item.Item
|
import core.game.node.item.Item
|
||||||
import core.game.world.update.flag.context.Animation
|
import core.game.world.update.flag.context.Animation
|
||||||
import org.rs09.consts.Items
|
import org.rs09.consts.Items
|
||||||
import rs09.game.interaction.OptionListener
|
import rs09.game.interaction.InteractionListener
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handles the muddy chest
|
* Handles the muddy chest
|
||||||
* @author Ceikry
|
* @author Ceikry
|
||||||
*/
|
*/
|
||||||
class MuddyChestHandler : OptionListener() {
|
class MuddyChestHandler : InteractionListener() {
|
||||||
|
|
||||||
private val CHEST = 170
|
private val CHEST = 170
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import core.game.node.`object`.ObjectBuilder
|
||||||
import core.game.node.item.Item
|
import core.game.node.item.Item
|
||||||
import core.tools.RandomFunction
|
import core.tools.RandomFunction
|
||||||
import org.rs09.consts.Items
|
import org.rs09.consts.Items
|
||||||
import rs09.game.interaction.OptionListener
|
import rs09.game.interaction.InteractionListener
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Woah, with love
|
* @author Woah, with love
|
||||||
|
|
@ -15,7 +15,7 @@ import rs09.game.interaction.OptionListener
|
||||||
* Option(s):
|
* Option(s):
|
||||||
* "Take-from"
|
* "Take-from"
|
||||||
*/
|
*/
|
||||||
class TarBarrelListener : OptionListener() {
|
class TarBarrelListener : InteractionListener() {
|
||||||
|
|
||||||
val FULL_TAR_BARREL_16860 = 16860
|
val FULL_TAR_BARREL_16860 = 16860
|
||||||
val EMPTY_TAR_BARREL_16688 = 16688
|
val EMPTY_TAR_BARREL_16688 = 16688
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
package rs09.game.node.entity.skill.fishing.barbfishing
|
package rs09.game.node.entity.skill.fishing.barbfishing
|
||||||
|
|
||||||
import core.game.node.item.Item
|
import core.game.node.item.Item
|
||||||
import rs09.game.interaction.OptionListener
|
import rs09.game.interaction.InteractionListener
|
||||||
|
|
||||||
class BarbFishOptionListeners : OptionListener() {
|
class BarbFishInteractionListeners : InteractionListener() {
|
||||||
override fun defineListeners() {
|
override fun defineListeners() {
|
||||||
|
|
||||||
on(25268,OBJECT,"search"){player,_ ->
|
on(25268,OBJECT,"search"){player,_ ->
|
||||||
|
|
@ -11,8 +11,7 @@ import core.plugin.PluginManifest
|
||||||
import core.plugin.PluginType
|
import core.plugin.PluginType
|
||||||
import io.github.classgraph.ClassGraph
|
import io.github.classgraph.ClassGraph
|
||||||
import io.github.classgraph.ClassInfo
|
import io.github.classgraph.ClassInfo
|
||||||
import rs09.game.interaction.OptionListener
|
import rs09.game.interaction.InteractionListener
|
||||||
import rs09.game.interaction.UseWithListener
|
|
||||||
import rs09.game.system.SystemLogger
|
import rs09.game.system.SystemLogger
|
||||||
import rs09.game.system.command.Command
|
import rs09.game.system.command.Command
|
||||||
import java.util.*
|
import java.util.*
|
||||||
|
|
@ -73,11 +72,8 @@ object PluginManager {
|
||||||
definePlugin(it.loadClass().newInstance() as Plugin<Command>).also { System.out.println("Initializing $it") }
|
definePlugin(it.loadClass().newInstance() as Plugin<Command>).also { System.out.println("Initializing $it") }
|
||||||
} catch (e: Exception) {e.printStackTrace()}
|
} catch (e: Exception) {e.printStackTrace()}
|
||||||
}
|
}
|
||||||
result.getSubclasses("rs09.game.interaction.OptionListener").forEach {
|
result.getSubclasses("rs09.game.interaction.InteractionListener").forEach {
|
||||||
(it.loadClass().newInstance() as OptionListener).defineListeners()
|
(it.loadClass().newInstance() as InteractionListener).defineListeners()
|
||||||
}
|
|
||||||
result.getSubclasses("rs09.game.interaction.UseWithListener").forEach {
|
|
||||||
(it.loadClass().newInstance() as UseWithListener).defineListeners()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue