diff --git a/Server/src/main/content/region/asgarnia/portsarim/handlers/SeamanListener.kt b/Server/src/main/content/region/asgarnia/portsarim/handlers/SeamanListener.kt new file mode 100644 index 000000000..104d86c3b --- /dev/null +++ b/Server/src/main/content/region/asgarnia/portsarim/handlers/SeamanListener.kt @@ -0,0 +1,15 @@ +package content.region.asgarnia.portsarim.handlers + +import core.game.interaction.IntType +import core.game.interaction.InteractionListener +import core.game.node.entity.npc.NPC + +class SeamanListener : InteractionListener { + override fun defineListeners() { + on(IntType.NPC, "pay-fare") { player, node -> + val npc = node as NPC + player.dialogueInterpreter.open(npc.id, npc, true) + return@on true + } + } +} \ No newline at end of file diff --git a/Server/src/main/content/region/asgarnia/portsarim/handlers/SeamanPlugin.java b/Server/src/main/content/region/asgarnia/portsarim/handlers/SeamanPlugin.java deleted file mode 100644 index e2c6ed29f..000000000 --- a/Server/src/main/content/region/asgarnia/portsarim/handlers/SeamanPlugin.java +++ /dev/null @@ -1,31 +0,0 @@ -package content.region.asgarnia.portsarim.handlers; - -import core.cache.def.impl.NPCDefinition; -import core.game.interaction.OptionHandler; -import core.game.node.Node; -import core.game.node.entity.npc.NPC; -import core.game.node.entity.player.Player; -import core.plugin.Initializable; -import core.plugin.Plugin; - -/** - * Represents a plugin used to handle the pay fare option. - * @author 'Vexia - */ -@Initializable -public class SeamanPlugin extends OptionHandler { - - @Override - public Plugin newInstance(Object arg) throws Throwable { - NPCDefinition.setOptionHandler("pay-fare", this); - return this; - } - - @Override - public boolean handle(Player player, Node node, String option) { - final NPC npc = ((NPC) node); - player.getDialogueInterpreter().open(npc.getId(), npc, true); - return true; - } - -}