1package com.osroyale.game.world.entity.combat.strategy.npc.boss;
3import com.osroyale.game.Animation;
4import com.osroyale.game.UpdatePriority;
5import com.osroyale.game.world.entity.combat.CombatUtil;
6import com.osroyale.game.world.entity.combat.attack.FightType;
7import com.osroyale.game.world.entity.combat.hit.CombatHit;
8import com.osroyale.game.world.entity.combat.hit.Hit;
9import com.osroyale.game.world.entity.combat.strategy.npc.MultiStrategy;
10import com.osroyale.game.world.entity.combat.strategy.npc.NpcMagicStrategy;
11import com.osroyale.game.world.entity.combat.strategy.npc.NpcMeleeStrategy;
12import com.osroyale.game.world.entity.combat.strategy.npc.NpcRangedStrategy;
13import com.osroyale.game.world.entity.mob.Mob;
14import com.osroyale.game.world.entity.mob.npc.Npc;
15import com.osroyale.game.world.pathfinding.path.SimplePathChecker;
16import com.osroyale.game.world.position.Position;
17import com.osroyale.util.Utility;
19import static com.osroyale.game.world.entity.combat.projectile.CombatProjectile.getDefinition;
56public class Zulrah
extends MultiStrategy {
57 private final MeleeAttack MELEE =
new MeleeAttack();
58 private static final MagicAttack MAGIC =
new MagicAttack();
59 private static final RangedAttack RANGED =
new RangedAttack();
65 public void setMelee() {
66 currentStrategy = MELEE;
69 public void setMagic() {
70 currentStrategy = MAGIC;
73 public void setRanged() {
74 currentStrategy = RANGED;
77 private class MeleeAttack
extends NpcMeleeStrategy {
81 public boolean withinDistance(
Npc attacker,
Mob defender) {
82 return Utility.within(attacker, defender, getAttackDistance(attacker, attacker.
getCombat().getFightType()))
87 public void start(
Npc attacker,
Mob defender,
Hit[] hits) {
88 attacker.blockInteract =
true;
94 public void hit(
Npc attacker,
Mob defender,
Hit hit) {
95 attacker.blockInteract =
false;
101 hit.setAccurate(
false);
105 hit.setAs(nextMeleeHit(attacker, defender, 41));
106 attacker.
getCombat().removeModifier(
this);
107 defender.animate(
CombatUtil.getBlockAnimation(defender));
113 return new CombatHit[] { nextMeleeHit(attacker, defender, -1, 4, 0,
false) };
117 public int getAttackDelay(
Npc attacker,
Mob defender,
FightType fightType) {
122 public int getAttackDistance(
Npc attacker,
FightType fightType) {
132 public int modifyAttackLevel(
Npc attacker,
Mob defender,
int level) {
139 private static class RangedAttack
extends NpcRangedStrategy {
140 private RangedAttack() {
141 super(getDefinition(
"Zulrah Ranged"));
146 return new CombatHit[]{nextRangedHit(attacker, defender, 41)};
150 public int getAttackDistance(
Npc attacker,
FightType fightType) {
156 private static class MagicAttack
extends NpcMagicStrategy {
157 private MagicAttack() {
158 super(getDefinition(
"Zulrah Magic"));
163 CombatHit combatHit = nextMagicHit(attacker, defender, 41);
164 combatHit.setAccurate(
true);
169 public int getAttackDistance(
Npc attacker,
FightType fightType) {
void face(GameObject object)
Combat< Npc > getCombat()