1package com.runehive.content.activity.infernomobs;
3import com.runehive.game.Animation;
4import com.runehive.game.Graphic;
5import com.runehive.game.UpdatePriority;
6import com.runehive.game.task.Task;
7import com.runehive.game.task.impl.CeillingCollapseTask;
8import com.runehive.game.world.World;
9import com.runehive.game.world.entity.combat.CombatType;
10import com.runehive.game.world.entity.combat.attack.FightType;
11import com.runehive.game.world.entity.combat.hit.CombatHit;
12import com.runehive.game.world.entity.combat.hit.Hit;
13import com.runehive.game.world.entity.combat.projectile.CombatProjectile;
14import com.runehive.game.world.entity.combat.strategy.CombatStrategy;
15import com.runehive.game.world.entity.combat.strategy.npc.MultiStrategy;
16import com.runehive.game.world.entity.combat.strategy.npc.NpcMagicStrategy;
17import com.runehive.game.world.entity.combat.strategy.npc.NpcMeleeStrategy;
18import com.runehive.game.world.entity.combat.strategy.npc.NpcRangedStrategy;
19import com.runehive.game.world.entity.mob.Mob;
20import com.runehive.game.world.entity.mob.movement.waypoint.Waypoint;
21import com.runehive.game.world.entity.mob.npc.Npc;
22import com.runehive.game.world.entity.mob.player.Player;
23import com.runehive.game.world.entity.mob.prayer.Prayer;
24import com.runehive.game.world.position.Position;
25import com.runehive.util.RandomUtils;
26import com.runehive.util.Stopwatch;
27import com.runehive.util.Utility;
29import java.util.concurrent.TimeUnit;
31import static com.runehive.game.world.entity.combat.CombatUtil.createStrategyArray;
32import static com.runehive.game.world.entity.combat.CombatUtil.randomStrategy;
33import static com.runehive.game.world.entity.combat.projectile.CombatProjectile.getDefinition;
62 public static int POS1 = 2274;
63 public static int POS2 = 5337;
67 super.hit(attacker, defender,
hit);
89 for (
int i = 0; i <= 2; i++) {
96 World.sendGraphic(new Graphic(1460, true), guardian.getPosition());
97 defender.damage(new Hit(10 * guardian.getCurrentHealth() / guardian.getMaximumHealth()));
98 World.schedule(new CeillingCollapseTask(defender.getPlayer()));
115 return roll + 150_000;
131 protected void execute() {
137 protected void execute() {
173 super(getDefinition(
"jal jad Magic"));
179 hit.setAccurate(
true);
201 protected void onDestination() {
203 .ifPresent(projectile -> projectile.send(mob, healer));
215 long millis = TimeUnit.MILLISECONDS.convert(System.nanoTime(), TimeUnit.NANOSECONDS);
216 if (millis > 15_000) {
228 hit.setAccurate(
true);
Guardian(Position spawn, Npc healer)
CombatHit[] getHits(Npc attacker, Mob defender)
final Animation ANIMATION
int getAttackDelay(Npc attacker, Mob defender, FightType fightType)
Animation getAttackAnimation(Npc attacker, Mob defender)
Animation getAttackAnimation(Npc attacker, Mob defender)
final Animation ANIMATION
CombatHit[] getHits(Npc attacker, Mob defender)
void attack(Npc attacker, Mob defender, Hit hit)
final Animation ANIMATION
void hit(Npc attacker, Mob defender, Hit hit)
int getAttackDelay(Npc attacker, Mob defender, FightType fightType)
void start(Npc attacker, Mob defender, Hit[] hits)
CombatHit[] getHits(Npc attacker, Mob defender)
Animation getAttackAnimation(Npc attacker, Mob defender)
void block(Mob attacker, Npc defender, Hit hit, CombatType combatType)
static final CombatStrategy< Npc >[] FULL_STRATEGIES
void finishOutgoing(Npc attacker, Mob defender)
static RangedAttack RANGED
int modifyAccuracy(Npc attacker, Mob defender, int roll)
void hit(Npc attacker, Mob defender, Hit hit)
static final CombatStrategy< Npc >[] NON_MELEE
boolean canAttack(Npc attacker, Mob defender)
Class that models a single animation used by an entity.
Represents a single graphic that can be used by entities.
A game representing a cyclic unit of work.
Represents the game world.
static void schedule(Task task)
Submits a new event.
static void sendGraphic(Graphic graphic, Position position, int instance)
Sends a graphic to the world.
A wrapper for a Hit object, adding additional variables for hit and hitsplat delays.
A Hit object holds the damage amount and hitsplat data.
static CombatProjectile getDefinition(String name)
Optional< Projectile > getProjectile()
final CombatHit nextRangedHit(T attacker, Mob defender)
CombatHit nextMeleeHit(T attacker, Mob defender)
final CombatHit nextMagicHit(T attacker, Mob defender)
boolean withinDistance(T attacker, Mob defender)
CombatStrategy< Npc > currentStrategy
NpcMagicStrategy(CombatProjectile combatProjectile)
static NpcMeleeStrategy get()
NpcRangedStrategy(CombatProjectile combatProjectile)
void animate(int animation)
void setWaypoint(Waypoint waypoint)
final boolean isPlayer()
Check if an entity is a player.
void walkExactlyTo(Position position)
Represents a non-player character in the in-game world.
Npc(int id, Position position)
void register()
Registers an entity to the World.
void unregister()
Unregisters an entity from the World.
Combat< Npc > getCombat()
The combat of the mob.
void setRespawnTime(int respawnTime)
This class represents a character controlled by a player.
boolean isActive(Prayer... prayers)
Checks if all given prayers are active.
Represents a single tile on the game world.
A static-util class that provides additional functionality for generating pseudo-random numbers.
static< T > T random(T[] array)
Pseudo-randomly retrieves a element from array.
Handles miscellaneous methods.
static Position[] getInnerBoundaries(Position position, int width, int length)
Represents different priorities for updating.
The enumerated type whose elements represent the fighting types.