Add damage scaling to Crumble Undead

The spell damage scales like Magic Dart, but due to the limitation of only affecting undead enemies, deals 2 more damage.

If the enemy is not undead, deals only 1 damage (set to 1 instead of 0 to prevent splashing abuse).
This commit is contained in:
randy 2024-11-10 15:15:10 -07:00
parent 98e8cd4592
commit e8afa4e529

View file

@ -47,7 +47,11 @@ public enum SpellType {
CRUMBLE_UNDEAD(1.2) {
@Override
public int getImpactAmount(Entity e, Entity victim, int base) {
return 15; // Hits as high as Earth blast
if (((NPC) victim).getTask() != null && ((NPC) victim).getTask().undead) {
return 12 + (e.getSkills().getLevel(Skills.MAGIC) / 10);
}
((Player) e).sendMessage("Your spell does almost no damage, as your target is not undead.");
return 1;
}
},