From abe55aa7f3c5a5f532e45f608f17bde422dece7e Mon Sep 17 00:00:00 2001 From: Zerken Date: Fri, 1 Sep 2023 12:11:16 +0000 Subject: [PATCH] Shops will no longer charge if inventory is full The ::shop can no longer be opened if the player is movement or interaction locked Rogues now drop the proper coin Rewrote the canoe station chop down as a soft script to be uninterruptible Fixed the player locks for Rellekka trapped chest and better handled the case when inventory is full Corrected the examine text of the armadyl plateskirt Fixed the dialogue for lady of the lake The player is now locked and can't interrupt stepping stone shortcuts --- Server/data/botdata/bot_dialogue.json | 2 -- Server/data/configs/drop_tables.json | 4 ++-- Server/data/configs/item_configs.json | 2 +- .../shortcuts/SteppingStoneShortcut.kt | 21 ++++++++++++------- .../skill/thieving/ThievableChestPlugin.java | 12 ++++++----- .../travel/canoe/CanoeStationListener.kt | 17 +++++++-------- .../quest/merlinsquest/TheLadyOfTheLake.kt | 9 +++++++- Server/src/main/core/game/shops/Shop.kt | 2 +- .../system/command/sets/MiscCommandSet.kt | 4 +++- 9 files changed, 43 insertions(+), 30 deletions(-) diff --git a/Server/data/botdata/bot_dialogue.json b/Server/data/botdata/bot_dialogue.json index 175cd4ea4..e89dc04b6 100644 --- a/Server/data/botdata/bot_dialogue.json +++ b/Server/data/botdata/bot_dialogue.json @@ -159,7 +159,6 @@ " /this @name looks dumb", "AAAAAAAAAAAAAAAAAAAAAAAAHHHHHH!!!", "como estas @name", - "Summer = always the best community manaer", "so how about that ceikry guy", "so how about that kermit dude", "woah is an abusive mod", @@ -169,7 +168,6 @@ "Where do i find partyhats?", "Why do mobs drop boxes?", "What exp rate do you play on @name?", - "Have you met Summer?", "Hey @name", "Hey @name", "Hey @name", diff --git a/Server/data/configs/drop_tables.json b/Server/data/configs/drop_tables.json index f71a005a2..6cf067fd5 100644 --- a/Server/data/configs/drop_tables.json +++ b/Server/data/configs/drop_tables.json @@ -10372,13 +10372,13 @@ { "minAmount": "15", "weight": "4.0", - "id": "6964", + "id": "995", "maxAmount": "15" }, { "minAmount": "25", "weight": "1.0", - "id": "6964", + "id": "995", "maxAmount": "25" }, { diff --git a/Server/data/configs/item_configs.json b/Server/data/configs/item_configs.json index b96b9da84..79297703a 100644 --- a/Server/data/configs/item_configs.json +++ b/Server/data/configs/item_configs.json @@ -99642,7 +99642,7 @@ { "requirements": "{1,70}-{4,70}", "ge_buy_limit": "2", - "examine": "A rune plateskirt in the colours of Armadyl.", + "examine": "A plateskirt of great craftsmanship.", "rare_item": "true", "durability": null, "weight": "8", diff --git a/Server/src/main/content/global/skill/agility/shortcuts/SteppingStoneShortcut.kt b/Server/src/main/content/global/skill/agility/shortcuts/SteppingStoneShortcut.kt index 1b2ceb20f..bb3120ecc 100644 --- a/Server/src/main/content/global/skill/agility/shortcuts/SteppingStoneShortcut.kt +++ b/Server/src/main/content/global/skill/agility/shortcuts/SteppingStoneShortcut.kt @@ -1,7 +1,9 @@ package content.global.skill.agility.shortcuts +import core.api.* import core.cache.def.impl.SceneryDefinition import core.game.interaction.OptionHandler +import core.game.interaction.QueueStrength import core.game.node.Node import core.game.node.entity.impl.ForceMovement import core.game.node.entity.player.Player @@ -38,15 +40,18 @@ class SteppingStoneShortcut : OptionHandler() { } val offset = getOffset(player,finalDest) player.debug("Offset: ${offset.first},${offset.second}") - player.pulseManager.run(object : Pulse(2){ - override fun pulse(): Boolean { - val there = player.location == finalDest - if(!there){ - ForceMovement.run(player,player.location,player.location.transform(offset.first,offset.second,0), ANIMATION,10) - } - return there + lock(player, 3) + player.locks.lockTeleport(3) + queueScript(player, 2, QueueStrength.SOFT) { + val there = player.location == finalDest + if (!there) { + lock(player, 3) + player.locks.lockTeleport(3) + ForceMovement.run(player,player.location,player.location.transform(offset.first,offset.second,0), ANIMATION,10) + return@queueScript delayScript(player, 2) } - }) + return@queueScript stopExecuting(player) + } return true } diff --git a/Server/src/main/content/global/skill/thieving/ThievableChestPlugin.java b/Server/src/main/content/global/skill/thieving/ThievableChestPlugin.java index 2b7527fc4..f711dad6f 100644 --- a/Server/src/main/content/global/skill/thieving/ThievableChestPlugin.java +++ b/Server/src/main/content/global/skill/thieving/ThievableChestPlugin.java @@ -15,6 +15,8 @@ import core.game.world.update.flag.context.Animation; import core.plugin.Initializable; import core.plugin.Plugin; +import static core.api.ContentAPIKt.*; + /** * Handles the thieving of chests. * @author Vexia @@ -146,19 +148,19 @@ public final class ThievableChestPlugin extends OptionHandler { player.sendMessage("It looks like this chest has already been looted."); return; } - player.lock(); - player.animate(Animation.create(536)); if (player.getSkills().getLevel(Skills.THIEVING) < level) { - player.lock(2); + animate(player, 536, false); + lock(player, 2); player.sendMessage("You search the chest for traps."); player.sendMessage("You find nothing.", 1); - player.unlock(); return; } if (player.getInventory().freeSlots() == 0) { player.getPacketDispatch().sendMessage("Not enough inventory space."); return; } + lock(player, 6); + animate(player, 536, false); player.sendMessage("You find a trap on the chest..."); player.getImpactHandler().setDisabledTicks(6); GameWorld.getPulser().submit(new Pulse(1, player) { @@ -172,10 +174,10 @@ public final class ThievableChestPlugin extends OptionHandler { break; case 4: player.animate(Animation.create(536)); + player.faceLocation(object.getLocation()); player.sendMessage("You open the chest."); break; case 6: - player.unlock(); for (Item i : rewards) { player.getInventory().add(i, player); } diff --git a/Server/src/main/content/global/travel/canoe/CanoeStationListener.kt b/Server/src/main/content/global/travel/canoe/CanoeStationListener.kt index 6d7d88f0a..cdb2f03d6 100644 --- a/Server/src/main/content/global/travel/canoe/CanoeStationListener.kt +++ b/Server/src/main/content/global/travel/canoe/CanoeStationListener.kt @@ -10,6 +10,7 @@ import core.game.interaction.InteractionListener import core.game.interaction.IntType import core.api.* +import core.game.interaction.QueueStrength import org.rs09.consts.Sounds class CanoeStationListener : InteractionListener { @@ -52,15 +53,13 @@ class CanoeStationListener : InteractionListener { player.faceLocation(CanoeUtils.getFaceLocation(player.location)) player.animate(axe.animation) setVarbit(player,varbit,STAGE_TREE_NONINTERACTABLE) - player.pulseManager.run(object : Pulse(4){ - override fun pulse(): Boolean { - player.animator.stop() - setVarbit(player,varbit,STAGE_LOG_CHOPPED) - player.packetDispatch.sendSceneryAnimation(node.asScenery().getChild(player), FALL, false) - player.unlock() - return true - } - }) + queueScript(player, 4, QueueStrength.SOFT) { + player.animator.stop() + setVarbit(player,varbit,STAGE_LOG_CHOPPED) + player.packetDispatch.sendSceneryAnimation(node.asScenery().getChild(player), FALL, false) + player.unlock() + return@queueScript stopExecuting(player) + } return@on true } diff --git a/Server/src/main/content/region/kandarin/seers/quest/merlinsquest/TheLadyOfTheLake.kt b/Server/src/main/content/region/kandarin/seers/quest/merlinsquest/TheLadyOfTheLake.kt index c20b25b54..84c191cb6 100644 --- a/Server/src/main/content/region/kandarin/seers/quest/merlinsquest/TheLadyOfTheLake.kt +++ b/Server/src/main/content/region/kandarin/seers/quest/merlinsquest/TheLadyOfTheLake.kt @@ -82,7 +82,14 @@ class TheLadyOfTheLake(player: Player? = null) : DialoguePlugin(player) { 117 -> player("Thanks!").also { stage = 10000 } 145 -> options("I seek the sword Excalibur.", "Good day.").also { stage = 150 } 150 -> when (buttonId) { - 1 -> player("I seek the sword Excalibur.").also { stage = 161 } + 1 -> { + player("I seek the sword Excalibur.") + if (quest.getStage(player) < 50) { + stage = 250 + } else { + stage = 161 + } + } 2 -> player("Good day.").also { stage = 10000 } } 161 -> if (quest.getStage(player) == 50 || quest.getStage(player) == 60) { // they haven't proven themselves yet diff --git a/Server/src/main/core/game/shops/Shop.kt b/Server/src/main/core/game/shops/Shop.kt index ac2bb7b2b..801c80a4c 100644 --- a/Server/src/main/core/game/shops/Shop.kt +++ b/Server/src/main/core/game/shops/Shop.kt @@ -307,7 +307,7 @@ class Shop(val title: String, val stock: Array, val general: Boolean = { if(removeItem(player, cost)) { - if (item.amount == 0 && amountInInventory(player, cost.id) == 0) { + if (item.amount == 0) { item.amount = 1 } if(!hasSpaceFor(player, item)) { diff --git a/Server/src/main/core/game/system/command/sets/MiscCommandSet.kt b/Server/src/main/core/game/system/command/sets/MiscCommandSet.kt index da16f0a52..08fd55539 100644 --- a/Server/src/main/core/game/system/command/sets/MiscCommandSet.kt +++ b/Server/src/main/core/game/system/command/sets/MiscCommandSet.kt @@ -175,7 +175,9 @@ class MiscCommandSet : CommandSet(Privilege.ADMIN){ * Opens the credit/voting shop */ define("shop", Privilege.STANDARD, "", "Opens the credit shop."){ player, _ -> - player.interfaceManager.open(Component(Components.CREDIT_SHOP)) + if (player.locks.isInteractionLocked || player.locks.isMovementLocked) { + sendMessage(player, "You can't open the shop right now.") + } else player.interfaceManager.open(Component(Components.CREDIT_SHOP)) } /**