Files
2009scape/Server/src/main/kotlin/rs09/game/content/dialogue/BankDepositDialogue.kt
T

57 lines
1.5 KiB
Kotlin

package rs09.game.content.dialogue
import api.*
import core.game.content.dialogue.DialoguePlugin
import core.game.node.entity.player.Player
import core.plugin.Initializable
import rs09.tools.START_DIALOGUE
/**
* Represents the dialogue shown when the user presses
* "Deposit Beast of Burden" button on the Bank Interface.
*
* @author vddCore
*/
class BankDepositDialogue : DialogueFile() {
override fun handle(componentID: Int, buttonID: Int) {
when (stage) {
START_DIALOGUE -> options(
"Deposit Inventory",
"Deposit Worn Equipment",
"Deposit Beast of Burden",
"Cancel"
).also { stage++ }
1 -> when (buttonID) {
1 -> player?.let {
end()
if (it.inventory.isEmpty) {
sendMessage(it, "You have nothing in your inventory that you can deposit.")
} else {
dumpContainer(it, it.inventory)
}
}
2 -> player?.let {
end()
if (it.equipment.isEmpty) {
sendMessage(it, "You have no equipment that you can deposit.")
} else {
dumpContainer(it, it.equipment)
}
}
3 -> player?.let {
end()
dumpBeastOfBurden(it)
}
4 -> end()
}
}
}
}