1package com.runehive.game.world.entity.mob.prayer;
3import com.google.common.collect.ImmutableList;
4import com.google.common.collect.ImmutableSet;
5import com.runehive.game.world.entity.combat.attack.listener.CombatListener;
6import com.runehive.game.world.entity.combat.attack.listener.other.prayer.AuguryListener;
7import com.runehive.game.world.entity.combat.attack.listener.other.prayer.ChivalryListener;
8import com.runehive.game.world.entity.combat.attack.listener.other.prayer.PietyListener;
9import com.runehive.game.world.entity.combat.attack.listener.other.prayer.RigourListener;
10import com.runehive.game.world.entity.combat.attack.listener.other.prayer.attack.ClarityOfThoughtListener;
11import com.runehive.game.world.entity.combat.attack.listener.other.prayer.attack.ImprovedReflexesListener;
12import com.runehive.game.world.entity.combat.attack.listener.other.prayer.attack.IncredibleReflexesListener;
13import com.runehive.game.world.entity.combat.attack.listener.other.prayer.defence.RockSkinListener;
14import com.runehive.game.world.entity.combat.attack.listener.other.prayer.defence.SteelSkinListener;
15import com.runehive.game.world.entity.combat.attack.listener.other.prayer.defence.ThickSkinListener;
16import com.runehive.game.world.entity.combat.attack.listener.other.prayer.magic.MysticLoreListener;
17import com.runehive.game.world.entity.combat.attack.listener.other.prayer.magic.MysticMightListener;
18import com.runehive.game.world.entity.combat.attack.listener.other.prayer.magic.MysticWillListener;
19import com.runehive.game.world.entity.combat.attack.listener.other.prayer.ranged.EagleEyeListener;
20import com.runehive.game.world.entity.combat.attack.listener.other.prayer.ranged.HawkEyeListener;
21import com.runehive.game.world.entity.combat.attack.listener.other.prayer.ranged.SharpListener;
22import com.runehive.game.world.entity.combat.attack.listener.other.prayer.strength.BurstOfStrengthListener;
23import com.runehive.game.world.entity.combat.attack.listener.other.prayer.strength.SuperhumanStrengthListener;
24import com.runehive.game.world.entity.combat.attack.listener.other.prayer.strength.UltimateStrengthListener;
25import com.runehive.game.world.entity.mob.Mob;
26import com.runehive.game.world.entity.mob.player.Player;
27import com.runehive.game.world.entity.mob.player.PlayerRight;
28import com.runehive.game.world.entity.skill.Skill;
29import com.runehive.net.packet.out.SendConfig;
30import com.runehive.net.packet.out.SendMessage;
66 CHIVALRY(
"Chivalry", 60, 24, 706, 655, 19825,
new ChivalryListener(),
Type.
OFFENSIVE,
Type.
AGGRESSIVE,
Type.
DEFENSIVE),
67 PIETY(
"Piety", 70, 24, 707, 656, 19827,
new PietyListener(),
Type.
OFFENSIVE,
Type.
AGGRESSIVE,
Type.
DEFENSIVE),
68 RIGOUR(
"Rigour", 74, 24, 710, 657, 28004,
new RigourListener(),
Type.
OFFENSIVE,
Type.
DEFENSIVE,
Type.
AGGRESSIVE),
111 this.listener =
null;
137 return Arrays.stream(values()).filter(p -> p.getButton() ==
button).findAny();
168 private static final Collection<Prayer> OFFENSIVE = ImmutableList.of(
169 CLARITY_OF_THOUGHT, IMPROVED_REFLEXES, INCREDIBLE_REFLEXES,
170 SHARP_EYE, HAWK_EYE, EAGLE_EYE,
171 MYSTIC_WILL, MYSTIC_LORE, MYSTIC_MIGHT,
172 CHIVALRY, PIETY, RIGOUR, AUGURY
175 private static final Collection<Prayer>
AGGRESSIVE = ImmutableList.of(
182 private static final Collection<Prayer>
DEFENSIVE = ImmutableList.of(
187 public static final Collection<Prayer>
OVERHEAD = ImmutableList.of(
199 return Arrays.stream(
getTypes()).anyMatch(other -> type == other);
210 Set<Prayer> deactivate =
new HashSet<>();
212 deactivate.addAll(
forType(type));
219 if(
player.equipment.getId(0) == 25438)
221 if(
player.equipment.getId(4) == 25434)
223 if(
player.equipment.getId(7) == 25436)
225 if(
player.equipment.getId(10) == 25440)
228 if(
player.equipment.containsAll(25438, 25434, 25436, 25440))
271 if (message !=
null) {
277 return Optional.ofNullable(
listener);
314 static final Set<Prayer>
EMPTY = ImmutableSet.of();
This class represents a character controlled by a player.
Represents a trainable and usable skill.
static final int PRAYER
The prayer skill id.
static final int DEFENCE
The defence skill id.
The OutgoingPacket responsible for changing settings on a client.
The OutgoingPacket that sends a message to a Players chatbox in the client.
Holds all the player right data.
static boolean isAdministrator(Player player)
Checks if the player is a privileged member.
final int config
The prayer config id.
void reset(Player player, String message)
Resets the configs for this prayer.
final int qConfig
The quick-prayer config id.
static final Set< Prayer > EMPTY
boolean canToggle(Player player)
static double getBonus(Player player)
static final Collection< Prayer > OVERHEAD
static final Collection< Prayer > OFFENSIVE
boolean is(Type type)
Checks if a prayer is of a certain type.
Set< Prayer > toDeactivate()
Gets the prayers to disable after activating this prayer.
Optional< CombatListener< Mob > > getListener()
final Type[] types
The prayer type.
final int button
The button id.
final int level
The required prayer level.
Collection< Prayer > forType(Type type)
Prayer(String name, int level, int drainRate, int config, int qConfig, int button, CombatListener< Mob > listener, Type... types)
Constructs a new default prayer book.
final String name
The name of the prayer.
Prayer(String name, int level, int drainRate, int config, int qConfig, int button, Type... types)
Constructs a new default prayer book.
void reset(Player player)
static final Collection< Prayer > AGGRESSIVE
final int drainRate
The prayer drain rate.
static final Collection< Prayer > DEFENSIVE
final CombatListener< Mob > listener
The listener.
static Optional< Prayer > forButton(int button)
Streams for the prayer button.
A combat attack is used to describe what the attacking and defending mobs should do in each stage of ...