Unified and reimplemented various banker dialogues

Accessibility to second bank is now locked behind server config toggle second_bank
Eniola, Arnold Lydspor, and Emerald Benedict now offer access to second bank
Locked the backported ability to charge our ring of wealth with GE teleports behind server config toggle ring_of_wealth_teleport
Corrected enchant spells to always yield uncharged dragonstone items, rather than fully charged ones
Fixed inauthentic jewellery UI
Locked the availability of our inauthentic player commands behind server config toggle player_commands. Admins are immune to this and still always have all commands available. Note that this includes ::confirmrules, so be sure not to set your server to show rules and info, but not allow commands
This commit is contained in:
Player Name
2025-11-25 12:56:41 +00:00
committed by Ryan
parent 78f1c58b4e
commit 1fa2d3460f
20 changed files with 468 additions and 1014 deletions
@@ -1,120 +0,0 @@
package content.minigame.bountyhunter
import core.api.*
import core.game.dialogue.DialoguePlugin
import core.game.dialogue.FacialExpression
import core.game.node.entity.player.Player
import core.game.node.entity.player.link.IronmanMode
import core.plugin.Initializable
import org.rs09.consts.NPCs
import core.game.dialogue.IfTopic
import core.game.dialogue.Topic
import core.tools.END_DIALOGUE
import core.tools.START_DIALOGUE
/**
* Provides dialogue tree for Maximillian Sackville,
* the Bounty Hounter roving banker.
*
* @author vddCore
*/
@Initializable
class MaximillianSackvilleDialogue(player: Player? = null) : DialoguePlugin(player) {
override fun handle(interfaceId: Int, buttonId: Int): Boolean {
when (stage) {
START_DIALOGUE -> when {
hasIronmanRestriction(player, IronmanMode.ULTIMATE) -> {
npcl(
FacialExpression.NEUTRAL,
"My apologies, dear ${if (player.isMale) "sir" else "madam"}, " +
"our services are not available for Ultimate ${if (player.isMale) "Ironmen" else "Ironwomen"}."
).also { stage = END_DIALOGUE }
}
else -> {
npcl(
FacialExpression.NEUTRAL,
"Good day, how may I help you?"
).also {
if (hasAwaitingGrandExchangeCollections(player)) {
stage++
} else {
stage += 2
}
}
}
}
1 -> npcl(
FacialExpression.NEUTRAL,
"Before we go any further, I should inform you that you " +
"have items ready for collection from the Grand Exchange."
).also { stage++ }
2 -> playerl(
FacialExpression.ASKING,
"Who are you?"
).also { stage++ }
3 -> npcl(
FacialExpression.NEUTRAL,
"How inconsiderate of me, dear ${if (player.isMale) "sir" else "madam"}. " +
"My name is Maximillian Sackville and I conduct operations here on behalf " +
"of The Bank of Gielinor."
).also { stage++ }
4 -> showTopics(
Topic(FacialExpression.NEUTRAL, "I'd like to access my bank account.", 10),
IfTopic(
FacialExpression.NEUTRAL,
"I'd like to switch to my ${getBankAccountName(player, true)} bank account.",
11,
hasActivatedSecondaryBankAccount(player)
),
Topic(FacialExpression.NEUTRAL, "I'd like to check my PIN settings.", 12),
Topic(FacialExpression.NEUTRAL, "I'd like to collect items.", 13),
Topic(FacialExpression.ASKING, "Aren't you afraid of working in the Wilderness?", 5)
)
5 -> npcl(
FacialExpression.NEUTRAL,
"While the Wilderness is quite a dangerous place, The Bank of Gielinor offers " +
"us - roving bankers - extraordinary benefits for our hard work in hazardous environments."
).also { stage++ }
6 -> npcl(
FacialExpression.NEUTRAL,
"This allows us to provide our services to customers regardless of their current " +
"whereabouts. Our desire to serve is stronger than our fear of the Wilderness."
).also { stage = END_DIALOGUE }
10 -> {
openBankAccount(player)
end()
}
11 -> {
toggleBankAccount(player)
npcl(
FacialExpression.NEUTRAL,
"Naturally. You can now access your ${getBankAccountName(player)} bank account."
).also { stage = END_DIALOGUE }
}
12 -> {
openBankPinSettings(player)
end()
}
13 -> {
openGrandExchangeCollectionBox(player)
end()
}
}
return true
}
override fun getIds() = intArrayOf(NPCs.BANKER_6538)
}
@@ -1,6 +1,8 @@
package content.minigame.mta
import content.minigame.mta.impl.EnchantingZone.Shapes
import core.ServerConstants
import core.api.replaceSlot
import core.game.node.Node
import core.game.node.entity.Entity
import core.game.node.entity.combat.spell.SpellType
@@ -9,6 +11,8 @@ import core.game.node.entity.player.link.SpellBookManager.SpellBook
import core.game.node.entity.player.link.audio.Audio
import core.game.node.entity.combat.spell.MagicSpell
import core.game.node.entity.combat.spell.Runes
import core.game.node.entity.player.info.LogType
import core.game.node.entity.player.info.PlayerMonitor
import core.game.node.item.Item
import core.game.world.update.flag.context.Animation
import core.game.world.update.flag.context.Graphics
@@ -47,7 +51,7 @@ class EnchantSpell : MagicSpell {
return false
}
entity.interfaceManager.setViewedTab(6)
val enchanted = jewellery?.getOrDefault(target.id,null)
var enchanted = jewellery?.getOrDefault(target.id,null)
if (enchanted == null) {
entity.packetDispatch.sendMessage("You can't use this spell on this item.")
@@ -56,12 +60,15 @@ class EnchantSpell : MagicSpell {
if (!meetsRequirements(entity, true, true)) {
return false
}
if (entity.inventory.remove(target)) {
visualize(entity, target)
entity.inventory.add(enchanted)
if (enchanted.id == Items.RING_OF_WEALTH_2572 && ServerConstants.RING_OF_WEALTH_TELEPORT) {
enchanted = Item(Items.RING_OF_WEALTH_14638)
}
visualize(entity, target)
val ret = replaceSlot(entity, target.slot, enchanted)
if (ret != target) {
PlayerMonitor.log(entity, LogType.DUPE_ALERT, "Unknown slot-replacement problem when enchanting jewellery (adding $enchanted replaced $ret rather than $target)")
}
//MTA-Specific Code
if (entity.zoneMonitor.isInZone("Enchantment Chamber")) {
@@ -184,10 +191,10 @@ class EnchantSpell : MagicSpell {
SpellBook.MODERN.register(51, EnchantSpell(68, 78.0,
mapOf(
//Begin Jewelry Enchantment
Items.DRAGONSTONE_RING_1645 to Item(14646),
Items.DRAGON_NECKLACE_1664 to Item(Items.SKILLS_NECKLACE4_11105),
Items.DRAGONSTONE_AMMY_1702 to Item(Items.AMULET_OF_GLORY4_1712),
Items.DRAGON_BRACELET_11115 to Item(Items.COMBAT_BRACELET4_11118),
Items.DRAGONSTONE_RING_1645 to Item(Items.RING_OF_WEALTH_2572),
Items.DRAGON_NECKLACE_1664 to Item(Items.SKILLS_NECKLACE_11113),
Items.DRAGONSTONE_AMMY_1702 to Item(Items.AMULET_OF_GLORY_1704),
Items.DRAGON_BRACELET_11115 to Item(Items.COMBAT_BRACELET_11126),
//Begin MTA-Specific Enchantments
Items.CUBE_6899 to Item(Items.ORB_6902),
Items.CYLINDER_6898 to Item(Items.ORB_6902),