49public class Scorpia
extends MultiStrategy {
50 private boolean hasGuardians;
53 currentStrategy =
new Melee();
58 currentStrategy.block(attacker, defender, hit, combatType);
63 public void hit(
Npc attacker,
Mob defender,
Hit hit) {
64 super.hit(attacker, defender, hit);
65 if (hasGuardians || attacker.getCurrentHealth() >= 100) {
69 for (
int i = 0; i < 2; i++) {
70 Position spawn = RandomUtils.random(
Utility.getInnerBoundaries(attacker));
71 Npc guardian =
new Guardian(spawn, attacker);
73 guardian.definition.setRespawnTime(-1);
78 public int getAttackDelay(
Npc attacker,
Mob defender,
FightType fightType) {
79 return attacker.definition.getAttackDelay();
82 private class GuardianWaypoint
extends Waypoint {
85 GuardianWaypoint(Guardian guardian,
Npc scorpia) {
86 super(guardian, scorpia);
87 this.scorpia = scorpia;
91 protected void onDestination() {
92 CombatProjectile.getDefinition(
"Scorpia guardian").getProjectile().ifPresent(projectile -> projectile.send(mob, scorpia));
95 ((Guardian) mob).lastHeal.reset();
99 private class Guardian
extends Npc {
104 setWaypoint(
new Waypoint(
this, scorpia) {
106 protected void onDestination() {
107 CombatProjectile.getDefinition(
"Scorpia guardian").getProjectile().ifPresent(projectile -> projectile.send(mob, scorpia));
119 long millis = lastHeal.elapsed().toMillis();
120 if (millis > 15_000) {
126 private static final class Melee
extends NpcMeleeStrategy {
129 return new CombatHit[]{nextMeleeHit(attacker, defender, 16)};