[SOLVED] Rebellion level help PLZ

Hi, i just found this level called rebellion and i cant beat it. Illia has 8000HP!
here is my code:

enemy = hero.findNearestEnemy()
while True:
    hero.shield()
    if enemy:
        hero.attack(enemy)
    elif pet.isReady("shape-shift"):
        pet.shapeShift()
    elif hero.canCast("drain-life", target):
        hero.cast("drain-life", enemy)
    elif hero.canCast("chain-lightning", target):
        hero.cast("chain-lightning", enemy)
    elif hero.canCast("earthskin", target):
        hero.cast("earthskin", hero)
    elif hero.isReady("bash"):
        hero.bash(enemy)

Here is the link:

also, how do your change your equipment?

I know that you now know how to change the equipment thanks to @Deadpool198. What hero qnd what gear are you using?

Andrei

Im using the best gear and tharin.
PS: wanted to change my code to building bear traps so here it is:
PPS: did not steal this idea from you

hero.wait(5.8)
hero.buildXY("bear-trap", 12, 27)
hero.buildXY("bear-trap", 13, 27)
hero.buildXY("bear-trap", 12, 28)
hero.buildXY("bear-trap", 13, 28)
hero.buildXY("bear-trap", 14, 27)
hero.buildXY("bear-trap", 13, 28)
hero.buildXY("bear-trap", 15, 28)
hero.buildXY("bear-trap", 15, 27)

hero.moveXY(12, 14)
hero.moveXY(49, 27)


Do you have the belt that builds bear traps equiped?

Andrei

yup, how much do paladins cost?

80 gold each. But try to summon archers because of the better damage and build the bear traps in a while true loop.

Andrei

Screenshot 2020-07-15 at 11.17.46
my equipment
new code:

# Should fill in some default source
hero.wait(5.8)
hero.buildXY("bear-trap", 12, 27)
hero.buildXY("bear-trap", 13, 27)
hero.buildXY("bear-trap", 12, 28)
hero.buildXY("bear-trap", 13, 28)
hero.buildXY("bear-trap", 14, 27)
hero.buildXY("bear-trap", 13, 28)
hero.buildXY("bear-trap", 15, 28)
hero.buildXY("bear-trap", 15, 27)
hero.buildXY("bear-trap", 14, 28)
hero.buildXY("bear-trap", 13, 26)
hero.buildXY("bear-trap", 15, 26)
hero.buildXY("bear-trap", 15, 25)
hero.buildXY("bear-trap", 14, 26)
hero.moveXY(12, 14)
hero.moveXY(20, 27)
hero.buildXY("bear-trap", 15, 28)
hero.buildXY("bear-trap", 17, 28)
hero.buildXY("bear-trap", 17, 27)
hero.buildXY("bear-trap", 16, 28)
hero.moveXY(25, 27)
hero.buildXY("bear-trap", 17, 28)
hero.buildXY("bear-trap", 19, 28)
hero.buildXY("bear-trap", 19, 27)
hero.buildXY("bear-trap", 18, 28)
hero.moveXY(30, 27)
hero.buildXY("bear-trap", 19, 28)
hero.buildXY("bear-trap", 21, 28)
hero.buildXY("bear-trap", 21, 27)
hero.buildXY("bear-trap", 20, 28)
hero.buildXY("bear-trap", 21, 27)
paladin = hero.findFriends()
while True:
    hero.shield()
    if hero.gold >= hero.costOf("paladin"):
        hero.summon("paladin")
        enemy = hero.findNearestEnemy
        if enemy:
            hero.command(paladin, "attack", enemy)
        elif paladin.health < paladin.maxHealth / 2:
            hero.command(paladin, "heal", paladin)
        elif hero.health < hero.maxHealth / 2:
            hero.command(paladin, "heal", hero)
        else:
            while True:
                hero.command(friend, "shield")
    else:
        hero.cast("invisibility", hero)

i know, but paladins can heal you

80 gold each. But try to summon archers because of the better damage and build the bear traps in a while true loop.
Andrei

what exactly do you mean by that?

while True:
    hero.shield()
    if hero.gold >= hero.costOf("paladin"):
        hero.summon("paladin")
        enemy = hero.findNearestEnemy
        if paladin.health < paladin.maxHealth / 2:
            hero.command(paladin, "heal", paladin)
        elif hero.health < hero.maxHealth / 2:
            hero.command(paladin, "heal", hero)
        else:
            while True:
                hero.command(friend, "shield")
    elif hero.gold >= hero.costOf("archer"):
        hero.summon("archer")
        archer = hero.findFriends()
        enemy = archer.findNearestEnemy
        if enemy:
            hero.command(archer, "attack", enemy)
    else:
        hero.cast("invisibility", hero)

how about this?

with the bear traps (20chars)

I am not teasing the solution a lot, but here are a little hints and the strategy with what I completed the level with 0 health lost:

If you build the traps and summon and command the archers in a while true, then your job is easier (if you want more damage than that, equip the saber that strikes from 7 meters) qnd you also need a good distraction while you are invisible (peasants can also build decoys).

Have fun completing the level and good luck!

Andrei

ok ill try to edit my code

i really need help
here is my new code:

hero.wait(5.8)
enemy = hero.findNearestEnemy()
hero.buildXY("bear-trap", enemy.pos.x, enemy.pos.y)
hero.moveXY(22, 14)
hero.moveXY(20, 28)
while True:
    if hero.gold >= hero.costOf("archer"):
        hero.summon("archer")
        friend = hero.findFriends()
        enemy = friend.findNearestEnemy
        if enemy:
            while True:
                
                hero.command(friend, "attack", enemy)

You should delete the second while true loop.

Andrei

still does not work, my hero does not command the archers and illia breaks out of the bear traps

Then try to not use my strategy anymore and create one new yourself as I did.

Andrei

plus, it is really hard to kill a perfectly coded hero with 8000 HP

also, you cannot build and attack at the same time

I don’t believe anyone who has gone through the forest on their own (and there really are very difficult levels) is able to create this masterpiece code:
image