// ReSharper disable once UnusedParameter.Local
            private void SpawnCircle(int round)
            {
                if (_map != null)
                {
                    MapCell cell = _map.Map.GetRandomPosition();

                    int circleId = _map.GetNextMonsterId();

                    MapMonster circle = new MapMonster
                    {
                        MonsterVNum   = 2018,
                        MapX          = cell.X,
                        MapY          = cell.Y,
                        MapMonsterId  = circleId,
                        IsHostile     = false,
                        IsMoving      = false,
                        ShouldRespawn = false
                    };
                    circle.Initialize(_map);
                    circle.NoAggresiveIcon = true;
                    _map.AddMonster(circle);
                    _map.Broadcast(circle.GenerateIn());
                    _map.Broadcast(StaticPacketHelper.GenerateEff(UserType.Monster, circleId, 4660));
                    Observable.Timer(TimeSpan.FromSeconds(3)).Subscribe(observer =>
                    {
                        if (_map != null)
                        {
                            _map.Broadcast(StaticPacketHelper.SkillUsed(UserType.Monster, circleId, 3, circleId, 1220, 220, 0, 4983, cell.X, cell.Y, true, 0, 65535, 0, 0));
                            foreach (Character character in _map.GetCharactersInRange(cell.X, cell.Y, 2))
                            {
                                if (!_map.Sessions.Skip(3).Any())
                                {
                                    // Your reward for the last three living players
                                }
                                character.IsCustomSpeed = false;
                                character.RemoveVehicle();
                                character.GetDamage(655350);
                                Observable.Timer(TimeSpan.FromMilliseconds(1000)).Subscribe(o => ServerManager.Instance.AskRevive(character.CharacterId));
                            }
                            _map.RemoveMonster(circle);
                            _map.Broadcast(StaticPacketHelper.Out(UserType.Monster, circle.MapMonsterId));
                        }
                    });
                }
            }
Example #2
0
            private void SpawnSheep(int round)
            {
                if (_map != null)
                {
                    if (Spawn == true)
                    {
                        MapCell cell = _map.Map.GetRandomPosition();

                        int SheepId = _map.GetNextMonsterId();

                        MapMonster sheep = new MapMonster {
                            MonsterVNum = 9, MapX = cell.X, MapY = cell.Y, MapMonsterId = SheepId, IsHostile = false, IsMoving = true, ShouldRespawn = false
                        };
                        sheep.Initialize(_map);
                        sheep.NoAggresiveIcon = true;
                        _map.AddMonster(sheep);
                        _map.Broadcast(sheep.GenerateIn());
                    }
                }
            }
Example #3
0
            private void spawnCircle(int round)
            {
                if (_map != null)
                {
                    MapCell cell = _map.Map.GetRandomPosition();

                    int     circleId = _map.GetNextMonsterId();
                    short[] monster  =
                    {
                        1, 1, 1, 1, 1
                    };
                    MapMonster circle = new MapMonster {
                        MonsterVNum = monster[round], MapX = cell.X, MapY = cell.Y, MapMonsterId = circleId, IsHostile = false, IsMoving = false, ShouldRespawn = false
                    };
                    circle.Initialize(_map);
                    circle.NoAggresiveIcon = false;
                    _map.AddMonster(circle);
                    _map.Broadcast(circle.GenerateIn());
                    _map.Broadcast(StaticPacketHelper.GenerateEff(UserType.Monster, circleId, 4660));
                    if (_map != null)
                    {
                        _map.Broadcast(StaticPacketHelper.SkillUsed(UserType.Monster, circleId, 3, circleId, 1220, 220, 0, 4983, cell.X, cell.Y, true, 0, 65535, 0, 0));
                        foreach (Character character in _map.GetCharactersInRange(cell.X, cell.Y, 2))
                        {
                            if (!_map.Sessions.Skip(3).Any())
                            {
                                //Regalo para los 3 ultimos supervivientes.
                                character.Inventory.AddNewToInventory(1, 1).FirstOrDefault();
                            }
                            character.IsCustomSpeed = false;
                            character.RemoveVehicle();
                            Observable.Timer(TimeSpan.FromMilliseconds(1000)).Subscribe(o => ServerManager.Instance.AskRevive(character.CharacterId));
                        }
                        _map.Broadcast(StaticPacketHelper.Out(UserType.Monster, circle.MapMonsterId));
                    }
                }
            }
        public static void GenerateRaid(MapInstanceType raidType, byte faction)
        {
            Guardians = new List <MapMonster>();
            MapInstance bitoren = ServerManager.GetMapInstance(ServerManager.GetBaseMapInstanceIdByMapId(134));

            bitoren.CreatePortal(new Portal
            {
                SourceMapId      = 134,
                SourceX          = 140,
                SourceY          = 100,
                DestinationMapId = 0,
                DestinationX     = 1,
                DestinationY     = 1,
                Type             = (short)(9 + faction)
            });

            #region Guardian Spawning

            Guardians.Add(new MapMonster
            {
                MonsterVNum   = (short)(678 + faction),
                MapX          = 147,
                MapY          = 88,
                MapId         = 134,
                Position      = 2,
                IsMoving      = false,
                MapMonsterId  = bitoren.GetNextMonsterId(),
                ShouldRespawn = false,
                IsHostile     = true
            });
            Guardians.Add(new MapMonster
            {
                MonsterVNum   = (short)(678 + faction),
                MapX          = 149,
                MapY          = 94,
                MapId         = 134,
                Position      = 2,
                IsMoving      = false,
                MapMonsterId  = bitoren.GetNextMonsterId(),
                ShouldRespawn = false,
                IsHostile     = true
            });
            Guardians.Add(new MapMonster
            {
                MonsterVNum   = (short)(678 + faction),
                MapX          = 147,
                MapY          = 101,
                MapId         = 134,
                Position      = 2,
                IsMoving      = false,
                MapMonsterId  = bitoren.GetNextMonsterId(),
                ShouldRespawn = false,
                IsHostile     = true
            });
            Guardians.Add(new MapMonster
            {
                MonsterVNum   = (short)(678 + faction),
                MapX          = 139,
                MapY          = 105,
                MapId         = 134,
                Position      = 2,
                IsMoving      = false,
                MapMonsterId  = bitoren.GetNextMonsterId(),
                ShouldRespawn = false,
                IsHostile     = true
            });
            Guardians.Add(new MapMonster
            {
                MonsterVNum   = (short)(678 + faction),
                MapX          = 132,
                MapY          = 101,
                MapId         = 134,
                Position      = 2,
                IsMoving      = false,
                MapMonsterId  = bitoren.GetNextMonsterId(),
                ShouldRespawn = false,
                IsHostile     = true
            });
            Guardians.Add(new MapMonster
            {
                MonsterVNum   = (short)(678 + faction),
                MapX          = 129,
                MapY          = 94,
                MapId         = 134,
                Position      = 2,
                IsMoving      = false,
                MapMonsterId  = bitoren.GetNextMonsterId(),
                ShouldRespawn = false,
                IsHostile     = true
            });
            Guardians.Add(new MapMonster
            {
                MonsterVNum   = (short)(678 + faction),
                MapX          = 132,
                MapY          = 88,
                MapId         = 134,
                Position      = 2,
                IsMoving      = false,
                MapMonsterId  = bitoren.GetNextMonsterId(),
                ShouldRespawn = false,
                IsHostile     = true
            });

            #endregion

            foreach (MapMonster monster in Guardians)
            {
                monster.Initialize(bitoren);
                bitoren.AddMonster(monster);
                bitoren.Broadcast(monster.GenerateIn());
            }

            Act4RaidThread raidThread = new Act4RaidThread();
            Observable.Timer(TimeSpan.FromMinutes(0)).Subscribe(x => raidThread.Run(raidType, faction));
        }