1package com.runehive.game.world.entity.combat.magic;
3import com.runehive.net.packet.out.SendMessage;
4import com.runehive.game.world.entity.mob.Mob;
5import com.runehive.game.world.entity.mob.player.Player;
6import com.runehive.game.world.entity.skill.Skill;
7import com.runehive.game.world.items.Item;
9import java.util.Optional;
30 return Optional.empty();
34 if(attacker.
isNpc()) {
47 player.
send(
new SendMessage(
"You do not have the required equipment to cast this spell."));
MagicSpell(int level, double baseExperience, RequiredRune... runes)
Optional< Item[]> equipmentRequired()
boolean canCast(Mob attacker, Optional< Mob > defender)
final RequiredRune[] runes
final double baseExperience
final SkillManager skills
final boolean isNpc()
Check if an entity is an npc.
This class represents a character controlled by a player.
final Equipment equipment
void send(OutgoingPacket encoder)
Combat< Player > getCombat()
The combat of the mob.
Represents a trainable and usable skill.
static final int MAGIC
The magic skill id.
int getLevel(int id)
Gets the level of a skill.
final boolean containsAll(int... identifiers)
Determines if this container contains all identifiers.
The OutgoingPacket that sends a message to a Players chatbox in the client.
static boolean hasRunes(Player player, Item[] required)