RuneHive-Game
Loading...
Searching...
No Matches
ArmadylSpritualMage.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.npc.NpcMagicStrategy;
8import com.runehive.game.world.entity.mob.Mob;
9import com.runehive.game.world.entity.mob.npc.Npc;
10
11import static com.runehive.game.world.entity.combat.projectile.CombatProjectile.getDefinition;
12
13/**
14 * @author Daniel
15 */
16@NpcCombatListenerSignature(npcs = {3168})
18
19 private static MagicAttack MAGIC = new MagicAttack();
20
21 @Override
22 public void start(Npc attacker, Mob defender, Hit[] hits) {
23 attacker.setStrategy(MAGIC);
24 }
25
26 private static class MagicAttack extends NpcMagicStrategy {
27 private MagicAttack() {
28 super(getDefinition("Spirtual Mage"));
29 }
30
31 @Override
32 public CombatHit[] getHits(Npc attacker, Mob defender) {
33 CombatHit combatHit = nextMagicHit(attacker, defender, 15);
34 combatHit.setAccurate(true);
35 return new CombatHit[]{combatHit};
36 }
37 }
38}
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