1package com.osroyale.game.world.entity.combat.attack.listener.npc;
3import com.osroyale.game.Animation;
4import com.osroyale.game.UpdatePriority;
5import com.osroyale.game.world.entity.combat.CombatUtil;
6import com.osroyale.game.world.entity.combat.attack.FightType;
7import com.osroyale.game.world.entity.combat.attack.listener.NpcCombatListenerSignature;
8import com.osroyale.game.world.entity.combat.attack.listener.SimplifiedListener;
9import com.osroyale.game.world.entity.combat.hit.CombatHit;
10import com.osroyale.game.world.entity.combat.hit.Hit;
11import com.osroyale.game.world.entity.combat.strategy.npc.NpcMeleeStrategy;
12import com.osroyale.game.world.entity.combat.strategy.npc.NpcRangedStrategy;
13import com.osroyale.game.world.entity.mob.Mob;
14import com.osroyale.game.world.entity.mob.npc.Npc;
15import com.osroyale.game.world.position.Area;
16import com.osroyale.util.RandomUtils;
17import com.osroyale.util.Utility;
19import static com.osroyale.game.world.entity.combat.projectile.CombatProjectile.getDefinition;
63 private static MeleeAttack MELEE;
64 private static RangedAttack RANGED;
66 private static final String[] SHOUTS = {
68 "Split their skulls!",
69 "All glory to Bandos!",
72 "Crush them underfoot!",
73 "Death to our enemies!",
75 "For the glory of the Big High War God!",
76 "We feast on the bones of our enemies tonight!"
81 MELEE =
new MeleeAttack();
82 RANGED =
new RangedAttack();
83 }
catch (Exception e) {
89 public void start(
Npc attacker,
Mob defender,
Hit[] hits) {
90 if (attacker.
getStrategy().equals(NpcMeleeStrategy.get())) {
91 attacker.setStrategy(MELEE);
94 if (RandomUtils.success(0.35)) {
99 private static class MeleeAttack
extends NpcMeleeStrategy {
106 public void finishOutgoing(
Npc attacker,
Mob defender) {
107 if (RandomUtils.success(0.40)) {
108 attacker.setStrategy(RANGED);
113 private static class RangedAttack
extends NpcRangedStrategy {
115 super(getDefinition(
"Graardor Ranged"));
125 return new CombatHit[]{nextRangedHit(attacker, defender, 35)};
129 public void hitsplat(
Npc attacker,
Mob defender,
Hit hit) {
130 super.hitsplat(attacker, defender, hit);
133 if (mob.isPlayer() &&
Area.inBandos(mob)) {
134 mob.damage(nextRangedHit(attacker, defender, 35));
140 public void finishOutgoing(
Npc attacker,
Mob defender) {
142 attacker.setStrategy(MELEE);
147 public int getAttackDistance(
Npc attacker,
FightType fightType) {
static void areaAction(Mob mob, Consumer< Mob > action)
void speak(String forceChat)
CombatStrategy< Npc > getStrategy()
static< T > T randomElement(Collection< T > collection)