# \[SOLVED\] Help! Summits Gate

**URL:** https://discourse.codecombat.com/t/solved-help-summits-gate/26294
**Category:** Level Help
**Created:** [December 29, 2020, 4:48am UTC](https://discourse.codecombat.com/t/solved-help-summits-gate/26294 "2020-12-29T04:48:19Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![Lydia\_Song](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/lydia_song/32/31461_2.png) [@Lydia\_Song](https://discourse.codecombat.com/u/Lydia_Song)
#### Post date: [December 29, 2020, 4:48am UTC](https://discourse.codecombat.com/t/solved-help-summits-gate/26294/1 "2020-12-29T04:48:19Z")

</div>

Hello! I’m finally on Summit’s Gate!  
So first, I want to know how to command paladins and what is a good strategy I could improvise and use?  
Help greatly appreciated!  
Lydia

---

<div class="post-metadata">

### Author: ![Monsty](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/monsty/32/20923_2.png) [@Monsty](https://discourse.codecombat.com/u/Monsty)
#### Post date: [December 29, 2020, 4:59am UTC](https://discourse.codecombat.com/t/solved-help-summits-gate/26294/2 "2020-12-29T04:59:08Z")

</div>

Can you give us your code @Lydia_Song?

---

<div class="post-metadata">

### Author: ![Lydia\_Song](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/lydia_song/32/31461_2.png) [@Lydia\_Song](https://discourse.codecombat.com/u/Lydia_Song)
#### Post date: [December 29, 2020, 5:01am UTC](https://discourse.codecombat.com/t/solved-help-summits-gate/26294/3 "2020-12-29T05:01:02Z")

</div>

I don’t have any code yet, I want to get a strategy first and then “develop” my code that way.  
Lydia

---

<div class="post-metadata">

### Author: ![Monsty](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/monsty/32/20923_2.png) [@Monsty](https://discourse.codecombat.com/u/Monsty)
#### Post date: [December 29, 2020, 5:13am UTC](https://discourse.codecombat.com/t/solved-help-summits-gate/26294/4 "2020-12-29T05:13:21Z")

</div>

Why don’t you command the whole army of soldiers at the start?

---

<div class="post-metadata">

### Author: ![PeterPalov](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/peterpalov/32/45280_2.png) [@PeterPalov](https://discourse.codecombat.com/u/PeterPalov)
#### Post date: [December 29, 2020, 6:45am UTC](https://discourse.codecombat.com/t/solved-help-summits-gate/26294/5 "2020-12-29T06:45:41Z")

</div>

I think the best strategy is to use flags. Because you can go near catapults and when they shoot you can go from them and they will kill themselfs by their missiles. Then you can shield near beamtowers while your archers are attacking them. Then… the most difficult part - warlocks. They summon skeletns and they are powerful. You can use invisibility to collect all gems and summon more units.

To command paladins:

```python
While True:
   friends = hero.findFriends()
   for friend in friends:
     if friend and friend.type == "paladin" and friend.team == hero.team:
       if friend.canCast("heal"):
          hero.command(friend, "cast","heal",hero)
       else:
           hero.command(friend, "attack", friend.findNearestEnemy())

```

You need to know your paladin team because if warlock will “raise-dead” your paladin and you will try to command it you will get an error.

---

<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: [December 29, 2020, 8:38pm UTC](https://discourse.codecombat.com/t/solved-help-summits-gate/26294/6 "2020-12-29T20:38:18Z")

</div>

I am pretty sure that the `hero.team` part is supposed to be `"humans"`.

---

<div class="post-metadata">

### Author: ![Chaboi\_3000](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/chaboi_3000/32/48486_2.png) [@Chaboi\_3000](https://discourse.codecombat.com/u/Chaboi_3000)
#### Post date: [December 30, 2020, 4:53am UTC](https://discourse.codecombat.com/t/solved-help-summits-gate/26294/7 "2020-12-30T04:53:43Z")

</div>

@abc `hero.team` and `"humans"` are the same for this case, because calling `hero.team` returns the hero’s team, which is `"humans"`. And since we’re checking if the paladin is on the same team as our hero, calling `friend.team == hero.team` is also a viable method.

---

<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: [December 30, 2020, 4:19pm UTC](https://discourse.codecombat.com/t/solved-help-summits-gate/26294/8 "2020-12-30T16:19:12Z")

</div>

Oh okay, I didn’t know that.

---

<div class="post-metadata">

### Author: ![Lydia\_Song](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/lydia_song/32/31461_2.png) [@Lydia\_Song](https://discourse.codecombat.com/u/Lydia_Song)
#### Post date: [December 30, 2020, 7:08pm UTC](https://discourse.codecombat.com/t/solved-help-summits-gate/26294/9 "2020-12-30T19:08:43Z")

</div>

What can paladins do?  
Lydia

---

<div class="post-metadata">

### Author: ![Eric\_Tang](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/eric_tang/32/15310_2.png) [@Eric\_Tang](https://discourse.codecombat.com/u/Eric_Tang)
#### Post date: [December 30, 2020, 7:11pm UTC](https://discourse.codecombat.com/t/solved-help-summits-gate/26294/10 "2020-12-30T19:11:06Z")

</div>

Paladins can shield can attack and can heal other units(if their not dead)

---

<div class="post-metadata">

### Author: ![Alexbrand](https://avatars.discourse-cdn.com/v4/letter/a/e9bcb4/32.png) [@Alexbrand](https://discourse.codecombat.com/u/Alexbrand)
#### Post date: [December 30, 2020, 7:57pm UTC](https://discourse.codecombat.com/t/solved-help-summits-gate/26294/11 "2020-12-30T19:57:08Z")

</div>

> [@Lydia\_Song](#):
>
> what is a good strategy I could improvise and use?

Who’s your hero?

My top-chart reccomendations:  
[One](https://discourse.codecombat.com/t/summits-gate-help-please/18918/14)  
[Two](https://discourse.codecombat.com/t/summits-gate-help-python/22563/5)  
[Three](https://discourse.codecombat.com/t/need-help-on-summits-gate/20981/14)  
[Four](https://discourse.codecombat.com/t/help-on-summits-gate/16493/4)

Promoting myself)

---

<div class="post-metadata">

### Author: ![Lydia\_Song](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/lydia_song/32/31461_2.png) [@Lydia\_Song](https://discourse.codecombat.com/u/Lydia_Song)
#### Post date: [December 30, 2020, 8:22pm UTC](https://discourse.codecombat.com/t/solved-help-summits-gate/26294/12 "2020-12-30T20:22:28Z")

</div>

Naria or the starter heroes.  
Lydia

---

<div class="post-metadata">

### Author: ![Eric\_Tang](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/eric_tang/32/15310_2.png) [@Eric\_Tang](https://discourse.codecombat.com/u/Eric_Tang)
#### Post date: [December 30, 2020, 8:24pm UTC](https://discourse.codecombat.com/t/solved-help-summits-gate/26294/13 "2020-12-30T20:24:08Z")

</div>

If you use Naria use her abilities

---

<div class="post-metadata">

### Author: ![Alexbrand](https://avatars.discourse-cdn.com/v4/letter/a/e9bcb4/32.png) [@Alexbrand](https://discourse.codecombat.com/u/Alexbrand)
#### Post date: [December 30, 2020, 11:16pm UTC](https://discourse.codecombat.com/t/solved-help-summits-gate/26294/14 "2020-12-30T23:16:23Z")

</div>

Well, Naria could be fast and dangerous, I think)  
As for strategies and advices - I think I can’t imagine something more that I provided via links.  
Good luck!)

---

<div class="post-metadata">

### Author: ![Lydia\_Song](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/lydia_song/32/31461_2.png) [@Lydia\_Song](https://discourse.codecombat.com/u/Lydia_Song)
#### Post date: [January 6, 2021, 10:15pm UTC](https://discourse.codecombat.com/t/solved-help-summits-gate/26294/15 "2021-01-06T22:15:06Z")

</div>

```python
# Fight your way into the Inner Sanctum of the ogre chieftain, and defeat her.
def commandPal():
    friends = hero.findFriends()
    for friend in friends:
        if friend and friend.type == "paladin" and friend.team == hero.team:
            enemyF=friend.findNearestEnemy()
            if friend.canCast("heal"):
                hero.command(friend, "cast","heal",hero)
            elif enemyF:
                hero.command(friend, "attack", enemyF)

def commandOther():
    friends = hero.findFriends()
    for friend in friends:
        if friend and friend.type == "archer" or friend.type == "soldier":
            if friend.team == hero.team:
                enemyF = friend.findNearestEnemy()
                if enemyF:
                    hero.command(friend, "attack", enemyF)
                else:
                    hero.command(friend, "move", {'x':hero.pos.x + 10, 'y':hero.pos.y})

def flag():
    flag = hero.findFlag("black")
    if flag:
        hero.move(flag.pos)
        hero.pickUpFlag(flag)
    else:
        pass

def hide():
    if hero.isReady("hide"):
        hero.hide()
    else:
        pass

def envenom():
    if hero.isReady("envenom"):
        hero.envenom()
    else:
        pass

def throw():
    enemy = hero.findNearestEnemy()
    
    if hero.isReady("throw"):
        hero.throw(enemy)
    else:
        pass

def attack():
    enemy = hero.findNearestEnemy()
    if enemy:
        envenom()
        throw()
        hero.scattershot(enemy)

def summon():
    if hero.gold > hero.costOf("griffin-rider"):
        hero.summon("griffin-rider")

while True:
    commandPal()
    commandOther()
    flag()
    attack()
    summon()

```

My hero gets stuck on this:

 ![image](https://us1.discourse-cdn.com/flex016/uploads/codecombat/original/3X/9/2/92ebf0d9950c27ed42e241e5bfd28bb6c6747c3a.jpeg)  
And won’t go to the flag.  
Lydia

---

<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 6, 2021, 10:36pm UTC](https://discourse.codecombat.com/t/solved-help-summits-gate/26294/16 "2021-01-06T22:36:38Z")

</div>

Ah, I know what your problem is

Your hero is currently trying to attack the door to the last battle. Something like this could solve the problem

```python
def attack(enemy):
    if hero.distanceTo(enemy) < hero.attackRange:
        hero.attack(enemy)
    else:
        hero.move(enemy.pos)

```

---

<div class="post-metadata">

### Author: ![Lydia\_Song](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/lydia_song/32/31461_2.png) [@Lydia\_Song](https://discourse.codecombat.com/u/Lydia_Song)
#### Post date: [January 6, 2021, 10:52pm UTC](https://discourse.codecombat.com/t/solved-help-summits-gate/26294/17 "2021-01-06T22:52:55Z")

</div>

Now I die here:

 ![image](https://us1.discourse-cdn.com/flex016/uploads/codecombat/original/3X/7/c/7cb6937ca63be4bdda6375f276712f2fcf0929db.png)

Lydia

---

<div class="post-metadata">

### Author: ![Eric\_Tang](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/eric_tang/32/15310_2.png) [@Eric\_Tang](https://discourse.codecombat.com/u/Eric_Tang)
#### Post date: [January 6, 2021, 11:51pm UTC](https://discourse.codecombat.com/t/solved-help-summits-gate/26294/18 "2021-01-06T23:51:38Z")

</div>

> [@Lydia\_Song](#):
>
> ` hero.moveXY(flag.pos.x, flag.pos.y)`

you can delete this line

> [@Lydia\_Song](#):
>
> `if hero.isReady("throw")`

check if the enemy is in throw range

---

<div class="post-metadata">

### Author: ![Eric\_Tang](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/eric_tang/32/15310_2.png) [@Eric\_Tang](https://discourse.codecombat.com/u/Eric_Tang)
#### Post date: [January 7, 2021, 2:06am UTC](https://discourse.codecombat.com/t/solved-help-summits-gate/26294/20 "2021-01-07T02:06:41Z")

</div>

Well, maybe try to command your troops to go attack first then you go behind them, so the beam towers will focus your friends instead(or you can just skip the beam towers and attack the door)

---

<div class="post-metadata">

### Author: ![Lydia\_Song](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/lydia_song/32/31461_2.png) [@Lydia\_Song](https://discourse.codecombat.com/u/Lydia_Song)
#### Post date: [January 7, 2021, 5:10am UTC](https://discourse.codecombat.com/t/solved-help-summits-gate/26294/21 "2021-01-07T05:10:42Z")

</div>

![image](https://us1.discourse-cdn.com/flex016/uploads/codecombat/original/3X/e/0/e0c1895a28f415e9e305ff5c5f297d24ea55f5e8.jpeg)  
I passed it! I’m honestly surprised I didn’t take 3 months (as Restless Dead did) 🙂  
Lydia

[Next page](https://discourse.codecombat.com/t/solved-help-summits-gate/26294.md?page=2)
