RuneHive-Tarnish
Neural OSRS Enhancement Framework
Loading...
Searching...
No Matches
BandosSpritualMage.java
1package com.osroyale.game.world.entity.combat.attack.listener.npc.godwar;
2
3import com.osroyale.game.world.entity.combat.attack.listener.NpcCombatListenerSignature;
4import com.osroyale.game.world.entity.combat.attack.listener.SimplifiedListener;
5import com.osroyale.game.world.entity.combat.hit.CombatHit;
6import com.osroyale.game.world.entity.combat.hit.Hit;
7import com.osroyale.game.world.entity.combat.strategy.CombatStrategy;
8import com.osroyale.game.world.entity.combat.strategy.npc.NpcMagicStrategy;
9import com.osroyale.game.world.entity.combat.strategy.npc.NpcMeleeStrategy;
10import com.osroyale.game.world.entity.combat.strategy.npc.NpcRangedStrategy;
11import com.osroyale.game.world.entity.mob.Mob;
12import com.osroyale.game.world.entity.mob.npc.Npc;
13
14import static com.osroyale.game.world.entity.combat.CombatUtil.createStrategyArray;
15import static com.osroyale.game.world.entity.combat.CombatUtil.randomStrategy;
16import static com.osroyale.game.world.entity.combat.projectile.CombatProjectile.getDefinition;
17
21@NpcCombatListenerSignature(npcs = { 2244 })
46
47public class BandosSpritualMage extends SimplifiedListener<Npc> {
48
49 private static MagicAttack MAGIC = new MagicAttack();
50 private static CombatStrategy<Npc>[] STRATEGIES = createStrategyArray(NpcMeleeStrategy.get(), MAGIC);
51
52 @Override
53 public void start(Npc attacker, Mob defender, Hit[] hits) {
54 attacker.setStrategy(randomStrategy(STRATEGIES));
55 }
56
57 private static class MagicAttack extends NpcMagicStrategy {
58 private MagicAttack() {
59 super(getDefinition("Spirtual Mage"));
60 }
61
62 @Override
63 public CombatHit[] getHits(Npc attacker, Mob defender) {
64 CombatHit combatHit = nextMagicHit(attacker, defender, 15);
65 combatHit.setAccurate(true);
66 return new CombatHit[] { combatHit };
67 }
68 }
69}