# The One Wizard - HELP!

**URL:** <https://discourse.codecombat.com/t/the-one-wizard-help/27056>\
**Category:** Level Help\
**Created:** [January 27, 2021, 7:55pm UTC](https://discourse.codecombat.com/t/the-one-wizard-help/27056 "2021-01-27T19:55:46Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Red-backspider](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/red-backspider/32/23212_2.png) [@Red-backspider](https://discourse.codecombat.com/u/Red-backspider)\
**Post date:** [January 27, 2021, 7:55pm UTC](https://discourse.codecombat.com/t/the-one-wizard-help/27056/1 "2021-01-27T19:55:46Z")

</div>

My code is working fine but when the big ogres come I die. Here’s my code:

```python
# Defeat as many ogres as you can.
# Use 'cast' and 'canCast' for spells.
while True:
    enemy = hero.findNearestEnemy()
    if not enemy and hero.canCast("regen", hero):
        hero.cast("regen", hero)
    if enemy and enemy.type != "catapult":
        if hero.canCast("lightning-bolt", enemy):
            hero.cast("lightning-bolt", enemy)
        elif hero.canCast("chain-lightning", enemy):
            hero.cast("chain-lightning", enemy)
        elif hero.canCast("root", enemy) and hero.distanceTo(enemy)>5:
            hero.cast("root", enemy)
            hero.attack(enemy)
        elif not enemy and hero.canCast("regen", hero):
            hero.cast("regen", hero)
    else:
        if enemy:
            hero.say("C'mon! Move you stupid catapult!")
            hero.say("C'mon!")
            hero.moveXY(hero.pos.x+20, hero.pos.y)
            hero.cast("lightning-bolt", enemy)
            hero.moveXY(hero.pos.x-20, hero.pos.y)

```

I manage to get about 32 kills but then the big orges come and kill me.

---

<div class="post-metadata">

**Author:** ![Code\_Master](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/code_master/32/16184_2.png) [@Code\_Master](https://discourse.codecombat.com/u/Code_Master)\
**Post date:** [January 27, 2021, 7:58pm UTC](https://discourse.codecombat.com/t/the-one-wizard-help/27056/2 "2021-01-27T19:58:07Z")

</div>

Try going to the grey circle when you see the big ogres.

---

<div class="post-metadata">

**Author:** ![abc](https://avatars.discourse-cdn.com/v4/letter/a/2bfe46/32.png) [@abc](https://discourse.codecombat.com/u/abc)\
**Post date:** [January 27, 2021, 9:17pm UTC](https://discourse.codecombat.com/t/the-one-wizard-help/27056/3 "2021-01-27T21:17:26Z")

</div>

When you find the catapults, move around and back, the catapults will kill the ogres with their missiles, which will then cause a chain reaction of fire traps to kill the catapults.

---

<div class="post-metadata">

**Author:** ![Red-backspider](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/red-backspider/32/23212_2.png) [@Red-backspider](https://discourse.codecombat.com/u/Red-backspider)\
**Post date:** [January 28, 2021, 4:09am UTC](https://discourse.codecombat.com/t/the-one-wizard-help/27056/4 "2021-01-28T04:09:58Z")

</div>

wait…finally! I got 44 of them! I went to the grey circle and yes, the circle made everything explode!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/codecombat/original/2X/a/a9445509d1a758c41b5ddcddc8c8e20a5dedb67f.png) [@system](https://discourse.codecombat.com/u/system)\
**Post date:** [January 28, 2021, 4:10pm UTC](https://discourse.codecombat.com/t/the-one-wizard-help/27056/5 "2021-01-28T16:10:32Z")

</div>

Closed on January 28, 2021, 4:10pm UTC

This topic was automatically closed 12 hours after the last reply. New replies are no longer allowed.
