1package com.osroyale.game.world.entity.combat.attack.listener.npc;
3import com.osroyale.game.world.entity.combat.CombatType;
4import com.osroyale.game.world.entity.combat.attack.listener.NpcCombatListenerSignature;
5import com.osroyale.game.world.entity.combat.attack.listener.SimplifiedListener;
6import com.osroyale.game.world.entity.combat.hit.CombatHit;
7import com.osroyale.game.world.entity.combat.hit.Hit;
8import com.osroyale.game.world.entity.combat.strategy.CombatStrategy;
9import com.osroyale.game.world.entity.combat.strategy.npc.NpcMagicStrategy;
10import com.osroyale.game.world.entity.combat.strategy.npc.NpcMeleeStrategy;
11import com.osroyale.game.world.entity.mob.Mob;
12import com.osroyale.game.world.entity.mob.npc.Npc;
13import com.osroyale.util.Utility;
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;
50 private static CombatStrategy<Npc>[] STRATEGIES;
51 private static final String[] SHOUTS = {
"Attack them, you dogs!",
"Attack!",
"YARRRRRRRR!",
"Rend them limb from limb!",
"Forward!",
"No retreat!", };
56 STRATEGIES = createStrategyArray(NpcMeleeStrategy.get(),
new MagicAttack());
57 }
catch (Exception e) {
63 public void start(
Npc attacker,
Mob defender,
Hit[] hits) {
64 attacker.setStrategy(randomStrategy(STRATEGIES));
72 attacker.
getStrategy().block(attacker, defender, hit, combatType);
76 private static class MagicAttack
extends NpcMagicStrategy {
77 public MagicAttack() {
78 super(getDefinition(
"Kril Tsutsaroth"));
83 CombatHit hit = nextMagicHit(attacker, defender, 30);
84 hit.setAccurate(
true);
void speak(String forceChat)
abstract Combat<? extends Mob > getCombat()
CombatStrategy< Npc > getStrategy()
static< T > T randomElement(Collection< T > collection)