Made it so bots don't spawn unless someone tries to play

This commit is contained in:
dginovker 2020-03-27 23:23:19 -04:00
parent 3338a6343a
commit 8505559acf
2 changed files with 8 additions and 3 deletions

View file

@ -40,9 +40,6 @@ public class ResourceAIPManager {
public void immerseWorld() { //There's probably a better place for this (it adds bot at bootup)
PvMBotsBuilder.immersiveSpawns();
LumbridgeBotHandler.immersiveLumbridge();
for (int pestBotsAmount = 0; pestBotsAmount < 20; pestBotsAmount++) {
PvMBotsBuilder.createPestControlTestBot(new Location(2657, 2640));
}
//SkillingBotsBuilder.immersiveSpawnsSkillingBots();
System.out.println("Loaded immerseWorld");
}

View file

@ -5,6 +5,7 @@ import org.crandor.game.content.activity.ActivityManager;
import org.crandor.game.interaction.OptionHandler;
import org.crandor.game.node.Node;
import org.crandor.game.node.entity.player.Player;
import org.crandor.game.node.entity.player.ai.pvmbots.PvMBotsBuilder;
import org.crandor.game.node.entity.player.info.Rights;
import org.crandor.game.node.item.Item;
import org.crandor.game.node.object.GameObject;
@ -21,6 +22,8 @@ import org.crandor.plugin.Plugin;
*/
public final class PCObjectHandler extends OptionHandler {
public boolean pcbotsSpawned = false;
@Override
public Plugin<Object> newInstance(Object arg) throws Throwable {
// Barricades
@ -91,6 +94,11 @@ public final class PCObjectHandler extends OptionHandler {
}
switch (object.getId()) {
case 14315: // Novice
if (!pcbotsSpawned) {
for (int pestBotsAmount = 0; pestBotsAmount < 20; pestBotsAmount++) {
PvMBotsBuilder.createPestControlTestBot(new Location(2657, 2640));
}
}
startActivity(player, "pest control novice", Location.create(2661, 2639, 0));
return true;
case 25631: // Intermediate