From b56b1da8cfa722e832f5270f65fd4655af400082 Mon Sep 17 00:00:00 2001 From: Ceikry Date: Wed, 3 Aug 2022 12:01:09 +0000 Subject: [PATCH] Fixed PVP equipment not fully disintegrating Fixed tool leprechaun ignoring teleblock Fixed invalid cast in fight caves NPCs Fixed skulled deaths being treated as normal deaths outside the wildy Fixed NPC talk option interrupting combat Removed Elemental Shield from Zaff's shop Quest-locked Elemental Shield Made sure HCIM can't deiron --- Server/data/configs/shops.json | 2 +- .../activity/tzhaar/TzhaarFightCavesPlugin.java | 3 ++- .../game/content/dialogue/LumbridgeGuideDialogue.java | 2 +- .../node/entity/player/link/grave/GraveManager.java | 2 +- .../game/content/activity/vinesweeper/Vinesweeper.kt | 6 ++++++ .../interaction/item/ItemQuestRequirementListener.kt | 8 +++++++- .../rs09/game/interaction/npc/NPCTalkListener.kt | 11 +++++++++++ .../node/entity/combat/equipment/EquipmentDegrader.kt | 4 ++-- 8 files changed, 31 insertions(+), 7 deletions(-) diff --git a/Server/data/configs/shops.json b/Server/data/configs/shops.json index 400636619..9bf3504ae 100644 --- a/Server/data/configs/shops.json +++ b/Server/data/configs/shops.json @@ -1239,7 +1239,7 @@ "general_store": "false", "id": "140", "title": "Staff Shop", - "stock": "{1379,10,100}-{1389,10,100}-{1381,10,100}-{1383,10,100}-{1385,10,100}-{1387,10,100}-{2890,10,100}" + "stock": "{1379,10,100}-{1389,10,100}-{1381,10,100}-{1383,10,100}-{1385,10,100}-{1387,10,100}" }, { "npcs": "6971", diff --git a/Server/src/main/java/core/game/content/activity/tzhaar/TzhaarFightCavesPlugin.java b/Server/src/main/java/core/game/content/activity/tzhaar/TzhaarFightCavesPlugin.java index 267a6c090..09a643f84 100644 --- a/Server/src/main/java/core/game/content/activity/tzhaar/TzhaarFightCavesPlugin.java +++ b/Server/src/main/java/core/game/content/activity/tzhaar/TzhaarFightCavesPlugin.java @@ -261,7 +261,8 @@ public final class TzhaarFightCavesPlugin extends ActivityPlugin { /* Kludge to fix this plugin overriding the base NPC death finalization * resulting in not dispatching the proper NPC kill event. */ - killer.dispatch(new NPCKillEvent(e.asNpc())); + if (e instanceof NPC) + killer.dispatch(new NPCKillEvent(e.asNpc())); return true; } diff --git a/Server/src/main/java/core/game/content/dialogue/LumbridgeGuideDialogue.java b/Server/src/main/java/core/game/content/dialogue/LumbridgeGuideDialogue.java index 9b8cdb292..aa8363d09 100644 --- a/Server/src/main/java/core/game/content/dialogue/LumbridgeGuideDialogue.java +++ b/Server/src/main/java/core/game/content/dialogue/LumbridgeGuideDialogue.java @@ -70,7 +70,7 @@ public final class LumbridgeGuideDialogue extends DialoguePlugin { if (player.getRights() == Rights.PLAYER_MODERATOR && ModeratorZone.isOpen() || player.isAdmin()) { options.add("I would like to access the P-Mod room."); } - if (player.getIronmanManager().isIronman()) { + if (player.getIronmanManager().isIronman() && player.getIronmanManager().getMode() != IronmanMode.HARDCORE) { options.add("Would you like to remove Ironman Mode?"); } options(options.toArray(new String[] {})); diff --git a/Server/src/main/java/core/game/node/entity/player/link/grave/GraveManager.java b/Server/src/main/java/core/game/node/entity/player/link/grave/GraveManager.java index 88720461d..db3ea7c59 100644 --- a/Server/src/main/java/core/game/node/entity/player/link/grave/GraveManager.java +++ b/Server/src/main/java/core/game/node/entity/player/link/grave/GraveManager.java @@ -84,7 +84,7 @@ public class GraveManager { if (player.getDetails().getRights() == Rights.ADMINISTRATOR && GameWorld.getSettings().isHosted()) { return false; } - if (player.getSkullManager().isWilderness()) { + if (player.getSkullManager().isSkulled()) { return false; } if (player.getInventory().itemCount() + player.getEquipment().itemCount() <= (player.getPrayer().get(PrayerType.PROTECT_ITEMS) ? 4 : 3)) { diff --git a/Server/src/main/kotlin/rs09/game/content/activity/vinesweeper/Vinesweeper.kt b/Server/src/main/kotlin/rs09/game/content/activity/vinesweeper/Vinesweeper.kt index 0fdd5f82c..176854681 100644 --- a/Server/src/main/kotlin/rs09/game/content/activity/vinesweeper/Vinesweeper.kt +++ b/Server/src/main/kotlin/rs09/game/content/activity/vinesweeper/Vinesweeper.kt @@ -5,6 +5,7 @@ import FarmerDialogue.Companion.FARMER_FLAG_LINES import WinkinDialogue import api.* import core.game.component.Component +import core.game.content.dialogue.FacialExpression import core.game.interaction.DestinationFlag import core.game.interaction.MovementPulse import core.game.node.entity.Entity @@ -14,6 +15,7 @@ import core.game.node.entity.npc.AbstractNPC import core.game.node.entity.npc.NPC import core.game.node.entity.player.Player import core.game.node.entity.skill.Skills +import core.game.node.entity.state.EntityState import core.game.node.item.GroundItemManager import core.game.node.item.Item import core.game.node.scenery.Scenery @@ -499,6 +501,10 @@ class Vinesweeper : InteractionListener, InterfaceListener, MapArea { object VinesweeperTeleport { @JvmStatic fun teleport(npc: NPC, player: Player) { + if (player.stateManager.hasState(EntityState.TELEBLOCK)) { + sendNPCDialogue(player, npc.id, "I can't do that, you're teleblocked!", FacialExpression.OLD_ANGRY1) + return + } npc.animate(Animation(437)) npc.faceTemporary(player, 1) npc.graphics(Graphics(108)) diff --git a/Server/src/main/kotlin/rs09/game/interaction/item/ItemQuestRequirementListener.kt b/Server/src/main/kotlin/rs09/game/interaction/item/ItemQuestRequirementListener.kt index e8323b706..224f301b1 100644 --- a/Server/src/main/kotlin/rs09/game/interaction/item/ItemQuestRequirementListener.kt +++ b/Server/src/main/kotlin/rs09/game/interaction/item/ItemQuestRequirementListener.kt @@ -115,6 +115,12 @@ class ItemQuestRequirementListener : InteractionListener { return@onEquip true } - + onEquip(Items.ELEMENTAL_SHIELD_2890) { player, _ -> + if (!isQuestComplete(player, "Elemental Workshop I")) { + sendMessage(player, "You must have completed Elemental Workshop I to equip this.") + return@onEquip false + } + return@onEquip true + } } } \ No newline at end of file diff --git a/Server/src/main/kotlin/rs09/game/interaction/npc/NPCTalkListener.kt b/Server/src/main/kotlin/rs09/game/interaction/npc/NPCTalkListener.kt index e2195bfd8..1fbc3cdbe 100644 --- a/Server/src/main/kotlin/rs09/game/interaction/npc/NPCTalkListener.kt +++ b/Server/src/main/kotlin/rs09/game/interaction/npc/NPCTalkListener.kt @@ -1,5 +1,6 @@ package rs09.game.interaction.npc +import api.sendMessage import core.game.content.quest.miniquest.barcrawl.BarcrawlManager import core.game.content.quest.miniquest.barcrawl.BarcrawlType import core.game.node.entity.npc.NPC @@ -41,6 +42,16 @@ class NPCTalkListener : InteractionListener { if (!npc.getAttribute("facing_booth", false)) { npc.faceLocation(player.location) } + // ---------------- THESE DIALOGUES ARE INAUTHENTIC BUT ARE COPING FOR A CORE ISSUE ----------------------- + if (player.properties.combatPulse.getVictim() == npc) { + sendMessage(player, "I don't think they have any interest in talking to me right now!") + return@on true + } + if (npc.inCombat()) { + sendMessage(player, "They look a bit busy at the moment.") + return@on true + } + //--------------------------------------------------------------------------------------------------------- //I'm sorry for this but it was honestly the best way to do this if (player.getAttribute(GC_BASE_ATTRIBUTE + ":" + GC_JOB_ORDINAL, -1) != -1) { val job = GnomeCookingJob.values()[player.getAttribute(GC_BASE_ATTRIBUTE + ":" + GC_JOB_ORDINAL, -1)] diff --git a/Server/src/main/kotlin/rs09/game/node/entity/combat/equipment/EquipmentDegrader.kt b/Server/src/main/kotlin/rs09/game/node/entity/combat/equipment/EquipmentDegrader.kt index 0ad809196..bad5d30a6 100644 --- a/Server/src/main/kotlin/rs09/game/node/entity/combat/equipment/EquipmentDegrader.kt +++ b/Server/src/main/kotlin/rs09/game/node/entity/combat/equipment/EquipmentDegrader.kt @@ -56,7 +56,7 @@ class EquipmentDegrader{ charge = 0 } if(this.charge <= 0) { - val charges = itemCharges.getOrElse(this.id, { 1000 }) + val charges = itemCharges.getOrElse(this.id) { 1000 } if (set?.size!! > 2) { p?.equipment?.remove(this) p?.sendMessage("Your $name has degraded.") @@ -68,7 +68,7 @@ class EquipmentDegrader{ p?.equipment?.refresh() } } else if (set.size == 2) { - if(set.isLast(set.indexOf(this.id))){ + if(set.isLast(this.id)){ p?.equipment?.remove(this) p?.sendMessage("Your $name degrades into dust.") } else {