mirror of
https://gitlab.com/2009scape/2009scape.git
synced 2025-12-10 10:20:41 -07:00
added unique Zandar Horfyre NPC dialogue and interaction
This commit is contained in:
parent
9024987ed2
commit
545b5d33cf
3 changed files with 52 additions and 0 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -46,3 +46,4 @@ Management-Server/managementprops/
|
|||
/Development-Client/
|
||||
**/*.swp
|
||||
**/*.swo
|
||||
build/kotlin/sessions/
|
||||
|
|
|
|||
1
Server/.gitignore
vendored
1
Server/.gitignore
vendored
|
|
@ -16,6 +16,7 @@ data/players/**
|
|||
data/eco/offer_dispatch_db.emp
|
||||
/build/
|
||||
/build/kotlin/
|
||||
/build/kotlin/sessions/
|
||||
/build/classes/
|
||||
/build/generated/
|
||||
/build/tmp/
|
||||
|
|
|
|||
|
|
@ -0,0 +1,50 @@
|
|||
package rs09.game.content.dialogue
|
||||
|
||||
import api.teleport
|
||||
import core.game.content.dialogue.DialoguePlugin
|
||||
import core.game.content.dialogue.FacialExpression
|
||||
import core.game.node.entity.npc.NPC
|
||||
import core.game.node.entity.player.Player
|
||||
import core.game.node.entity.player.link.TeleportManager
|
||||
import core.game.world.map.Location
|
||||
import core.plugin.Initializable
|
||||
import rs09.tools.END_DIALOGUE
|
||||
|
||||
@Initializable
|
||||
class ZandarHorfyreDialogue(player: Player? = null) : DialoguePlugin(player) {
|
||||
|
||||
override fun newInstance(player: Player): DialoguePlugin {
|
||||
return ZandarHorfyreDialogue(player)
|
||||
}
|
||||
|
||||
override fun open(vararg args: Any?) : Boolean {
|
||||
npc = args[0] as NPC
|
||||
player(FacialExpression.HALF_THINKING,"Who are you?")
|
||||
stage = -1
|
||||
return true
|
||||
}
|
||||
|
||||
override fun handle(interfaceId: Int, buttonId: Int) : Boolean {
|
||||
when (stage) {
|
||||
-1 -> npcl(FacialExpression.NEUTRAL,"My name is Zandar Horfyre, and you ${ player.name } are trespassing in my tower, not to mention attacking my students! I thank you to leave immediately!").also{ stage++ }
|
||||
0 -> options("Ok, I was going anyway.", "No, I think I'll stay for a bit.").also{ stage++ }
|
||||
1 -> when(buttonId) {
|
||||
1 -> player("Ok, I was going anyway.").also{ stage = 10 }
|
||||
2 -> player("No, I think I'll stay for a bit.").also{ stage = 20 }
|
||||
}
|
||||
|
||||
10 -> npcl(FacialExpression.NEUTRAL,"Good! And don't forget to close the door behind you!").also{ stage++ }
|
||||
11 -> stage = END_DIALOGUE
|
||||
|
||||
20 -> npcl(FacialExpression.ANNOYED,"Actually, that wasn't an invitation. I've tried being polite, now we'll do it the hard way!").also{ teleport(player, Location.create(3217, 3177, 0), TeleportManager.TeleportType.INSTANT) }.also{ stage++ }
|
||||
21 -> player(FacialExpression.ANGRY, "Zamorak curse that mage!").also{ stage++ }
|
||||
22 -> player(FacialExpression.LAUGH, "Actually, I guess he already has!").also{ stage++ }
|
||||
23 -> end()
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
override fun getIds() : IntArray {
|
||||
return intArrayOf(3308)
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue