From c4fa99d6d34edca0de8464b95aa5a09583d3bac5 Mon Sep 17 00:00:00 2001 From: Player Name Date: Sat, 25 Jul 2026 08:32:24 +0200 Subject: [PATCH] lunar pot fixes --- .../global/skill/magic/lunar/HealSpell.java | 3 ++- .../skill/magic/lunar/StatBoostSpell.java | 11 ++++++----- .../skill/magic/lunar/StatRestoreSpell.java | 17 ++++++----------- 3 files changed, 14 insertions(+), 17 deletions(-) diff --git a/Server/src/main/content/global/skill/magic/lunar/HealSpell.java b/Server/src/main/content/global/skill/magic/lunar/HealSpell.java index 8485e6e06..7059385aa 100644 --- a/Server/src/main/content/global/skill/magic/lunar/HealSpell.java +++ b/Server/src/main/content/global/skill/magic/lunar/HealSpell.java @@ -1,5 +1,6 @@ package content.global.skill.magic.lunar; +import core.game.bots.AIPlayer; import core.game.node.entity.combat.spell.MagicSpell; import core.game.node.entity.combat.spell.Runes; import core.plugin.Initializable; @@ -92,7 +93,7 @@ public final class HealSpell extends MagicSpell { player.getPacketDispatch().sendMessage("This player is busy."); return false; } - if (!o.getSettings().isAcceptAid()) { + if (!o.getSettings().isAcceptAid() || (o instanceof AIPlayer)) { player.getPacketDispatch().sendMessage("The player is not accepting any aid."); return false; } diff --git a/Server/src/main/content/global/skill/magic/lunar/StatBoostSpell.java b/Server/src/main/content/global/skill/magic/lunar/StatBoostSpell.java index 5df9fc5ff..bdaa387ea 100644 --- a/Server/src/main/content/global/skill/magic/lunar/StatBoostSpell.java +++ b/Server/src/main/content/global/skill/magic/lunar/StatBoostSpell.java @@ -41,15 +41,16 @@ public final class StatBoostSpell extends MagicSpell { @Override public boolean cast(Entity entity, Node target) { - final Player player = ((Player) entity); - Item item = ((Item) target); - final Potion potion = (Potion) Consumables.getConsumableById(item.getId()).getConsumable(); + final Player player = (Player) entity; + Item item = (Item) target; player.getInterfaceManager().setViewedTab(6); + + final Potion potion = (Potion) Consumables.getConsumableById(item.getId()).getConsumable(); if (potion == null) { player.getPacketDispatch().sendMessage("You can only cast this spell on a potion."); return false; } - if (!item.getDefinition().isTradeable() || item.getName().toLowerCase().contains("restore") || item.getName().toLowerCase().contains("zamorak") || item.getName().toLowerCase().contains("saradomin") || item.getName().toLowerCase().contains("combat")) { + if (!item.getDefinition().isTradeable() || item.getName().toLowerCase().contains("restore") || item.getName().toLowerCase().contains("zamorak") || item.getName().toLowerCase().contains("saradomin")) { player.getPacketDispatch().sendMessage("You can't cast this spell on that item."); return false; } @@ -70,7 +71,7 @@ public final class StatBoostSpell extends MagicSpell { if (!o.isActive() || o.getLocks().isInteractionLocked()) { continue; } - if (!o.getSettings().isAcceptAid() && !(o instanceof AIPlayer)) { + if (!o.getSettings().isAcceptAid() || o instanceof AIPlayer) { continue; } o.graphics(GRAPHICS); diff --git a/Server/src/main/content/global/skill/magic/lunar/StatRestoreSpell.java b/Server/src/main/content/global/skill/magic/lunar/StatRestoreSpell.java index 505d3921d..dda2b5d6d 100644 --- a/Server/src/main/content/global/skill/magic/lunar/StatRestoreSpell.java +++ b/Server/src/main/content/global/skill/magic/lunar/StatRestoreSpell.java @@ -46,13 +46,7 @@ public class StatRestoreSpell extends MagicSpell { Item item = ((Item) target); player.getInterfaceManager().setViewedTab(6); - if (Consumables.getConsumableById(item.getId()) == null) { - player.getPacketDispatch().sendMessage("You can only cast this spell on a potion."); - return false; - } - final Potion potion = (Potion) Consumables.getConsumableById(item.getId()).getConsumable(); - if (potion == null) { player.getPacketDispatch().sendMessage("You can only cast this spell on a potion."); return false; @@ -63,22 +57,23 @@ public class StatRestoreSpell extends MagicSpell { } List pl = RegionManager.getLocalPlayers(player.getLocation(), 1); int doses = potion.getDose(item); - if (pl.isEmpty()) { - return false; - } if (!super.meetsRequirements(player, true, false)) { return false; } int size = 0; for (Player o : pl) { if (size >= doses) break; - if (!o.isActive() || o.getLocks().isInteractionLocked() || o == player) { + if (o == player) { continue; } - if (!o.getSettings().isAcceptAid() && !(o instanceof AIPlayer)) { + if (!o.isActive() || o.getLocks().isInteractionLocked()) { + continue; + } + if (!o.getSettings().isAcceptAid() || (o instanceof AIPlayer)) { continue; } o.graphics(GRAPHICS); + playGlobalAudio(o.getLocation(), Sounds.LUNAR_STAT_SHARE_INDIVIDUAL_2897); potion.getEffect().activate(o); size++; }