void OnSpawnpointBotSpawned(MyEntity spawnpoint, MyEntity spawnedBot)
        {
            foreach (var sp in m_firstWave)
            {
                if (spawnpoint == MyScriptWrapper.GetEntity(sp))
                {
                    MyScriptWrapper.SetSleepDistance(spawnedBot, 3000);
                }
            }

            foreach (var item in new List<uint> { (uint)EntityID.SP4_1, (uint)EntityID.SP4_2 })
            {
                if (spawnpoint.EntityId.Value.NumericValue == item)
                {
                    MyScriptWrapper.StopFollow(spawnedBot);
                    if (m_momoBoss != null)
                    {
                        MyScriptWrapper.SetEntityDestructible(spawnedBot, false);
                        MyScriptWrapper.Follow(m_momoBoss, spawnedBot);
                        MyScriptWrapper.SetSleepDistance(spawnedBot, 3000);
                    }
                    else
                    {
                        Debug.Assert(true, "Boss entity is null. Cannot identify leader");
                    }
                }
            }

            if (spawnpoint == MyScriptWrapper.GetEntity((uint)EntityID.MomoZappaSP))
            {
                spawnedBot.SetName("Momo");
                spawnedBot.DisplayName = MyTexts.MomoZappa;
                m_momoBoss = (MySmallShipBot) spawnedBot;
                m_objective07SpeakWithMomo.BotToTalkId = MyScriptWrapper.GetEntityId(m_momoBoss);
                MyScriptWrapper.SetEntityDestructible(m_momoBoss, false);
                m_momoBoss.LookTarget = MySession.PlayerShip;
                m_momoBoss.Health = m_momoBoss.MaxHealth = 1000;
                MyScriptWrapper.SetSleepDistance(spawnedBot, 3000);
                MyScriptWrapper.ActivateSpawnPoint((uint) EntityID.SP4_1);
                MyScriptWrapper.ActivateSpawnPoint((uint) EntityID.SP4_2);
            }

            if (spawnpoint == MyScriptWrapper.GetEntity((uint)EntityID.BR_SP_Boss))
            {
                spawnedBot.DisplayName = MyTexts.GangsterBoss;
                m_blackRavenBoss = (MySmallShipBot)spawnedBot;
                MyScriptWrapper.SetEntityDestructible(m_blackRavenBoss, false);
                MyScriptWrapper.ChangeFaction(m_blackRavenBoss, MyMwcObjectBuilder_FactionEnum.Traders);
                m_blackRavenBoss.LookTarget = MySession.PlayerShip;
                m_blackRavenBoss.Health = m_blackRavenBoss.MaxHealth = 500;
                MyScriptWrapper.SetSleepDistance(spawnedBot, 5000);

                m_blackRavenBoss.OnDie += OnGangsterBossDied;

                foreach (var item in new List<uint>
                    {
                        (uint) EntityID.BR_SP_1,
                        (uint) EntityID.BR_SP_2,
                        (uint) EntityID.BR_SP_3,
                        (uint) EntityID.BR_SP_4,
                        (uint) EntityID.BR_SP_Boss
                    })
                {
                    MyScriptWrapper.ActivateSpawnPoint(item);
                }
            }

            foreach (var item in m_spawns)
            {
                if (spawnpoint == MyScriptWrapper.GetEntity(item) && spawnedBot != m_blackRavenBoss)
                {
                    MyScriptWrapper.SetSleepDistance(spawnedBot, 5000);
                    if (m_blackRavenBoss != null && !m_blackRavenBoss.Closed)
                    {
                        if (ActiveObjectives.Contains(m_objective12BrFight))
                        {
                            MyScriptWrapper.SetEntityDestructible(spawnedBot, true);
                            MyScriptWrapper.ChangeFaction(spawnedBot, MyMwcObjectBuilder_FactionEnum.Slavers);
                        }
                        else
                        {
                            MyScriptWrapper.SetEntityDestructible(spawnedBot, false);
                            MyScriptWrapper.ChangeFaction(spawnedBot, MyMwcObjectBuilder_FactionEnum.Traders);
                        }
                        MyScriptWrapper.Follow(m_blackRavenBoss, spawnedBot);
                    }
                    else
                    {
                        MyScriptWrapper.SetEntityDestructible(spawnedBot, true);
                        MyScriptWrapper.ChangeFaction(spawnedBot, MyMwcObjectBuilder_FactionEnum.Slavers);
                        ((MySmallShipBot)spawnedBot).Attack(MySession.PlayerShip);
                    }
                }
            }
        }