Strange teleorb custom teleport item now only requires 2 Law runes per charge instead of 20

This commit is contained in:
randy 2025-03-12 09:52:19 -06:00
parent daf312ce6b
commit b109b98247

View file

@ -31,7 +31,8 @@ class SnowscapeTeleorb : InteractionListener {
val teleorb = 14534
// How many law runes are required for one teleport charge
val runesPerTeleport = 20
val runesPerTeleportNormal = 20
val runesPerTeleportBoosted = 2
override fun defineListeners() {
on(teleorb, IntType.ITEM, "inspect") { player, node ->
@ -49,6 +50,7 @@ class SnowscapeTeleorb : InteractionListener {
private fun activate(player: Player, node: Node) {
val charges = getAttribute(player, "teleorb:charges",0) as Int
var runesPerTeleport = if (getAttribute(player, "snowscape:boostedmode", false)) runesPerTeleportBoosted else runesPerTeleportNormal
if (charges >= runesPerTeleport) {
val destination = getAttribute(player, "teleorb:location", Location.create(3236,3218,0))
player.getTeleporter().send(destination, TeleportManager.TeleportType.ENTRANA_MAGIC_DOOR)
@ -69,7 +71,8 @@ class SnowscapeTeleorb : InteractionListener {
class SnowscapeTeleorbDialogue : DialogueFile() {
// How many law runes are required for one teleport charge
val runesPerTeleport = 20
val runesPerTeleportNormal = 20
val runesPerTeleportBoosted = 2
val teleorb = 14534
val lawRune = 563
@ -98,6 +101,7 @@ class SnowscapeTeleorbDialogue : DialogueFile() {
2 -> options("Recharge with Law Runes","Recharge with additional orbs").also {stage++}
3 -> player?.let {
end()
var runesPerTeleport = if (getAttribute(it, "snowscape:boostedmode", false)) runesPerTeleportBoosted else runesPerTeleportNormal
it.sendMessage("Current saved location: " + getAttribute(it, "teleorb:description", "Unknown").replace("_"," "))
it.sendMessage("Charges remaining: " + ((getAttribute(it, "teleorb:charges",0) as Int) / runesPerTeleport))
}
@ -105,6 +109,7 @@ class SnowscapeTeleorbDialogue : DialogueFile() {
2 -> when (buttonID) {
1 -> player?.let {
end()
var runesPerTeleport = if (getAttribute(it, "snowscape:boostedmode", false)) runesPerTeleportBoosted else runesPerTeleportNormal
sendInputDialogue(it, true, "Each charge requires $runesPerTeleport Law Runes. How many runes would you like to use?",) { value ->
var amount = kotlin.math.min(amountInInventory(it,lawRune), value as Int)
if (removeItem(it, Item(lawRune, amount))) {
@ -114,16 +119,17 @@ class SnowscapeTeleorbDialogue : DialogueFile() {
it.sendMessage("Current charges: " + ((getAttribute(it, "teleorb:charges",0) as Int) / runesPerTeleport))
it.graphics(Graphics(141,96))
it.animate(Animation(722))
playAudio(it, Sounds.LUNAR_EMBUE_RUNES_2888)
playAudio(it, Sounds.LUNAR_EMBUE_RUNES_2888) //Yes, Imbue is mispelled in the sounds list.
}
}
}
2 -> player?.let {
end()
var runesPerTeleport = if (getAttribute(it, "snowscape:boostedmode", false)) runesPerTeleportBoosted else runesPerTeleportNormal
sendInputDialogue(it, true, "Each additional orb adds one charge. How many would you like to use?",) { value ->
var amount = kotlin.math.min(amountInInventory(it,teleorb) - 1, value as Int)
if (amount > 0 && removeItem(it, Item(teleorb, amount))) {
it.sendMessage("You destroy $amount teleorbs, fusing their energy into one")
it.sendMessage("You destroy $amount teleorbs, fusing their energy into one.")
amount = amount * runesPerTeleport
amount += (getAttribute(it, "teleorb:charges",0) as Int)
setAttribute(it, "/save:teleorb:charges", amount)