# \[SOLVED\] on Summit's Gate

**URL:** https://discourse.codecombat.com/t/solved-on-summits-gate/19403
**Category:** Level Help
**Created:** [October 16, 2019, 10:26pm UTC](https://discourse.codecombat.com/t/solved-on-summits-gate/19403 "2019-10-16T22:26:06Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![pa\_ki](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/pa_ki/32/10821_2.png) [@pa\_ki](https://discourse.codecombat.com/u/pa_ki)
#### Post date: [October 16, 2019, 10:26pm UTC](https://discourse.codecombat.com/t/solved-on-summits-gate/19403/1 "2019-10-16T22:26:06Z")

</div>

Hi i am stuck on summits gate and i am using Ritic with best armor and weapon.  
the title looks funky because all the names are taken

---

<div class="post-metadata">

### Author: ![pa\_ki](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/pa_ki/32/10821_2.png) [@pa\_ki](https://discourse.codecombat.com/u/pa_ki)
#### Post date: [October 16, 2019, 10:27pm UTC](https://discourse.codecombat.com/t/solved-on-summits-gate/19403/2 "2019-10-16T22:27:32Z")

</div>

my code

```python
# Fight your way into the Inner Sanctum of the ogre chieftain, and defeat her.
while True:
    enemy = hero.findNearestEnemy()
    friend = hero.findNearest(hero.findFriends())
    flag = hero.findFlag("green")
    if flag:
        hero.pickUpFlag(flag)
    elif enemy:
        distance = hero.distanceTo(enemy)
        if hero.distanceTo(enemy) < 20:
            
            if friend:
                hero.command(friend, "attack", enemy)
            if hero.canCast("chain-lightning", enemy):
                hero.cast("chain-lightning", enemy)
            else:
                hero.attack(enemy)
            if friend:
                hero.command(friend, "defend", hero.pos)
    if hero.gold >= hero.costOf("soldier"):
        hero.summon("soldier")
    if hero.canCast("earthskin", hero):
        hero.cast("earthskin", hero)
```

---

<div class="post-metadata">

### Author: ![pa\_ki](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/pa_ki/32/10821_2.png) [@pa\_ki](https://discourse.codecombat.com/u/pa_ki)
#### Post date: [October 16, 2019, 10:42pm UTC](https://discourse.codecombat.com/t/solved-on-summits-gate/19403/3 "2019-10-16T22:42:32Z")

</div>

do i need an equipment check

---

<div class="post-metadata">

### Author: ![pa\_ki](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/pa_ki/32/10821_2.png) [@pa\_ki](https://discourse.codecombat.com/u/pa_ki)
#### Post date: [October 16, 2019, 11:06pm UTC](https://discourse.codecombat.com/t/solved-on-summits-gate/19403/4 "2019-10-16T23:06:08Z")

</div>

i solved it

[en\_US.composer.my\_button\_text]
