RuneHive-Game
Loading...
Searching...
No Matches
FirstNpcOptionEvent.kt
Go to the documentation of this file.
1package org.jire.runehiveps.event.npc
2
3import com.runehive.content.event.impl.FirstNpcClick
4import com.runehive.game.world.entity.mob.npc.Npc
5import com.runehive.game.world.entity.mob.player.Player
6
7/**
8 * @author Jire
9 */
10class FirstNpcOptionEvent(slot: Int) : NpcOptionEvent(slot, 0) {
11
12 override fun handleNpc(player: Player, npc: Npc) {
13 if (npc.id == 394 && player.position.isWithinDistance(npc.position, 2)) {
14 publishToPluginManager(player, npc)
15 } else {
16 super.handleNpc(player, npc)
17 }
18 }
19
20 override fun createInteractionEvent(npc: Npc) = FirstNpcClick(npc)
21
22}