From 514c86f4a60d12e8d580914ea4bd547c543cb4b6 Mon Sep 17 00:00:00 2001 From: Avi Weinstock Date: Mon, 24 Jan 2022 20:11:14 -0500 Subject: [PATCH] MTA fixes: - It is now possible to talk to the telekinetic guardian through the maze wall. - Asking for the price of an MTA reward no longer attempts to purchase said reward. - Graveyard bones now give the correct amount of bananas/peaches. - Number of telekinetic mazes solved now persist when exiting. --- .../main/java/core/game/content/activity/mta/MTAShop.java | 4 ++-- .../game/content/activity/mta/impl/TelekineticZone.java | 6 +----- .../kotlin/rs09/game/content/activity/mta/MTAListeners.kt | 6 +++++- .../rs09/game/node/entity/skill/magic/ModernListeners.kt | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Server/src/main/java/core/game/content/activity/mta/MTAShop.java b/Server/src/main/java/core/game/content/activity/mta/MTAShop.java index 4bafd5efe..e1e744ea6 100644 --- a/Server/src/main/java/core/game/content/activity/mta/MTAShop.java +++ b/Server/src/main/java/core/game/content/activity/mta/MTAShop.java @@ -241,9 +241,9 @@ public class MTAShop { if (item == null) { return true; } - if (opcode == 230) { + if (opcode == 155) { value(player, item, slot); - } else { + } else if (opcode == 196) { buy(player, item, slot); } return true; diff --git a/Server/src/main/java/core/game/content/activity/mta/impl/TelekineticZone.java b/Server/src/main/java/core/game/content/activity/mta/impl/TelekineticZone.java index cd9e9ea6a..c5888e7b6 100644 --- a/Server/src/main/java/core/game/content/activity/mta/impl/TelekineticZone.java +++ b/Server/src/main/java/core/game/content/activity/mta/impl/TelekineticZone.java @@ -122,11 +122,6 @@ public class TelekineticZone extends MTAZone { if (player == null || player != this.player) { return super.leave(entity, logout); } - if (logout) { - player.getSavedData().getActivityData().setSolvedMazes(solved); - } else { - player.getSavedData().getActivityData().setSolvedMazes(0); - } if (statue != null) { GroundItemManager.destroy(statue); } @@ -277,6 +272,7 @@ public class TelekineticZone extends MTAZone { } }); } + player.getSavedData().getActivityData().setSolvedMazes(solved); incrementPoints(player, MTAType.TELEKINETIC.ordinal(), points); TelekineticZone.this.update(player); player.setAttribute("camera", false); diff --git a/Server/src/main/kotlin/rs09/game/content/activity/mta/MTAListeners.kt b/Server/src/main/kotlin/rs09/game/content/activity/mta/MTAListeners.kt index fb3584176..54c9b13b2 100644 --- a/Server/src/main/kotlin/rs09/game/content/activity/mta/MTAListeners.kt +++ b/Server/src/main/kotlin/rs09/game/content/activity/mta/MTAListeners.kt @@ -2,6 +2,7 @@ package rs09.game.content.activity.mta import core.game.content.activity.mta.impl.AlchemistZone import core.game.node.item.Item +import core.game.world.map.Direction import core.game.world.update.flag.context.Animation import core.game.world.update.flag.context.Graphics import org.rs09.consts.Items @@ -16,6 +17,9 @@ class MTAListeners : InteractionListener() { player.dialogueInterpreter.open(node.id, node) return@on true } + setDest(NPC, intArrayOf(NPCs.MAZE_GUARDIAN_3102), "talk-to") { player, node -> + return@setDest node.location.transform(Direction.getDirection(player.location, node.location), -1); + } } } @@ -99,4 +103,4 @@ class MTASpellListeners : SpellListener("modern"){ } } -} \ No newline at end of file +} diff --git a/Server/src/main/kotlin/rs09/game/node/entity/skill/magic/ModernListeners.kt b/Server/src/main/kotlin/rs09/game/node/entity/skill/magic/ModernListeners.kt index 0f538b218..670f3bf60 100644 --- a/Server/src/main/kotlin/rs09/game/node/entity/skill/magic/ModernListeners.kt +++ b/Server/src/main/kotlin/rs09/game/node/entity/skill/magic/ModernListeners.kt @@ -154,7 +154,7 @@ class ModernListeners : SpellListener("modern"){ if(isInMTA){ if(bones.contains(item.id)){ val inInventory = player.inventory.getAmount(item.id) - val amount = inInventory * GraveyardZone.BoneType.forItem(Item(item.id)).ordinal + 1 + val amount = inInventory * (GraveyardZone.BoneType.forItem(Item(item.id)).ordinal + 1) if(amount > 0){ player.inventory.remove(Item(item.id,inInventory)) player.inventory.add(Item(if(bananas) Items.BANANA_1963 else Items.PEACH_6883,amount)) @@ -272,4 +272,4 @@ class ModernListeners : SpellListener("modern"){ addXP(player,30.0) setDelay(player,true) } -} \ No newline at end of file +}