mirror of
https://github.com/2006-Scape/2006Scape.git
synced 2026-07-02 16:49:03 +00:00
Update NPC Plugins Layout To Put Click Actions Per NPC Plugin
(cherry picked from commit 156d864bfd)
This commit is contained in:
+5
-8
@@ -1,4 +1,4 @@
|
||||
package plugin.click.npc
|
||||
package plugin.npc.banker
|
||||
|
||||
import com.rs2.event.EventContext
|
||||
import com.rs2.event.EventSubscriber
|
||||
@@ -12,24 +12,21 @@ import plugin.npc.manwoman.ManWomanDialogue
|
||||
|
||||
|
||||
@SubscribesTo(NpcFirstClickEvent::class)
|
||||
class NpcFirstClick : EventSubscriber<NpcFirstClickEvent> {
|
||||
class FirstClick : EventSubscriber<NpcFirstClickEvent> {
|
||||
|
||||
override fun subscribe(context: EventContext, player: Player, event: NpcFirstClickEvent) {
|
||||
|
||||
if (player.playerRights >= 3) {
|
||||
player.packetSender.sendMessage("[click= npc], [type = first], [id= ${event.npc}], [Type= ${event.npc}]");
|
||||
player.packetSender.sendMessage("[click= npc], [type = first], [id= ${event.npc}], [Type= ${event.npc}]")
|
||||
}
|
||||
|
||||
when(event.npc) {
|
||||
|
||||
// Man or Woman
|
||||
1,2,3,4,5,6 -> player.dialogueFactory.sendDialogue(ManWomanDialogue(Misc.random(22)))
|
||||
|
||||
// Banker (NOT INCLUDING GHOST BANKER IN PORT PHASMATYS)
|
||||
166, 494, 495, 496, 497, 498, 499, 953, 1036, 1360, 2163, 2164, 2354, 2355, 2568, 2569, 2570 ->
|
||||
166, 494, 495, 496, 497, 498, 499, 953, 1036, 1360, 2163, 2164, 2354, 2355, 2568, 2569, 2570 -> {
|
||||
if (!SkillHandler.isSkilling(player)) {
|
||||
player.dialogueFactory.sendDialogue(BankerDialogue())
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package plugin.npc.manwoman
|
||||
|
||||
import com.rs2.event.EventContext
|
||||
import com.rs2.event.EventSubscriber
|
||||
import com.rs2.event.SubscribesTo
|
||||
import com.rs2.event.impl.NpcFirstClickEvent
|
||||
import com.rs2.game.content.skills.SkillHandler
|
||||
import com.rs2.game.players.Player
|
||||
import com.rs2.util.Misc
|
||||
import plugin.npc.banker.BankerDialogue
|
||||
import plugin.npc.manwoman.ManWomanDialogue
|
||||
|
||||
|
||||
@SubscribesTo(NpcFirstClickEvent::class)
|
||||
class FirstClick : EventSubscriber<NpcFirstClickEvent> {
|
||||
|
||||
override fun subscribe(context: EventContext, player: Player, event: NpcFirstClickEvent) {
|
||||
|
||||
if (player.playerRights >= 3) {
|
||||
player.packetSender.sendMessage("[click= npc], [type = first], [id= ${event.npc}], [Type= ${event.npc}]")
|
||||
}
|
||||
|
||||
when(event.npc) {
|
||||
// Man or Woman
|
||||
1,2,3,4,5,6 -> player.dialogueFactory.sendDialogue(ManWomanDialogue(Misc.random(22)))
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -13,7 +13,7 @@ class ManWomanDialogue(private val randomDialogue: Int) : DialoguePlugin() {
|
||||
override fun sendDialogues(factory: DialogueFactoryPlugin) {
|
||||
|
||||
// Since Man and Woman NPCs provide a random dialogue every interaction, use a switch statement
|
||||
// There are 23 dialogues, but a random number is rolled between 0 and 22 in the NpcFirstClick.kt file
|
||||
// There are 23 dialogues, but a random number is rolled between 0 and 22 in the FirstClick.kt file
|
||||
// as part of the calling process
|
||||
when(randomDialogue) {
|
||||
0 ->
|
||||
|
||||
Reference in New Issue
Block a user