RuneHive-Game
Loading...
Searching...
No Matches
BandosSpritualMage.java
Go to the documentation of this file.
1package com.runehive.game.world.entity.combat.attack.listener.npc.godwar;
2
3import com.runehive.game.world.entity.combat.attack.listener.NpcCombatListenerSignature;
4import com.runehive.game.world.entity.combat.attack.listener.SimplifiedListener;
5import com.runehive.game.world.entity.combat.hit.CombatHit;
6import com.runehive.game.world.entity.combat.hit.Hit;
7import com.runehive.game.world.entity.combat.strategy.CombatStrategy;
8import com.runehive.game.world.entity.combat.strategy.npc.NpcMagicStrategy;
9import com.runehive.game.world.entity.combat.strategy.npc.NpcMeleeStrategy;
10import com.runehive.game.world.entity.combat.strategy.npc.NpcRangedStrategy;
11import com.runehive.game.world.entity.mob.Mob;
12import com.runehive.game.world.entity.mob.npc.Npc;
13
14import static com.runehive.game.world.entity.combat.CombatUtil.createStrategyArray;
15import static com.runehive.game.world.entity.combat.CombatUtil.randomStrategy;
16import static com.runehive.game.world.entity.combat.projectile.CombatProjectile.getDefinition;
17
18/**
19 * @author Daniel
20 */
21@NpcCombatListenerSignature(npcs = { 2244 })
23
24 private static MagicAttack MAGIC = new MagicAttack();
25 private static CombatStrategy<Npc>[] STRATEGIES = createStrategyArray(NpcMeleeStrategy.get(), MAGIC);
26
27 @Override
28 public void start(Npc attacker, Mob defender, Hit[] hits) {
29 attacker.setStrategy(randomStrategy(STRATEGIES));
30 }
31
32 private static class MagicAttack extends NpcMagicStrategy {
33 private MagicAttack() {
34 super(getDefinition("Spirtual Mage"));
35 }
36
37 @Override
38 public CombatHit[] getHits(Npc attacker, Mob defender) {
39 CombatHit combatHit = nextMagicHit(attacker, defender, 15);
40 combatHit.setAccurate(true);
41 return new CombatHit[] { combatHit };
42 }
43 }
44}
A wrapper for a Hit object, adding additional variables for hit and hitsplat delays.
A Hit object holds the damage amount and hitsplat data.
Definition Hit.java:10
final CombatHit nextMagicHit(T attacker, Mob defender)
Handles the mob class.
Definition Mob.java:66
Represents a non-player character in the in-game world.
Definition Npc.java:29
void setStrategy(CombatStrategy< Npc > strategy)
Definition Npc.java:212