1package com.osroyale.game.world.entity.combat.attack.listener.npc.dragon;
3import com.osroyale.game.Animation;
4import com.osroyale.game.UpdatePriority;
5import com.osroyale.game.world.entity.combat.attack.FightType;
6import com.osroyale.game.world.entity.combat.attack.listener.NpcCombatListenerSignature;
7import com.osroyale.game.world.entity.combat.attack.listener.SimplifiedListener;
8import com.osroyale.game.world.entity.combat.hit.CombatHit;
9import com.osroyale.game.world.entity.combat.strategy.CombatStrategy;
10import com.osroyale.game.world.entity.combat.strategy.npc.NpcMeleeStrategy;
11import com.osroyale.game.world.entity.combat.strategy.npc.impl.DragonfireStrategy;
12import com.osroyale.game.world.entity.mob.Mob;
13import com.osroyale.game.world.entity.mob.npc.Npc;
15import static com.osroyale.game.world.entity.combat.CombatUtil.createStrategyArray;
16import static com.osroyale.game.world.entity.combat.CombatUtil.randomStrategy;
17import static com.osroyale.game.world.entity.combat.projectile.CombatProjectile.getDefinition;
22 260, 261, 262, 263, 264, 7868, 7869, 7870,
23 247, 248, 249, 250, 251,
24 265, 4385, 5878, 5879, 5880, 5881, 5882, 267,
25 252, 253, 254, 255, 256, 257, 258, 259, 2642, 6500, 6501, 6502, 6636, 6652
62 private static CombatStrategy<Npc>[] STRATEGIES;
67 STRATEGIES = createStrategyArray(
new CrushMelee(),
new StabMelee(), DRAGONFIRE);
68 }
catch (Exception e) {
74 public boolean canAttack(
Npc attacker,
Mob defender) {
75 if (!NpcMeleeStrategy.get().withinDistance(attacker, defender)) {
76 attacker.setStrategy(DRAGONFIRE);
78 return attacker.
getStrategy().canAttack(attacker, defender);
82 public void finishOutgoing(
Npc attacker,
Mob defender) {
83 if (!NpcMeleeStrategy.get().withinDistance(attacker, defender)) {
84 attacker.setStrategy(DRAGONFIRE);
86 attacker.setStrategy(randomStrategy(STRATEGIES));
90 private static final class CrushMelee
extends NpcMeleeStrategy {
94 public int getAttackDistance(
Npc attacker,
FightType fightType) {
105 return new CombatHit[]{nextMeleeHit(attacker, defender)};
109 private static final class StabMelee
extends NpcMeleeStrategy {
113 public int getAttackDistance(
Npc attacker,
FightType fightType) {
124 return new CombatHit[]{nextMeleeHit(attacker, defender)};
CombatStrategy< Npc > getStrategy()