1package com.runehive.game.world.entity.combat.strategy.player.custom;
3import com.runehive.Config;
4import com.runehive.game.Animation;
5import com.runehive.game.Graphic;
6import com.runehive.game.UpdatePriority;
7import com.runehive.game.world.entity.combat.CombatType;
8import com.runehive.game.world.entity.combat.attack.FightType;
9import com.runehive.game.world.entity.combat.hit.CombatHit;
10import com.runehive.game.world.entity.combat.hit.Hit;
11import com.runehive.game.world.entity.combat.projectile.CombatProjectile;
12import com.runehive.game.world.entity.combat.strategy.basic.MagicStrategy;
13import com.runehive.game.world.entity.mob.Mob;
14import com.runehive.game.world.entity.mob.player.Player;
15import com.runehive.game.world.entity.mob.player.PlayerRight;
16import com.runehive.game.world.entity.skill.Skill;
17import com.runehive.game.world.items.Item;
18import com.runehive.game.world.items.containers.equipment.Equipment;
19import com.runehive.net.packet.out.SendMessage;
28 }
catch (Exception e) {
36 attacker.
send(
new SendMessage(
"You can't attack players with this weapon."));
51 PROJECTILE.getAnimation().ifPresent(animation -> attacker.
animate(animation,
true));
52 PROJECTILE.getStart().ifPresent(attacker::graphic);
53 int projectileDuration =
PROJECTILE.sendProjectile(attacker, defender);
55 if (endGraphic !=
null) {
61 int exp = 2 *
hit.getDamage();
79 int animation = attacker.
getCombat().getFightType().getAnimation();
85 return attacker.
getCombat().getFightType().getDelay();
98 max += (level - 75) / 3;
The class that contains setting-related constants for the server.
static final double COMBAT_MODIFICATION
The experience modification for combat.
Class that models a single animation used by an entity.
Represents a single graphic that can be used by entities.
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)
static boolean missed(final Hit... hits)
final CombatHit nextMagicHit(T attacker, Mob defender)
static Graphic getEndGraphic(final CombatProjectile combatProjectile, final boolean splash, final Graphic splashGraphic)
static final Graphic SPLASH
The spell splash graphic.
Animation getAttackAnimation(Player attacker, Mob defender)
CombatHit[] getHits(Player attacker, Mob defender)
int getAttackDistance(Player attacker, FightType fightType)
CombatType getCombatType()
void start(Player attacker, Mob defender, Hit[] hits)
int getAttackDelay(Player attacker, Mob defender, FightType fightType)
void attack(Player attacker, Mob defender, Hit hit)
static final TumekenStrategy INSTANCE
static CombatProjectile PROJECTILE
boolean canAttack(Player attacker, Mob defender)
void hit(Player attacker, Mob defender, Hit hit)
final SkillManager skills
void animate(int animation)
final boolean isPlayer()
Check if an entity is a player.
Optional< Graphic > graphic
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.
static final int HITPOINTS
The hitpoints skill id.
void addExperience(int id, double experience)
Adds experience to a given skill.
int getLevel(int id)
Gets the level of a skill.
The container class that represents an item that can be interacted with.
final Item get(int index)
Gets the Item located on index.
The container that manages the equipment for a player.
static final int WEAPON_SLOT
The OutgoingPacket that sends a message to a Players chatbox in the client.
Represents different priorities for updating.
The enumerated type whose elements represent the fighting types.
Holds all the player right data.
static boolean isOwner(Player player)
static boolean isIronman(Player player)
Checks if the player is an ironman.