Air Bridge In Sarven Desert


#1

I need help on Air Bridge in the desert. I get the Fight code right, but it doesn’t drop the munchkin.
Here’s my code

Help peasants to escape.

def onSpawn(event):
# We need to save three peasants.
remainingPeasants = 3
while remainingPeasants > 0:
# Take a good position.
pet.moveXY(40, 55)
peasant = pet.findNearestByType(“peasant”)
if peasant:
# Carry the peasant to the center passage.
pet.carryUnit(peasant, 40, 34)
remainingPeasants -= 1
munchkin = pet.findNearestByType(“munchkin”)
# Carry a munchkin to the fire traps:
pet.carryUnit(munchkin, 40, 17)

pet.on(“spawn”, onSpawn)

Fight!

while True:
enemy = hero.findNearestEnemy()
if enemy:
while enemy.health >= 0:
hero.attack(enemy)


#2

Sorry i have to re frormat it. Here

Help peasants to escape.

def onSpawn(event):
    # We need to save three peasants.
    remainingPeasants = 3
    while remainingPeasants > 0:
        # Take a good position.
        pet.moveXY(40, 55)
        peasant = pet.findNearestByType("peasant")
        if peasant:
            # Carry the peasant to the center passage.
            pet.carryUnit(peasant, 40, 34)
            remainingPeasants -= 1
    munchkin = pet.findNearestByType("munchkin")
    # Carry a munchkin to the fire traps:
    pet.carryUnit(munchkin, 40, 17)

pet.on("spawn", onSpawn)

# Fight!
while True:
    enemy = hero.findNearestEnemy()
    if enemy:
        while enemy.health >= 0:
            hero.attack(enemy)

#3

“it doesn’t drop the munchkin”? - I pass the level with your code


I suppose you get a similar picture?
Try submitting several times and if you fail you can get a victim by id if your hero kills the munchkin…
Or use a knight if you fight with a subscriber hero…


#4

how would i get a victim by id? You have to drop the munchkin on the firebombs.


#5

Do if enemy.id=='[Name]'


#6

Nope. it doesnt work


#7

Chaboi, have you saved the two soldiers? I passed the level long time ago and then I succeeded to save only one of them. I must do it …
@mr_javascript post a picture of the grffin last action.


#8

it puts the third peasant in the behind the hero. then it goes to the hero fighting monsters and just hovers there. It may be because the hero is killing all the munchkins before the griffin can get them.


#9

No the griffin has an expression for the thangs it can carry. It’s something like hero.maxHealth/5 or something. So in conclusion the griffin can’t carry the hero.


#10

So choose one of the munchkins from the lower left corner
if enemy.id==‘Dobo’
or
if enemy.id==‘Palt’


#11

You can perhaps somehow launch yourself with firetraps across the river. :man_shrugging:


#12

I thought that I’m the only one knowing this trick… Just kidding :slight_smile:


#13

Maybe use a hero with little mass, like Ritic, and do it. Two firetraps will launch you quite far…


#14

The knights are also good aviators - I’ve made some experiments with them… :slight_smile:


#15

it is
pet.carryUnit()


#16

#StopGlitchAbuse!!!