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
This commit is contained in:
Ceikry 2022-08-03 12:01:09 +00:00 committed by Ryan
parent 4a27bf689a
commit b56b1da8cf
8 changed files with 31 additions and 7 deletions

View file

@ -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",

View file

@ -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;
}

View file

@ -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[] {}));

View file

@ -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)) {

View file

@ -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))

View file

@ -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
}
}
}

View file

@ -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)]

View file

@ -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 {