It crashed when I am killing the chieftain.
Here is my code:
# Fight your way into the Inner Sanctum of the ogre chieftain, and defeat her.
def gate1():
hero.moveXY(62, 33)
for i in range(8):
catapult = pet.findNearestByType("catapult")
if catapult:
hero.attack(catapult)
for friend in hero.findFriends():
enemy = friend.findNearestEnemy()
if enemy:
hero.command(friend, "attack", enemy)
while hero.time < 30:
for friend in hero.findFriends():
enemy = friend.findNearestEnemy()
if enemy:
hero.command(friend, "attack", enemy)
gate1()
for i in range(4):
hero.summon("archer")
while hero.time < 32:
hero.attack(hero.findNearestEnemy())
for friend in hero.findFriends():
enemy = friend.findNearestEnemy()
if enemy:
hero.command(friend, "attack", enemy)
hero.moveXY(128, 36)
while hero.time < 69:
hero.shield()
for friend in hero.findFriends():
if friend.type == "paladin":
if (friend.canCast("heal")):
hero.command(friend, "cast", "heal", hero)
elif friend.type == "archer":
hero.command(friend, "attack", hero.findNearestEnemy())
hero.moveXY(126, 29)
while hero.time < 94:
hero.shield()
for friend in hero.findFriends():
if friend.type == "paladin":
if (friend.canCast("heal")):
hero.command(friend, "cast", "heal", hero)
elif friend.type == "archer":
hero.command(friend, "attack", hero.findNearestEnemy())
hero.moveXY(170, 34)
for i in range(3):
hero.summon("griffin-rider")
hero.moveXY(173, 13)
hero.moveXY(204, 14)
hero.moveXY(245, 17)
hero.moveXY(246, 33)
hero.summon("griffin-rider")
hero.moveXY(275, 33)
hero.moveXY(277, 56)
for i in range(5):
if pet.findNearestByType("warlock"):
hero.attack(pet.findNearestByType("warlock"))
hero.moveXY(277, 16)
for i in range(5):
if pet.findNearestByType("warlock"):
hero.attack(pet.findNearestByType("warlock"))
while hero.time < 107:
hero.attack(hero.findNearestEnemy())
for friend in hero.findFriends():
if friend.type == "paladin":
if (friend.canCast("heal")):
hero.command(friend, "cast", "heal", hero)
else:
hero.command(friend, "defend", hero)
hero.moveXY(262, 12)
while hero.time < 185:
if friend.findNearestEnemy():
hero.command(friend, "attack", friend.findNearestEnemy())
hero.moveXY(277, 32)
while True:
enemy = hero.findNearestEnemy()
if enemy:
hero.attack(enemy)
for friend in friends:
hero.command(friend, "attack", enemy)