Kelvintaph Defiler Level Help

I have no clear idea of what to do in this level. Here is my code:

# The ogres are trapping you with their dark rituals!
# Your hero can't do anything besides command and move without angering the warlocks.
# Beware ice, robots, traps, antigravity fields, and other dark magic.
# Somehow, you'll need to defeat Nalfar and save your paladin.
# The great treasure of Kelvintaph awaits your victory.
stage = 1
necromancer = hero.findByType("necromancer")[0]
yeti = hero.findByType("yeti")[0]
def findThang(id, thangs):
    for thang in thangs:
        if thang.id == id:
            return thang
def seeIfThangExists(id, thangs):
    for thang in thangs:
        if thang.id == id:
            return True
    return False

killed_gror = False
friend_attacks_gror = {}
for friend in hero.findFriends():
    friend_attacks_gror[friend.id] = False
def commandBrian():
    for friend in hero.findFriends():
        if friend.id == "Brian" and yeti:
            if yeti.pos.x < 37 and yeti.pos.y < 56:
                hero.command(friend, "attack", yeti)
def commandTroopStage1():
    for friend in hero.findFriends():
        if friend.id != "Brian":
            if not killed_gror and friend_attacks_gror[friend.id] == False:
                enemy = "Gror"
                if friend.distanceTo(enemy) < 6:
                    hero.command(friend, "attack", enemy)
                    friend_attacks_gror[friend.id] = True
                if seeIfThangExists("Gror", hero.findEnemies()) == False:
                    killed_gror = True
                    global killed_gror
def commandTroopStage2():
    for friend in hero.findFriends():
        if friend.id != "Brian":
            if friend.type == "paladin":
                if necromancer and friend.distanceTo(necromancer) < 10:
                    if friend.canCast("heal"):
                        hero.command(friend, "attack", target)
                    else:
                        hero.command(friend, "shield")
while True:
    commandBrian()
    hero.move(Vector(34, 8))
    commandTroopStage1()
    if len(hero.findByType("robot-walker")) == 0:
        break
hero.say("Stopped.")
while True:
    commandBrian()
    if stage == 1:
        commandTroopStage1()
    if killed_gror and stage == 1:
        stage = 2
    if stage == 2:
        commandTroopStage2()

For some reason, my girl soldier overpowers the last shaman (doesn’t kill shaman) and escapes, but I still have trouble, even when my girl soldier kills the second shaman,
it doesn’t move on to the next stage.
Photos:



The paladin is not shielding!

                    if friend.canCast("heal"):
                        hero.command(friend, "attack", target)

Your paladin never heals, he can always can cast heal, so he only attacks

This topic was automatically closed 12 hours after the last reply. New replies are no longer allowed.