From 97053798ffc71fecb6c081bf15cfd67f7e779ca7 Mon Sep 17 00:00:00 2001 From: randy Date: Sat, 7 Dec 2024 20:16:45 -0700 Subject: [PATCH] Fixed free spell cast bug and removed delay on bind spells The chance to not consume runes was being checked before checking if the runes were in the inventory, allowing casting of spells that the player did not have the runes for. This has been fixed. Additionaly, the forced delay on bind spells has been removed, so they can be spammed. This is definitely unbalanced for pvp, nobody does pvp so it's fine. If possible in the future, reinstat the delay when targeting players. --- .../game/node/entity/combat/spell/MagicSpell.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Server/src/main/core/game/node/entity/combat/spell/MagicSpell.java b/Server/src/main/core/game/node/entity/combat/spell/MagicSpell.java index 86b7e1260..601cc835f 100644 --- a/Server/src/main/core/game/node/entity/combat/spell/MagicSpell.java +++ b/Server/src/main/core/game/node/entity/combat/spell/MagicSpell.java @@ -214,19 +214,18 @@ public abstract class MagicSpell implements Plugin { } } */ + /* Snowscape custom: removing forced delay on binding spells. If possible, reimplement this for pvp scenarios if((spellId == 12 || spellId == 30 || spellId == 56) && caster instanceof Player){ if (caster.getAttribute("entangleDelay", 0) > GameWorld.getTicks()) { caster.asPlayer().sendMessage("You have recently cast a binding spell."); return false; } } + */ if (caster instanceof Player) { Player p = (Player) caster; //if(p.getEquipment().get(3) != null && p.getEquipment().get(3).getId() == 14726){ - if(this instanceof CombatSpell && RandomFunction.getRandom(100) > 33){ - //p.sendMessage("Your staff negates the rune requirement of the spell."); - return true; - } + //} if (runes == null) { return true; @@ -237,6 +236,11 @@ public abstract class MagicSpell implements Plugin { return false; } } + //Snowscape custom: only consume runes 33% of the time + if(this instanceof CombatSpell && RandomFunction.getRandom(100) > 33){ + //p.sendMessage("Your staff negates the rune requirement of the spell."); + return true; + } if (remove) { toRemove.forEach(i -> { p.getInventory().remove(i);