# [Solved] Kelvintaph Burgler (Paladin Movement)

``````# What eldritch artifacts are these? Don't let them blast you!
# The ice gate will open when both ogres are defeated.
cheiftan = hero.findNearest("Oniko")
yaks = hero.findByType("ice-yak")
for yak in yaks:
hero.command(paladin, "move", {'x': 54, 'y': 50})
if hero.pos.x == 50 and hero.pos.y == 24:
def move():
missiles = hero.findEnemyMissiles()
witches = hero.findByType("witch")
chieftans = hero.findByType("chieftain")
for missile in missiles:
distance = hero.distanceTo(missile)
if distance < 10:
goalPoint  = Vector(68, 14)
# Vector from goal to hero
goal = Vector.subtract(goalPoint, hero.pos)
goal = Vector.normalize(goal)
goal = Vector.multiply(goal, 10)
# Vector from hero to missile
missileVector = Vector.subtract(hero.pos, missile.pos)
missileVector = Vector.normalize(missileVector)
missileVector = Vector.multiply(missileVector, 10)
# Where to go to dodge the missile
hero.move(moveToPos)
for witch in witches:
for cheiftan in chieftans:
if witch:
hero.cast("chain-lightning", witch)
elif chieftan:
hero.cast("chain-lightning", chieftan)
while True:
move()
``````

For the vectors i did copy the one where you have to walk around the yaks, but instead it’s the missiles from the robots With this code my paladin moves back and forth after moving to (54, 50). I know it’s because it only moves to the yak if it’s on (54, 50), but I’m not sure how I can fix that. How can I fix this?

1 Like

Your hero’s moving pretty well You still need to defeat both ogres…

``````            hero.command(paladin, "move", {'x': 54, 'y': 50})
if hero.pos.x == 50 and hero.pos.y == 24:
hero.command(paladin, "move", yak.pos) // only the last command will be executed if true
// the structure to command the minions is always if, elif..., else
``````

In this case if you want to command the paladin to move to the end:

``````def commandPaladins():
hero.command(paladin, "move", {'x': 55, 'y': 39})
else:
hero.command(paladin, "move", {'x': 78, 'y': 39})
``````

PS.

`````` # cheiftan = hero.findNearest("Oniko") No !
chieftain = hero.findByType("chieftain ")

``````
3 Likes
``````# The ice gate will open when both ogres are defeated.
yaks = hero.findByType("ice-yak")
witches = hero.findByType("witch")
if witches:
for yak in yaks:
for witch in witches:
hero.command(paladin, "move", {'x': 54, 'y': 50})
if witch.health == 0:
def move():
missiles = hero.findEnemyMissiles()
witches = hero.findByType("witch")
chieftans = hero.findByType("chieftain")
for missile in missiles:
distance = hero.distanceTo(missile)
if distance < 10:
goalPoint  = Vector(68, 14)
# Vector from goal to hero
goal = Vector.subtract(goalPoint, hero.pos)
goal = Vector.normalize(goal)
goal = Vector.multiply(goal, 10)
# Vector from hero to missile
missileVector = Vector.subtract(hero.pos, missile.pos)
missileVector = Vector.normalize(missileVector)
missileVector = Vector.multiply(missileVector, 10)
# Where to go to dodge the missile
hero.move(moveToPos)
for witch in witches:
for cheiftan in chieftans:
if witch:
hero.cast("chain-lightning", witch)
elif chieftan:
hero.cast("chain-lightning", chieftan)
while True:
I changed my code a little bit, but I’m getting an error I’m not too sure what this means. It’s always helpful to understand error messages Can someone explain this?