Summits gate - please help me solve it!

# Fight your way into the Inner Sanctum of the ogre chieftain, and defeat her.
def attack():
    enemy = hero.findNearestEnemy()
    if enemy and enemy.type != "skeleton":
        if hero.distanceTo(enemy) < 20:
            while enemy.health > 0:
                if hero.isReady("hide"):
                    hero.hide()
                if hero.isReady("throw") and hero.distanceTo(enemy) < 10:
                    hero.throwCharge(hero.distanceTo(enemy))
                    if hero.isReady("chain-lightning"):
                        hero.cast("chain-lightning", enemy)
                if hero.isReady("scattershot"):
                    hero.scattershot()
                else:
                    hero.attack(enemy)

def move():
    flagG = hero.findFlag("green")
    if flagG:
        hero.pickUpFlag(flagG)

def summon():
    if hero.costOf("griffin-rider") <= hero.gold:
        hero.summon("griffin-rider")
    if hero.costOf("griffin-rider") <= hero.gold:
        hero.summon("griffin-rider")
    if hero.costOf("archer") <= hero.gold:
        hero.summon("archer")
    if hero.costOf("soldier") <= hero.gold:
        hero.summon("soldier")

def heal():
    paladins = hero.findByType("paladin")
    paladinIndex = 0
    if paladins:
        while paladinIndex < len(paladins):
            paladin = paladins[paladinIndex]
            currentHealth = hero.health
            healingThreshold = hero.maxHealth - 150
            paladins = hero.findByType("paladin")
            if paladin:
                if paladin.canCast("heal"):
                    hero.command(paladin, "cast", "heal", hero)
            paladinIndex += 1

def command():
    friends = hero.findFriends()
    friendIndex = 0
    while friendIndex < len(friends):
        friend = friends[friendIndex]
        enemy = friend.findNearestEnemy()
        if enemy:
            if friend:
                hero.command(friend, "attack", enemy)
        else:
            hero.command(friend, "move", {"x": hero.pos.x, "y": hero.pos.y})
        friendIndex += 1

def attack2():
    enemies = hero.findEnemies()
    enemyIndex = 0
    while enemyIndex < len(enemies):
        enemy = enemies[enemyIndex]
        summon()
        command()
        attack()
        enemyIndex += 1

while True:
    if hero.maxHealth > hero.currentHealth:
        heal()
    move()
    summon()
    command()
    attack()

This is my code… I have been solving this level for a month

BTW, do the charges kill my allies? Cause they die every time it goes near them…

Mmmm…

summon just a unit or summon list of units, because you will always summon griffin-riders

1 Like

What do you mean by a list of units?

types = ['soldier', 'archer']
1 Like

What gear are you using?

1 Like

image
this gear

I just changed my hero to Senick steelclaw but know I died while fighting the skeletons.

The warlocks buff the skeletons immensely. You need to either command your units to target them or target them yourself.

Try using shredder as long range, because it has basically infinite range if you know how to use it lol

i will recommand you use warriors.

I would recommend using your soldiers and archers to fight the skeletons, using your paladins to fight the warlocks, and having your hero wait and let your allies do all the fighting.

personally i collect the gems and summon griffs as they are tonks compared to archers and have decent kb. plus the warlocks can’t harm em cuz they fly

2 Likes