1package com.runehive.game.world.entity.mob.npc;
3import com.runehive.game.task.impl.ForceChatEvent;
4import com.runehive.game.world.World;
5import com.runehive.game.world.entity.combat.Combat;
6import com.runehive.game.world.entity.combat.CombatType;
7import com.runehive.game.world.entity.combat.attack.listener.CombatListener;
8import com.runehive.game.world.entity.combat.attack.listener.CombatListenerManager;
9import com.runehive.game.world.entity.combat.projectile.CombatProjectile;
10import com.runehive.game.world.entity.combat.strategy.CombatStrategy;
11import com.runehive.game.world.entity.combat.strategy.npc.NpcMagicStrategy;
12import com.runehive.game.world.entity.combat.strategy.npc.NpcMeleeStrategy;
13import com.runehive.game.world.entity.combat.strategy.npc.NpcRangedStrategy;
14import com.runehive.game.world.entity.mob.Mob;
15import com.runehive.game.world.entity.mob.npc.definition.NpcDefinition;
16import com.runehive.util.parser.impl.NpcForceChatParser;
18import java.util.Optional;
49 if (listener !=
null) {
50 combat.addListener(listener);
58 for (
int index = 0; index <
npc.definition.getSkills().length; index++) {
59 npc.skills.setNpcMaxLevel(index,
npc.definition.getSkills()[index]);
69 if (!
npc.definition.getCombatAttackData().isPresent()) {
70 return Optional.empty();
80 throw new AssertionError(
"Could not find ranged projectile for Mob[id=" +
npc.id +
", name=" +
npc.getName() +
"]");
87 throw new AssertionError(
"Could not find magic projectile for Mob[id=" +
npc.id +
", name=" +
npc.getName() +
"]");
94 return Optional.empty();
100 npc.skills.restoreAll();
101 npc.getCombat().reset();
108 if (forcedMessage.getId() ==
npc.id) {
An randomevent which starts the forced message randomevent.
Represents the game world.
static void schedule(Task task)
Submits a new event.
static final Map< Integer, CombatListener< Npc > > NPC_LISTENERS
static NpcMeleeStrategy get()
boolean pathfinderProjectiles
NpcAssistant(Npc npc)
Creates a new NpcAssistant
void setEvent()
Handles setting all the events for the npc.
static Optional< CombatStrategy< Npc > > loadStrategy(Npc npc)
void respawn()
Handles the npc respawning.
void login()
Handles initializing all the npc assistant methods on login.
static boolean isDragon(int id)
Represents a non-player character in the in-game world.
static final int[] ARMADYL
static final int[] BOSSES
static final int[] ZAMORAK
static final int[] DRAGONS
static final int[] SARADOMIN
static final Map< Integer, Supplier< CombatStrategy< Npc > > > STRATEGIES
static final int[] BANDOS
Contains the npc definitions.
static NpcDefinition get(int id)
Gets a npc definition from the definition array.
The forced message class.
Parses through the npc spawn file and creates Npcs on startup.
static final Map< Position, ForcedMessage > FORCED_MESSAGES
The map containing all the forced messages.
A combat attack is used to describe what the attacking and defending mobs should do in each stage of ...