RuneHive-Game
Loading...
Searching...
No Matches
CombatObjective.java
Go to the documentation of this file.
1
package
com.runehive.content.bot.objective.impl;
2
3
import
com.runehive.content.bot.BotUtility;
4
import
com.runehive.content.bot.PlayerBot;
5
import
com.runehive.content.bot.objective.BotObjectiveListener;
6
import
com.runehive.game.world.entity.mob.player.Player;
7
import
com.runehive.util.Utility;
8
9
public
class
CombatObjective
implements
BotObjectiveListener
{
10
11
@Override
12
public
void
init
(
PlayerBot
bot
) {
13
Player
opponent = (
Player
)
bot
.getCombat().getLastAggressor();
14
bot
.botClass.initCombat(opponent,
bot
);
15
bot
.getCombat().attack(opponent);
16
bot
.speak(
Utility
.
randomElement
(
BotUtility
.
FIGHT_START_MESSAGES
));
17
bot.opponent = opponent;
18
}
19
20
@Override
21
public
void
finish
(
PlayerBot
bot
) {
22
}
23
24
}
com.runehive.content.bot.BotUtility
Holds all the constants used by bot.
Definition
BotUtility.java:19
com.runehive.content.bot.BotUtility.FIGHT_START_MESSAGES
static final String[] FIGHT_START_MESSAGES
Array of all the possible fight start message.
Definition
BotUtility.java:65
com.runehive.content.bot.PlayerBot
The player bot entity.
Definition
PlayerBot.java:29
com.runehive.content.bot.objective.impl.CombatObjective
Definition
CombatObjective.java:9
com.runehive.content.bot.objective.impl.CombatObjective.finish
void finish(PlayerBot bot)
Definition
CombatObjective.java:21
com.runehive.content.bot.objective.impl.CombatObjective.init
void init(PlayerBot bot)
Definition
CombatObjective.java:12
com.runehive.game.world.entity.mob.player.Player
This class represents a character controlled by a player.
Definition
Player.java:125
com.runehive.util.Utility
Handles miscellaneous methods.
Definition
Utility.java:27
com.runehive.util.Utility.randomElement
static< T > T randomElement(Collection< T > collection)
Picks a random element out of any array type.
Definition
Utility.java:248
com.runehive.content.bot.objective.BotObjectiveListener
Definition
BotObjectiveListener.java:5
com.runehive.content.bot