Hi everyone, I’m currently stuck in the above mentioned level. It doesn’t seem that my code is wrong, it is more that my hero’s are not strong enough.
Is there a master solution for the level, with regards to the hero and weapon’s I have to use?
Btw my hero Alejandro has 997 health and my strongest sword 192,2 DPS (which is not able to cleave).
So should I still try cleave and attack or should I use build fire-traps e.g., cast,… ?
Hi Andrei, many thanks and also for your quick reply
I used the following and honestly without any idea where and when to place the flag during the fight:
while(true) {
var flag = hero.findFlag();
var enemy = hero.findNearestEnemy();
if (flag) {
hero.pickUpFlag(flag);
}
else if (enemy) {
if (hero.isReady("cleave")){
hero.cleave(enemy);
}
else {
hero.attack(enemy);
}
}
}
I’d move the flag to the area that has the highest damage ogres (to the left, i think). Then, as the battle goes on, move the flag to areas that need help (or look like they do - that’s how i did it).
Hey guys,
Unfortunately it didn’t work out. As soon as my hero gets closer to the upper part where many ogres appear, he dies a few seconds afterwards.
As already mentioned, I have no gems to get new weapon or heros so I tried this code:
while(true) {
var enemy = hero.findNearestEnemy();
if (hero.canCast("drain-life"), enemy) {
hero.cast("drain-life", enemy);
}
else {
hero.attack(enemy);
}
if (hero.health < hero.maxHealth / 3 && hero.canCast("invisibility")) {
hero.cast("invisibility", hero);
}
}
where actually happens nothing.
What hero and weapon did you guys use so it worked out with only cleave and attack? Any other ideas whats the reason I cant pass?
Thanks a lot
And try to check if you are low on health and you can become invisible, then cast invisibility on yourself and wait for the spell to end using the hero.wait() method.
Here you should wait a number of seconds. And try to only cast invisibility before you move to pick up the flag, so you can delete this
And before you cast the invisibility check if hero.canCast(the name of the spell that you want to cast) is true, and only then cast the spell. Do you understand, @Naddali275 ?