mirror of
https://gitlab.com/2009scape/2009scape.git
synced 2025-12-13 10:00:17 -07:00
[AI] refactor
This commit is contained in:
parent
3336f3422e
commit
686757d189
4 changed files with 4 additions and 10 deletions
|
|
@ -181,8 +181,6 @@ public class AIPlayer extends Player {
|
|||
{
|
||||
int meX = this.getLocation().getX();
|
||||
int meY = this.getLocation().getY();
|
||||
//int meX2 = this.getLocation().getX();
|
||||
//System.out.println("local " + meX + " real x? " + meX2 );
|
||||
ArrayList<Node> nodes = new ArrayList<Node>();
|
||||
for (NPC npc : RegionManager.getLocalNpcs(this, range)) {
|
||||
if (npc.getId() == entry)
|
||||
|
|
@ -399,14 +397,12 @@ public class AIPlayer extends Player {
|
|||
* @param uid The player's UID.
|
||||
*/
|
||||
public static void deregister(int uid) {
|
||||
if (!botMapping.containsKey(uid)) {
|
||||
System.err.println("Could not deregister AIP#" + uid + ": UID not added to the mapping!");
|
||||
return;
|
||||
}
|
||||
AIPlayer player = botMapping.get(uid);
|
||||
if (player != null) {
|
||||
player.clear();
|
||||
return;
|
||||
}
|
||||
System.err.println("Could not deregister AIP#" + uid + ": UID not added to the mapping!");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -13,8 +13,7 @@ public class LowestBot extends PvMBots{
|
|||
private int tick = 0;
|
||||
|
||||
@Override
|
||||
public void tick()
|
||||
{
|
||||
public void tick(){
|
||||
super.tick();
|
||||
|
||||
//Despawn
|
||||
|
|
|
|||
|
|
@ -74,8 +74,8 @@ public class PvMBots extends AIPlayer {
|
|||
if (creatures == null) {
|
||||
return false;
|
||||
}
|
||||
if (!(creatures.isEmpty())) {
|
||||
bot.attack(creatures.get(RandomFunction.getRandom((creatures.size() - 1))));
|
||||
if (!creatures.isEmpty()) {
|
||||
return true;
|
||||
} else {
|
||||
creatures = FindTargets(bot, radius);
|
||||
|
|
|
|||
|
|
@ -189,7 +189,6 @@ public final class AIPCommandPlugin extends CommandPlugin {
|
|||
PVPAIPActions.syncBotThread(player);
|
||||
return true;
|
||||
|
||||
|
||||
case "bot":
|
||||
PvMBotsBuilder.spawnLowest(player.getLocation());
|
||||
return true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue