forked from 2009Scape/Server
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.
This commit is contained in:
parent
b1ca068e3f
commit
97053798ff
1 changed files with 8 additions and 4 deletions
|
|
@ -214,19 +214,18 @@ public abstract class MagicSpell implements Plugin<SpellType> {
|
|||
}
|
||||
}
|
||||
*/
|
||||
/* 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<SpellType> {
|
|||
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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue