1package com.runehive.content.bot.botclass.impl;
3import com.runehive.content.bot.PlayerBot;
4import com.runehive.content.bot.botclass.BotClass;
5import com.runehive.content.consume.FoodData;
6import com.runehive.content.consume.PotionData;
7import com.runehive.content.skill.impl.magic.spell.impl.Vengeance;
8import com.runehive.game.event.impl.ItemClickEvent;
9import com.runehive.game.world.entity.combat.CombatType;
10import com.runehive.game.world.entity.combat.attack.FightType;
11import com.runehive.game.world.entity.combat.attack.listener.SimplifiedListener;
12import com.runehive.game.world.entity.combat.hit.Hit;
13import com.runehive.game.world.entity.mob.Mob;
14import com.runehive.game.world.entity.mob.player.Player;
15import com.runehive.game.world.entity.mob.prayer.Prayer;
16import com.runehive.game.world.entity.skill.Skill;
17import com.runehive.game.world.items.Item;
18import com.runehive.util.RandomUtils;
19import plugin.click.item.EatFoodPlugin;
21import java.util.concurrent.TimeUnit;
23import static com.runehive.game.world.entity.combat.attack.FormulaFactory.getModifiedMaxHit;
58 return new int[] { 75, 45, 99, 99, 1, 52, 1 };
65 bot.getCombat().addListener(
this);
74 bot.speak(
"Let's smite then...");
80 bot.speak(
"That's not fair...");
81 bot.getCombatSpecial().disable(
bot,
false);
91 if (
bot.spellCasting.vengeanceDelay.elapsedTime(TimeUnit.SECONDS) >= 30) {
104 max = attacker.
getCombat().modifyDamage(defender, max);
112 if (!combo && !lowHp)
116 bot.schedule(4, () -> {
117 if (
bot.equipment.getWeapon().matchesId(4587)) {
120 int index =
bot.inventory.computeIndexForId(21103);
121 bot.equipment.equip(index);
124 int index =
bot.inventory.computeIndexForId(5698);
125 bot.equipment.equip(index);
131 bot.getCombatSpecial().enable(
bot);
133 bot.schedule(4, () -> {
134 if (!
bot.isSpecialActivated() &&
bot.equipment.getWeapon().matchesId(5698)) {
135 int idx =
bot.inventory.computeIndexForId(4587);
136 bot.equipment.equip(idx);
137 idx =
bot.inventory.computeIndexForId(8850);
138 bot.equipment.equip(idx);
150 if (!
bot.potionDelay.elapsed(1250)) {
158 int index =
bot.inventory.computeIndexForId(3024);
167 int index =
bot.inventory.computeIndexForId(12695);
179 if (
bot.getCurrentHealth() >
bot.getMaximumHealth() * 0.45 && max <
bot.getCurrentHealth())
185 int index =
bot.inventory.computeIndexForId(391);
191 if (
bot.getCurrentHealth() >=
bot.getMaximumHealth() * 0.35)
194 index =
bot.inventory.computeIndexForId(3144);
203 if (defender.
getCombat().isAttacking() && !defender.
getCombat().isAttacking(attacker)) {
204 attacker.
getPlayer().
message(
"You cannot attack a bot while they are attacking another player.");
216 return bot.skills.getLevel(
id) < minimum;
void pot(Player target, PlayerBot bot)
void hit(Player attacker, Mob defender, Hit hit)
void eat(Player target, PlayerBot bot)
boolean canOtherAttack(Mob attacker, Player defender)
boolean checkSkill(PlayerBot bot, int id, int minimum)
void handleCombat(Player target, PlayerBot bot)
void initCombat(Player target, PlayerBot bot)
void endFight(PlayerBot bot)
void block(Mob attacker, Player defender, Hit hit, CombatType combatType)
Handles the vengeance spell.
A Hit object holds the damage amount and hitsplat data.
int getMaxHit(Mob defender, CombatType type)
Gets the max hit of a combat type.
This class represents a character controlled by a player.
final Inventory inventory
CombatStrategy< Player > getStrategy()
The combat strategy of the mob.
void message(String message)
MutableNumber getSpecialPercentage()
Combat< Player > getCombat()
The combat of the mob.
final PlayerAssistant playerAssistant
boolean isActive(Prayer... prayers)
Checks if all given prayers are active.
Represents a trainable and usable skill.
static final int PRAYER
The prayer skill id.
static final int DEFENCE
The defence skill id.
static final int ATTACK
The attack skill id.
static final int STRENGTH
The strength skill id.
The container class that represents an item that can be interacted with.
A static-util class that provides additional functionality for generating pseudo-random numbers.
static int inclusive(int min, int max)
Returns a pseudo-random int value between inclusive min and inclusive max.
static boolean success(double value)
Determines if a pseudorandomly generated double rounded to two decimal places is below or equal to va...
The enumerated type managing consumable potion types.
The enumerated type whose elements represent the fighting types.