Merge branch 'fix-npc-protect-prayers' into 'master'
Improve NPC usage of protection prayers. See merge request 2009scape/2009scape!255
This commit is contained in:
@@ -515,7 +515,7 @@ public abstract class Entity extends Node {
|
||||
Entity victim = state.getVictim();
|
||||
CombatStyle type = state.getStyle();
|
||||
if (state.getArmourEffect() != ArmourSet.VERAC && !entity.isIgnoreProtection(type) && victim.hasProtectionPrayer(type)) {
|
||||
return hit *= entity instanceof Player ? 0.6 : 0;
|
||||
return hit *= (entity instanceof Player && victim instanceof Player) ? 0.6 : 0;
|
||||
}
|
||||
return hit;
|
||||
}
|
||||
|
||||
@@ -653,7 +653,7 @@ public class NPC extends Entity {
|
||||
|
||||
@Override
|
||||
public boolean hasProtectionPrayer(CombatStyle style) {
|
||||
return false;
|
||||
return getProperties().getProtectStyle() == style;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -995,4 +995,4 @@ public class NPC extends Entity {
|
||||
this.neverWalks = neverWalks;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user