1package com.runehive.game.world.entity.combat.effect.impl;
3import com.runehive.game.world.entity.combat.PoisonType;
4import com.runehive.game.world.entity.combat.effect.CombatEffect;
5import com.runehive.game.world.entity.combat.hit.Hit;
6import com.runehive.game.world.entity.combat.hit.HitIcon;
7import com.runehive.game.world.entity.combat.hit.Hitsplat;
8import com.runehive.game.world.entity.mob.Mob;
9import com.runehive.game.world.entity.mob.npc.definition.NpcDefinition;
10import com.runehive.game.world.entity.mob.player.Player;
11import com.runehive.game.world.items.Item;
12import com.runehive.game.world.items.containers.equipment.Equipment;
13import com.runehive.net.packet.out.SendMessage;
14import com.runehive.net.packet.out.SendPoison;
16import java.util.Optional;
35 if (
mob.getPoisonType() ==
null ||
mob.isPoisoned() ||
mob.isVenomed()) {
39 if (
mob.isNpc() &&
mob.getNpc().definition.hasPoisonImmunity()) {
43 if (
mob.isPlayer() &&
mob.getPlayer().equipment
45 .filter(helm -> helm.getId() == 13197 || helm.getId() == 13199 || helm.getId() == 12931)
57 mob.getPoisonDamage().set(
mob.getPoisonType().getDamage());
64 boolean remove =
mob.isVenomed() || !
mob.isPoisoned() ||
mob.isDead();
65 if (
remove &&
mob.isPlayer()) {
78 mob.getPoisonDamage().decrementAndGet();
84 boolean poisoned =
mob.isPoisoned();
85 if (poisoned &&
mob.isPlayer()) {
103 if (name.endsWith(
"(p)")) {
106 if (name.endsWith(
"(p+)")) {
109 if (name.endsWith(
"(p++)")) {
113 return Optional.empty();
127 if (def ==
null || !def.isAttackable() || !def.isPoisonous()) {
128 return Optional.empty();
131 if (def.getCombatLevel() < 25) {
135 if (def.getCombatLevel() < 75) {
139 if (def.getCombatLevel() < 200) {
143 if (def.getCombatLevel() < 225) {
CombatEffect(int delay)
Creates a new CombatEffect.
static Optional< PoisonType > getPoisonType(Item item)
Gets the PoisonType for item wrapped in an optional.
int amount
The amount of times this player has been hit.
boolean removeOn(Mob mob)
Removes this effect from mob if needed.
void process(Mob mob)
Provides processing for this effect on mob.
boolean onLogin(Mob mob)
Executed on login, primarily used to re-apply the effect to mob.
CombatPoisonEffect()
Creates a new CombatPoisonEffect.
boolean apply(Mob mob)
Applies this effect to mob.
static Optional< PoisonType > getPoisonType(int npc)
Gets the PoisonType for npc wrapped in an optional.
A Hit object holds the damage amount and hitsplat data.
Contains the npc definitions.
static final NpcDefinition[] DEFINITIONS
The array of npc definitions.
This class represents a character controlled by a player.
final MutableNumber getPoisonImmunity()
void send(OutgoingPacket encoder)
The container class that represents an item that can be interacted with.
The container that manages the equipment for a player.
static final int HELM_SLOT
The OutgoingPacket that sends a message to a Players chatbox in the client.
int get()
Gets the value present within this counter.
The enumerated type whose elements represent the different levels of poison.
SUPER_NPC
The strongest poison type for poisonous NPCs.
EXTRAORDINARY_NPC
self explanatory maybe?
STRONG_MELEE
The stronger poison type for melee weapons.
DEFAULT_MELEE
The default poison type for melee weapons.
SUPER_MELEE
The strongest poison type for melee weapons.
WEAK_NPC
The default poison type for poisonous NPCs.
STRONG_NPC
The stronger poison type for poisonous NPCs.
DEFAULT_NPC
The default poison type for poisonous NPCs.
The enumerated type whose elements represent the hit icon of a Hit.
NONE
Represents no hit icon at all.
POISON
Represents a poison hit type.