Kithgard Brawl Round 3

Hi is there an enemy.type command to target the large enemies?

I want to build something like this

while (true) {
    var enemy = hero.findNearestEnemy();
    var distance = hero.distanceTo(enemy);
    var item = hero.findNearestItem();
    if (item && item.type == "potion") {
        hero.moveXY(item.pos.x, item.pos.y);
    } else {
        if (enemy.type() && distance < 30 && hero.isReady("bash")) {
            hero.bash(enemy);
        } else if (enemy && hero.isReady("cleave") && distance < 10) {
            hero.cleave(enemy);
        } else if (enemy) {
            hero.attack(enemy);
        }
    }
}
if (enemy.type=='whatever type of enemy you want to target here'){
  #do stuff
}
1 Like