# Kelvintaph Defiler - Help!

If I get him right he suggests you to do some kind of hack\trick.

I suggest you to to as required for the first run.
This level is artificially hard.
It is more about game mechanics than programming

All you need to know for beat this level

1. archers can place some hits on shamans before they cast fling\fear on them.
2. soldiers and archers can attack while in the air.
2 Likes

i know how to code this thing, but i want to figure out how to do it without doing 200 loc
im trying to see if thereās simpler solutions, so i dont spend 24 hours beating this level
btw why is the discourse so slo today

I created this code so my soldiers in Kelvintaph defiler can free the archer so they can free the paladin together

``````def findEnemy(name, friend):
enemies = friend.findEnemies()
id = name
i = 0
for i in range(len(enemies)):
enemy = enemies[i]
if id == enemy.id:
return i
else:
i += 1
``````

Iām inputting āDrunā for name and the soldierās variable for friend.
But when i run my full code, it wonāt attack its enemyā¦ Why?

``````def CommandSoldier(soldier):
if step < 4:
target = findEnemy("Drun", soldier)
if "Drun".health > 0:
hero.command(soldier, "attack", "Drun")
elif soldier.pos.x < 74:
moveStep = 0
if moveStep == 0:
hero.command(soldier, "move", {"x": 6, "y": 74})
moveStep += 1
target = findEnemy("Drun", soldier)
if target:
while target.health > 0:
hero.command(soldier, "attack", target)
if moveStep == 1:
hero.command(soldier, "move", {"x": 22, "y": 67})
moveStep += 1
target = findEnemy("Drun", soldier)
if target:
while target.health > 0:
hero.command(soldier, "attack", target)
if moveStep == 2:
hero.command(soldier, "move", {"x": 39, "y": 62})
moveStep += 1
target = findEnemy("Drun", soldier)
if target:
while target.health > 0:
hero.command(soldier, "attack", target)
else:
enemy = soldier.findNearestEnemy()
if enemy:
hero.command(soldier, "attack", enemy)
``````

thatās the code for commanding my soldier.

Never mindā¦
I finally beated the level!!
but i canāt figure out how to keep my entire squad aliveā¦
itās weird!!
i can finish the level if i sacrifice my soldiers to the yeti, but i cant if i dont sacrifice themā¦

If you are talking about the moment when Nalfar flees from you.
It is relatively easy.
Just think where is the yeti came from and what you can do about it beforehand.

1 Like

basically, i get my archers freed so they can free the soldiers.
Before Nalfar even got close to fleeing, i have to sacrafice my soldiersā¦
so likeā¦ when the soldiers get freed, i sacrifice them to the yeti, then i get my 2 archers to nalfar, and get him to swap.
and that = success.
But if i get my soldiers to stay at a specific point without sacrificing them for nothing, the level fails.

i have to command them to attack the yeti, or the level fails.
thatās what i mean.

Interesting
I just take care of the yeti beforehand.
So no one hurt.