1package com.runehive.game.world.entity.combat.strategy.npc.boss;
3import com.runehive.game.Animation;
4import com.runehive.game.Graphic;
5import com.runehive.game.Projectile;
6import com.runehive.game.UpdatePriority;
7import com.runehive.game.task.Task;
8import com.runehive.game.world.World;
9import com.runehive.game.world.entity.combat.CombatType;
10import com.runehive.game.world.entity.combat.hit.CombatHit;
11import com.runehive.game.world.entity.combat.hit.Hit;
12import com.runehive.game.world.entity.combat.hit.HitIcon;
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.npc.Npc;
21import com.runehive.game.world.entity.mob.player.Player;
22import com.runehive.game.world.entity.mob.prayer.Prayer;
23import com.runehive.game.world.entity.skill.Skill;
24import com.runehive.game.world.position.Area;
25import com.runehive.game.world.position.Position;
26import com.runehive.util.Utility;
28import java.util.ArrayList;
29import java.util.Arrays;
30import java.util.Collections;
33import static com.runehive.game.world.entity.combat.CombatUtil.createStrategyArray;
34import static com.runehive.game.world.entity.combat.CombatUtil.randomStrategy;
51 boolean spawnedLava = attacker.
attributes.
is(
"CERBERUS_LAVA");
52 boolean spawnedGhost = attacker.
attributes.
is(
"CERBERUS_GHOST");
56 }
else if (attacker.
getCurrentHealth() <= 400 && !spawnedGhost && random > 14) {
103 Prayer finalOverhead = overhead;
115 skill.modifyLevel(level -> level - drain, 0,
skill.getLevel());
120 if (
hit.getDamage() != 0) {
132 List<Npc> ghosts =
new ArrayList<>(3);
138 Collections.shuffle(ghosts);
140 ghosts.get(1).setPosition(
new Position(1240, 1265));
141 ghosts.get(2).setPosition(
new Position(1241, 1265));
142 ghosts.get(0).register();
143 ghosts.get(1).register();
144 ghosts.get(2).register();
146 attacker.
speak(
"Aaarrrooooooooo");
151 private boolean possible() {
152 return attacker !=
null
156 && !defender.inTeleport
164 protected void execute() {
171 ghosts.get(0).walk(
new Position(ghosts.get(0).getX(), ghosts.get(0).getY() - 9),
true);
172 ghosts.get(1).walk(
new Position(ghosts.get(1).getX(), ghosts.get(1).getY() - 9),
true);
173 ghosts.get(2).walk(
new Position(ghosts.get(2).getX(), ghosts.get(2).getY() - 9),
true);
174 }
else if (count == 13) {
176 }
else if (count == 16) {
177 ghosts.get(0).walk(
new Position(ghosts.get(0).getX(), ghosts.get(0).getY() + 9),
true);
179 }
else if (count == 19) {
180 ghosts.get(1).walk(
new Position(ghosts.get(1).getX(), ghosts.get(1).getY() + 9),
true);
182 }
else if (count == 21) {
183 ghosts.get(2).walk(
new Position(ghosts.get(2).getX(), ghosts.get(2).getY() + 9),
true);
184 }
else if (count == 40) {
191 protected void onCancel(
boolean logout) {
192 for (
Npc ghost : ghosts) {
222 List<Position> positions = Arrays.asList(boundaries);
223 Collections.shuffle(positions);
225 attacker.
speak(
"Grrrrrrrrrrrrrr");
239 protected void execute() {
242 }
else if (count == 19) {
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.
void setPosition(Position position)
A wrapper for a Hit object, adding additional variables for hit and hitsplat delays.
A Hit object holds the damage amount and hitsplat data.
void setAccurate(boolean accurate)
static CombatProjectile getDefinition(String name)
final CombatHit nextMagicHit(T attacker, Mob defender)
CombatStrategy< Npc > currentStrategy
NpcMagicStrategy(CombatProjectile combatProjectile)
static NpcMeleeStrategy get()
NpcRangedStrategy(CombatProjectile combatProjectile)
void special(Npc ghost, Mob other, Npc attacker)
void block(Mob attacker, Npc defender, Hit hit, CombatType combatType)
CombatHit[] getHits(Npc attacker, Mob defender)
void start(Npc attacker, Mob defender, Hit[] hits)
void hit(Npc attacker, Mob defender, Hit hit)
void hit(Npc attacker, Mob defender, Hit hit)
void block(Mob attacker, Npc defender, Hit hit, CombatType combatType)
Task lavaTask(Npc attacker, Mob defender, Position position)
CombatHit[] getHits(Npc attacker, Mob defender)
void start(Npc attacker, Mob defender, Hit[] hits)
CombatHit[] getHits(Npc attacker, Mob defender)
Animation getAttackAnimation(Npc attacker, Mob defender)
Animation getAttackAnimation(Npc attacker, Mob defender)
CombatHit[] getHits(Npc attacker, Mob defender)
static final CombatStrategy< Npc >[] FULL_STRATEGIES
static final LavaAttack LAVA
static final MagicAttack MAGIC
static final GhostAttack GHOST
boolean canAttack(Npc attacker, Mob defender)
static final RangedAttack RANGED
boolean locked()
Checks if the mob is locked.
final SkillManager skills
void writeDamage(Hit hit)
void speak(String forceChat)
Sets the mob's forced chat.
final GenericAttributes attributes
void animate(int animation)
void face(GameObject object)
Sets the client update flag to face a certain direction.
final boolean isPlayer()
Check if an entity is a player.
Represents a non-player character in the in-game world.
This class represents a character controlled by a player.
final Equipment equipment
boolean isActive(Prayer... prayers)
Checks if all given prayers are active.
Represents a trainable and usable skill.
static final int PRAYER
The prayer skill id.
Skill get(int id)
Gets the skill for an id.
void refresh()
Refreshes all the skills for the mob.
boolean contains(int[] bowsWithNoArrowsRequired)
Handles checking if mobs are in a certain area.
static boolean inCerberus(Interactable entity)
Represents a single tile on the game world.
boolean isWithinDistance(Position other, int radius)
Checks if this location is within range of another.
boolean equals(Object obj)
static Position create(int x, int y, int z)
Creates a location.
Handles miscellaneous methods.
static int random(int bound)
static Position[] getInnerBoundaries(Position position, int width, int length)
public< K > boolean is(K key)
Gets the state of a key.
public< K, E > void set(K key, E attribute)
Sets a generic attribute.
Represents different priorities for updating.
VERY_HIGH
A very high priority.
The enumerated type whose elements represent the hit icon of a Hit.
MELEE
Represents the melee sword hit icon.
RANGED
Represents the ranged bow hit icon.
MAGIC
Represents the magic hat hit icon.