Exemplo n.º 1
0
Arquivo: Player.cs Projeto: uvbs/DoR
        public void Teleport(UInt16 ZoneID, UInt32 WorldX, UInt32 WorldY, UInt16 WorldZ, UInt16 WorldO)
        {
            Log.Info("Player", "Teleport : " + ZoneID + "," + WorldX + "," + WorldY + "," + WorldZ);


            // ADDED THIS TO GIVE ME INFO// also use this kind of thing for portal not open
            SendLocalizeString("ZoneID=" + ZoneID + "," + WorldX + "," + WorldY + "," + WorldZ + "," + WorldO, GameData.Localized_text.CHAT_TAG_DEFAULT);


            Zone_Info Info = WorldMgr.GetZone_Info(ZoneID);

            if (Info == null)
            {
                return;
            }

            // Change Region , so change thread and maps
            if (Zone == null || Zone.Info.Region != Info.Region)
            {
                RegionMgr NewRegion = WorldMgr.GetRegion(Info.Region, true);
                if (NewRegion != null)
                {
                    ZoneMgr NewZone = NewRegion.GetZoneMgr(Info.ZoneId, true);
                    Teleport(NewZone, WorldX, WorldY, WorldZ, WorldO);
                }
            }
            else // Teleport in current Zone
            {
                SafeWorldTeleport(WorldX, WorldY, WorldZ, WorldO);
            }
        }
Exemplo n.º 2
0
 public CellMgr(RegionMgr mgr, ushort offX, ushort offY)
 {
     Region = mgr;
     X      = offX;
     Y      = offY;
     Spawns = mgr.GetCellSpawn(offX, offY);
 }
Exemplo n.º 3
0
 public CellMgr(RegionMgr Mgr, UInt16 OffX, UInt16 OffY)
 {
     Region = Mgr;
     X      = OffX;
     Y      = OffY;
     Spawns = Mgr.GetCellSpawn(OffX, OffY);
 }
Exemplo n.º 4
0
        static public bool ModifyFaction(Player Plr, ref List <string> Values)
        {
            byte Faction = (byte)GetInt(ref Values);
            byte Save    = (byte)(Values.Count > 0 ? GetInt(ref Values) : 0);

            Object Obj = GetObjectTarget(Plr);

            RegionMgr Region = Obj.Region;
            ushort    ZoneId = Obj.Zone.ZoneId;

            Obj.RemoveFromWorld();
            Obj.GetUnit().SetFaction(Faction);
            Region.AddObject(Obj.GetUnit(), ZoneId, true);

            if (Save > 0)
            {
                if (Obj.IsCreature())
                {
                    Creature Crea = Obj.GetCreature();
                    Crea.Spawn.Faction = Faction;
                    WorldMgr.Database.SaveObject(Crea.Spawn);
                }
            }

            return(true);
        }
Exemplo n.º 5
0
 public CellMgr(RegionMgr Mgr, UInt16 OffX, UInt16 OffY)
 {
     Region = Mgr;
     X = OffX;
     Y = OffY;
     Spawns = Mgr.GetCellSpawn(OffX,OffY);
 }
Exemplo n.º 6
0
        public void Teleport(UInt16 ZoneID, UInt32 WorldX, UInt32 WorldY, UInt16 WorldZ, UInt16 WorldO)
        {
            Log.Info("Player", "Teleport : " + ZoneID + "," + WorldX + "," + WorldY + "," + WorldZ);

            Zone_Info Info = WorldMgr.GetZone_Info(ZoneID);

            if (Info == null)
            {
                return;
            }

            // Change Region , so change thread and maps
            if (Zone == null || Zone.Info.Region != Info.Region)
            {
                RegionMgr NewRegion = WorldMgr.GetRegion(Info.Region, true);
                if (NewRegion != null)
                {
                    ZoneMgr NewZone = NewRegion.GetZoneMgr(Info.ZoneId, true);
                    Teleport(NewZone, WorldX, WorldY, WorldZ, WorldO);
                }
            }
            else // Teleport in current Zone
            {
                SafeWorldTeleport(WorldX, WorldY, WorldZ, WorldO);
            }
        }
Exemplo n.º 7
0
 public ZoneMgr(RegionMgr Region, Zone_Info Info)
 {
     this.Region   = Region;
     this.ZoneId   = Info.ZoneId;
     this.Info     = Info;
     this.Running  = true;
     this.AreaInfo = AreaMapMgr.GetAreaInfo(Info.ZoneId);
 }
Exemplo n.º 8
0
 public ZoneMgr(RegionMgr Region, Zone_Info Info)
 {
     this.Region     = Region;
     this.ZoneId     = Info.ZoneId;
     this.Info       = Info;
     this.Running    = true;
     this.ClientInfo = ClientFileMgr.GetZoneInfo(Info.ZoneId);
 }
Exemplo n.º 9
0
 public ZoneMgr(RegionMgr Region,Zone_Info Info)
 {
     this.Region = Region;
     this.ZoneId = Info.ZoneId;
     this.Info = Info;
     this.Running = true;
     this.AreaInfo = AreaMapMgr.GetAreaInfo(Info.ZoneId);
 }
Exemplo n.º 10
0
 public ZoneMgr(RegionMgr Region,Zone_Info Info)
 {
     this.Region = Region;
     this.ZoneId = Info.ZoneId;
     this.Info = Info;
     this.Running = true;
     this.ClientInfo = ClientFileMgr.GetZoneInfo(Info.ZoneId);
 }
Exemplo n.º 11
0
 public List <Object> GetRangedObject(Object Obj, int Range)
 {
     Log.Info("ZoneMgr", "GetRangedObject zoneid = " + ZoneId + ",ObjSize=" + _Objects.Count);
     lock (_Objects)
     {
         return(_Objects.FindAll(Ranged => Ranged != null &&
                                 RegionMgr.IsRange(Ranged.XOffset, Obj.XOffset, Range) && RegionMgr.IsRange(Ranged.YOffset, Obj.YOffset, Range)));
     }
 }
Exemplo n.º 12
0
        static public RegionMgr GetRegion(UInt16 RegionId, bool Create)
        {
            Log.Success("GetRegion", "RegionId=" + RegionId);

            lock (_Regions)
            {
                RegionMgr Mgr = _Regions.Find(region => region != null && region.RegionId == RegionId);
                if (Mgr == null && Create)
                {
                    Mgr = new RegionMgr(RegionId, GetZoneRegion(RegionId));
                    _Regions.Add(Mgr);
                }

                return(Mgr);
            }
        }
Exemplo n.º 13
0
        static public void F_INIT_PLAYER(BaseClient client, PacketIn packet)
        {
            GameClient cclient = client as GameClient;

            Log.Success("F_INIT_PLAYER", "Lancement !");

            Player Plr = cclient.Plr;

            if (!Plr.IsInWorld()) // Si le joueur n'est pas sur une map, alors on l'ajoute a la map
            {
                UInt16 ZoneId = Plr._Info.Value[0].ZoneId;
                ushort RegionId = (ushort)Plr._Info.Value[0].RegionId;
                RegionMgr Region = WorldMgr.GetRegion(RegionId, true);
                Region.AddObject(Plr, ZoneId);
            }
            else
                Plr._Loaded = false;
        }
        public Instance(ushort zoneid, ushort id, byte realm, Instance_Lockouts lockouts)
        {
            Lockout = lockouts;
            ID      = id;
            ZoneID  = zoneid;
            Realm   = realm;
            Region  = new RegionMgr(zoneid, ZoneService.GetZoneRegion(zoneid));
            InstanceService._InstanceInfo.TryGetValue(zoneid, out Info);
            LoadBossSpawns();
            LoadSpawns(); // todo get the saved progress from group
            _running      = true;
            _evtInterface = new EventInterface();
            closetime     = (TCPManager.GetTimeStamp() + 7200);
            new Thread(Update).Start();



            Log.Success("Opening Instance", "Instance ID " + ID + "  Map: " + Info.Name);
            if (zoneid == 179)
            {
                foreach (var p in GameObjectService.GameObjectSpawns.Where(e => e.Value.ZoneId == 179))
                {
                    if (p.Value.Entry == 98908)
                    {
                        GameObject go = new GameObject(p.Value);

                        _Objects.Add(go);
                        Region.AddObject(go, zoneid, true);
                    }
                }

                if (_Objects.Count > 0)
                {
                    LoadObjects();
                }
                _evtInterface.AddEvent(UpdatePendulums, 7000, 0);
            }
        }
Exemplo n.º 15
0
        static public void F_INIT_PLAYER(BaseClient client, PacketIn packet)
        {
            GameClient cclient = client as GameClient;

            Player Plr = cclient.Plr;

            if (Plr == null)
            {
                return;
            }

            if (!Plr.IsInWorld()) // Si le joueur n'est pas sur une map, alors on l'ajoute a la map
            {
                UInt16    ZoneId   = Plr._Info.Value.ZoneId;
                ushort    RegionId = (ushort)Plr._Info.Value.RegionId;
                RegionMgr Region   = WorldMgr.GetRegion(RegionId, true);
                Region.AddObject(Plr, ZoneId, false);
            }
            else
            {
                Plr._Loaded = false;
            }
        }
        public static void Create(RegionMgr region, PQuest_Info info, ref Dictionary <uint, ContributionInfo> players, float bagCountMod)
        {
            if (region == null)
            {
                Log.Error("GoldChest", "Attempt to create for NULL region");
                return;
            }

            if (info == null)
            {
                Log.Error("GoldChest", "NULL PQuest in Region " + region);
                return;
            }

            if (bagCountMod == 0.0f)
            {
                return;
            }

            GameObject_proto proto = GameObjectService.GetGameObjectProto(188);

            GameObject_spawn spawn = new GameObject_spawn
            {
                Guid   = (uint)GameObjectService.GenerateGameObjectSpawnGUID(),
                WorldO = 0,
                WorldY = info.GoldChestWorldY,
                WorldZ = info.GoldChestWorldZ,
                WorldX = info.GoldChestWorldX,
                ZoneId = info.ZoneId
            };

            spawn.BuildFromProto(proto);

            GoldChest chest = new GoldChest(spawn, info, ref players, bagCountMod, region);

            region.AddObject(chest, info.ZoneId);
        }
        private void RollForPersonalBag(ContributionInfo player, float bagCountMod, Dictionary <uint, ContributionInfo> players, RegionMgr region)
        {
            for (int i = 0; i < 5; ++i)
            {
                _availableBags[i] = 0;
            }
            for (int i = 0; i < 5; ++i)
            {
                _bags[i] = 0;
            }
            ProximityBattlefront bf             = null;
            int       aaoMult                   = 0;
            bool      isBonusAppliedAndConsumed = true;
            Realms    aaoRealm                  = Realms.REALMS_REALM_NEUTRAL;
            Player    targPlayer                = Player.GetPlayer(player.PlayerCharId);
            Character targCharacter             = CharMgr.GetCharacter(player.PlayerCharId, true);

            if (region != null && region.Bttlfront != null && region.Bttlfront is ProximityBattlefront)
            {
                bf = region.Bttlfront as ProximityBattlefront;
                if (bf != null)
                {
                    aaoMult = Math.Abs(bf._againstAllOddsMult);
                    if (aaoMult != 0)
                    {
                        aaoRealm = bf._againstAllOddsMult > 0 ? Realms.REALMS_REALM_DESTRUCTION : Realms.REALMS_REALM_ORDER;
                    }
                }

                if (targPlayer != null)
                {
                    //T2 16-19, use bonus rolls
                    if (region.GetTier() == 2)
                    {
                        if (targPlayer.Level < 16 || targPlayer.Level > 19)
                        {
                            isBonusAppliedAndConsumed = false;
                        }
                    }
                    //T3 20-29, use bonus rolls
                    if (region.GetTier() == 3)
                    {
                        if (targPlayer.Level < 20 || targPlayer.Level > 29)
                        {
                            isBonusAppliedAndConsumed = false;
                        }
                    }

                    if (region.GetTier() == 4)
                    {
                        if (targPlayer.Level < 30)
                        {
                            isBonusAppliedAndConsumed = false;
                        }
                    }
                }
            }
            //Which side is outnumbered?
            float aaoMultOutnumberedSide = aaoMult / 2.5f;
            //Which side is outnumbering the other side?
            float aaoMultOutnumberingSide = aaoMult / 2.5f;

            //Being outnumbered has a cap of 2, 10% bonus to your roll.
            if (aaoMultOutnumberedSide > 1f)
            {
                aaoMultOutnumberedSide = 1f;
            }

            //Being utnumbering has a cap of 40% penalty.
            if (aaoMultOutnumberingSide > 4f)
            {
                aaoMultOutnumberingSide = 4f;
            }

            //Divide by 10f to get sane multipliers for rolls
            aaoMultOutnumberedSide  = aaoMultOutnumberedSide / 10f;
            aaoMultOutnumberingSide = aaoMultOutnumberingSide / 10f;

            const double goldChance = 0.01, purpChance = 0.05, blueChance = 0.1, greenChance = 0.15, whiteChance = 0.2;

            _preRoll = players.OrderByDescending(plrs => plrs.Value.BaseContribution).ToList();
            float acv = _preRoll.Sum(plrs => plrs.Value.BaseContribution) / _preRoll.Count;

            //handle roll value
            if (player.OptOutType == 1)
            {
                player.RandomBonus = 1;
                if (targPlayer != null)
                {
                    targPlayer.SendLocalizeString(_publicQuestInfo.Name, ChatLogFilters.CHATLOGFILTERS_SAY, Localized_text.TEXT_PUBLIC_QUEST_OPT_OUT_APPLIED);
                }
            }
            else if (player.BaseContribution > acv * .10)
            {
                player.RandomBonus = (ushort)RandomMgr.Next(0, 1000);

                int temporaryBonus = (int)player.RandomBonus;
                if (aaoRealm != Realms.REALMS_REALM_NEUTRAL && aaoMult != 0)
                {
                    if (targPlayer != null)
                    {
                        targPlayer.SendClientMessage("Your roll has been adjusted due to your army's size.", ChatLogFilters.CHATLOGFILTERS_CSR_TELL_RECEIVE);
                    }
                    if (player.PlayerRealm == aaoRealm)
                    {
                        temporaryBonus += (int)(player.RandomBonus * (aaoMultOutnumberedSide));
                    }
                    else
                    {
                        temporaryBonus -= (int)(player.RandomBonus * (aaoMultOutnumberingSide));
                    }
                }
                player.RandomBonus = (uint)(Math.Max(2, temporaryBonus));
                if (targPlayer != null)
                {
                    targPlayer.SendClientMessage("You roll " + player.RandomBonus + ".", ChatLogFilters.CHATLOGFILTERS_CSR_TELL_RECEIVE);
                }
            }
            else
            {
                player.RandomBonus = 1;
            }

            float contribFactor = player.BaseContribution > acv ? player.BaseContribution / acv : 1f;
            float malus         = 0;

            //get player bag pools

            if (targCharacter != null)
            {
                if (targCharacter.Bag_Pools == null)
                {
                    targCharacter.Bag_Pools = new List <Characters_bag_pools>();
                }

                _bagPools = targCharacter.Bag_Pools.OrderByDescending(bgpools => bgpools.Bag_Type).ToList();
                if (_bagPools.Count == 0)
                {
                    foreach (int pool in _bpools)
                    {
                        Characters_bag_pools _bagPool = new Characters_bag_pools((int)player.PlayerCharId, pool, 0);
                        targCharacter.Bag_Pools.Add(_bagPool);
                        CharMgr.Database.AddObject(_bagPool);
                    }
                    _bagPools = targCharacter.Bag_Pools.OrderByDescending(bgpools => bgpools.Bag_Type).ToList();
                }
            }

            //roll for each bag type
            foreach (Characters_bag_pools pool in _bagPools)
            {
                player.ContributionBonus = (uint)pool.BagPool_Value;
                if (player.RandomBonus > 1)
                {
                    if (pool.Bag_Type == 4)
                    {
                        if ((player.RandomBonus - malus + (isBonusAppliedAndConsumed ? pool.BagPool_Value : 0)) >= 1000 - (1000 * (WorldMgr.WorldSettingsMgr.GetGenericSetting(12) > 0 ? WorldMgr.WorldSettingsMgr.GetGenericSetting(12) / 1000d : goldChance *contribFactor)))
                        {
                            _bags[gold] = 1;
                            if (isBonusAppliedAndConsumed)
                            {
                                if (targPlayer != null)
                                {
                                    targPlayer.SendClientMessage("Your gold bag bonus roll has been consumed.", ChatLogFilters.CHATLOGFILTERS_CSR_TELL_RECEIVE);
                                }
                                pool.BagPool_Value = 0;
                            }
                            if (targPlayer != null)
                            {
                                targPlayer.SendClientMessage("You have won a gold loot bag!", ChatLogFilters.CHATLOGFILTERS_CSR_TELL_RECEIVE);
                            }

                            break;
                        }
                        else
                        {
                            if (isBonusAppliedAndConsumed)
                            {
                                pool.BagPool_Value += (int)((player.RandomBonus - (0) + pool.BagPool_Value) * .01);
                            }
                        }
                    }
                    else if (pool.Bag_Type == 3)
                    {
                        if ((player.RandomBonus - malus + (isBonusAppliedAndConsumed ? pool.BagPool_Value : 0)) >= 1000 - (1000 * (WorldMgr.WorldSettingsMgr.GetGenericSetting(13) > 0 ? WorldMgr.WorldSettingsMgr.GetGenericSetting(13) / 1000d : purpChance *contribFactor)))
                        {
                            _bags[purple] = 1;
                            if (isBonusAppliedAndConsumed)
                            {
                                if (targPlayer != null)
                                {
                                    targPlayer.SendClientMessage("Your purple bag bonus roll has been consumed.", ChatLogFilters.CHATLOGFILTERS_CSR_TELL_RECEIVE);
                                }
                                pool.BagPool_Value = 0;
                            }
                            if (targPlayer != null)
                            {
                                targPlayer.SendClientMessage("You have won a purple loot bag!", ChatLogFilters.CHATLOGFILTERS_CSR_TELL_RECEIVE);
                            }

                            break;
                        }
                        else
                        {
                            if (isBonusAppliedAndConsumed)
                            {
                                pool.BagPool_Value += (int)((player.RandomBonus - (0) + pool.BagPool_Value) * .02);
                            }
                        }
                    }
                    else if (pool.Bag_Type == 2)
                    {
                        if ((player.RandomBonus + -malus + (isBonusAppliedAndConsumed ? pool.BagPool_Value : 0)) >= 1000 - (1000 * (WorldMgr.WorldSettingsMgr.GetGenericSetting(14) > 0 ? WorldMgr.WorldSettingsMgr.GetGenericSetting(14) / 1000d : blueChance *contribFactor)))
                        {
                            _bags[blue] = 1;
                            if (isBonusAppliedAndConsumed)
                            {
                                if (targPlayer != null)
                                {
                                    targPlayer.SendClientMessage("Your blue loot bag bonus roll has been consumed.", ChatLogFilters.CHATLOGFILTERS_CSR_TELL_RECEIVE);
                                    pool.BagPool_Value = 0;
                                }
                            }
                            if (targPlayer != null)
                            {
                                targPlayer.SendClientMessage("You have won a blue loot bag!", ChatLogFilters.CHATLOGFILTERS_CSR_TELL_RECEIVE);
                            }
                            break;
                        }
                        else
                        {
                            if (isBonusAppliedAndConsumed)
                            {
                                pool.BagPool_Value += (int)((player.RandomBonus - (0) + pool.BagPool_Value) * .03);
                            }
                        }
                    }
                    else if (pool.Bag_Type == 1)
                    {
                        if ((player.RandomBonus - malus + (isBonusAppliedAndConsumed ? pool.BagPool_Value : 0)) >= 1000 - (1000 * (WorldMgr.WorldSettingsMgr.GetGenericSetting(15) > 0 ? WorldMgr.WorldSettingsMgr.GetGenericSetting(15) / 1000d : greenChance *contribFactor)))
                        {
                            _bags[green] = 1;
                            if (isBonusAppliedAndConsumed)
                            {
                                if (targPlayer != null)
                                {
                                    targPlayer.SendClientMessage("Your green loot bag bonus roll has been consumed.", ChatLogFilters.CHATLOGFILTERS_CSR_TELL_RECEIVE);
                                }
                                pool.BagPool_Value = 0;
                            }
                            if (targPlayer != null)
                            {
                                targPlayer.SendClientMessage("You have won a green loot bag!", ChatLogFilters.CHATLOGFILTERS_CSR_TELL_RECEIVE);
                            }
                            break;
                        }
                        else
                        {
                            if (isBonusAppliedAndConsumed)
                            {
                                pool.BagPool_Value += (int)((player.RandomBonus - (0) + pool.BagPool_Value) * .04);
                            }
                        }
                    }
                    else if (pool.Bag_Type == 0)
                    {
                        _bags[white] = 1;
                        if (targPlayer != null)
                        {
                            targPlayer.SendClientMessage("You have won a white loot bag!", ChatLogFilters.CHATLOGFILTERS_CSR_TELL_RECEIVE);
                        }
                        pool.BagPool_Value = 0;
                    }
                }
            }
            foreach (Characters_bag_pools pool in _bagPools)
            {
                CharMgr.Database.SaveObject(pool);
            }

            for (int i = 0; i < 5; ++i)
            {
                _availableBags[i] = _bags[i];
            }


            byte bagWon = GetWonBagType(player.OptOutType == 2);

            if (bagWon == 0)
            {
                if (targPlayer != null)
                {
                    targPlayer.SendClientMessage("You have not contributed enough to this zone's capture, and thus have not rolled.");
                }
                return;
            }
            //Log.Success("Winner", player.PlayerName + " Realm: " + player.PlayerRealm + " Bag Type: " + bagWon.ToString() + "Roll: " + player.RandomBonus + " Contrib: " + player.BaseContribution + " Avg Contrib: " + acv + " BonusConsumed: " + player.ContributionBonus);
            player.BagWon = bagWon;
            _lootBags.Add(player.PlayerCharId, new GoldBag(PublicQuest.GetBag(player.BagWon), player.PlayerCareerLine, player.PlayerName));
            PersonalScoreboard(player, bagWon);
        }
Exemplo n.º 18
0
        public static RegionMgr GetRegion(UInt16 RegionId,bool Create)
        {
            Log.Success("GetRegion", "RegionId=" + RegionId);

            lock (_Regions)
            {
                RegionMgr Mgr = _Regions.Find(region => region != null && region.RegionId == RegionId);
                if (Mgr == null && Create)
                {
                    Mgr = new RegionMgr(RegionId, GetZoneRegion(RegionId));
                    _Regions.Add(Mgr);
                }

                return Mgr;
            }
        }
        public GoldChest(GameObject_spawn spawn, PQuest_Info info, ref Dictionary <uint, ContributionInfo> players, float bagCountMod, RegionMgr region)
        {
            Spawn            = spawn;
            _publicQuestInfo = info;
            //Note: _amountOfBags is the original calulation for generating bags, testing math.min to see if this is the cause of the empty bags (clientside limitations)
            int _amountOfBags = (int)(players.Count * bagCountMod);

            if (info.PQType == 2 && WorldMgr.WorldSettingsMgr.GetGenericSetting(16) == 0)
            {
                foreach (ContributionInfo contrib in players.Values)
                {
                    RollForPersonalBag(contrib, 1f, players, region);
                }
                EvtInterface.AddEvent(Destroy, 180 * 1000, 1);
                // AssignPersonalLoot(player);
            }
            else  //PQs still use the original roll system
            {
                GenerateLootBags(Math.Min(_amountOfBags, 24));
                // Note - if there are more than 42 players, the lowest rarity bag should be green.

#warning if there are more than 114 players, 25 bags will be awarded. Nalgol has the PQ boards restricted to 24 players, for an unknown reason. This could cause something to break.

                AssignLoot(players);

                foreach (KeyValuePair <uint, ContributionInfo> playerRoll in players)
                {
                    Scoreboard(playerRoll.Value, _preRoll.IndexOf(playerRoll), _postRoll.IndexOf(playerRoll));
                }

                EvtInterface.AddEvent(Destroy, 180 * 1000, 1);
            }
        }
Exemplo n.º 20
0
        public ProximityProgressingBattlefront(RegionMgr region, bool oRvRFront) : base(region, oRvRFront)
        {
            _battlefrontStatus = BattlefrontService.GetStatusFor(region.RegionId);

            // RB   4/24/2016   A lot of non-RvR zones are included in the T4 regions, so those need to be discarded. And we need to do this manually.

            switch (Region.RegionId)
            {
            case 2:     // T4 Dwarf vs Greenskin
                Zones = new List <Zone_Info>
                {
                    Region.ZonesInfo.Find(z => z.ZoneId == 3),
                    Region.ZonesInfo.Find(z => z.ZoneId == 5),
                    Region.ZonesInfo.Find(z => z.ZoneId == 9)
                };
                break;

            case 11:     // T4 Empire vs Chaos
                Zones = new List <Zone_Info>
                {
                    Region.ZonesInfo.Find(z => z.ZoneId == 103),
                    Region.ZonesInfo.Find(z => z.ZoneId == 105),
                    Region.ZonesInfo.Find(z => z.ZoneId == 109)
                };
                break;

            case 4:     // T4 High Elf vs Dark Elf
                Zones = new List <Zone_Info>
                {
                    Region.ZonesInfo.Find(z => z.ZoneId == 203),
                    Region.ZonesInfo.Find(z => z.ZoneId == 205),
                    Region.ZonesInfo.Find(z => z.ZoneId == 209)
                };
                break;

            // Here we start to implement the DoomsDay Event pairings - that is, T2 T3 T4 merge - not used :(
            case 6:     // T3 Empire vs Chaos
                Zones = new List <Zone_Info>
                {
                    Region.ZonesInfo.Find(z => z.ZoneId == 102),     // High Pass
                    Region.ZonesInfo.Find(z => z.ZoneId == 108)      // Talabecland
                };
                break;

            case 10:     // T3 Dwarf vs Greenskin
                Zones = new List <Zone_Info>
                {
                    Region.ZonesInfo.Find(z => z.ZoneId == 2),     // The Badlands
                    Region.ZonesInfo.Find(z => z.ZoneId == 8)      // Black Fire Pass
                };
                break;

            case 12:     // T2 Dwarf vs Greenskin
                Zones = new List <Zone_Info>
                {
                    Region.ZonesInfo.Find(z => z.ZoneId == 1),     // Marshes of Madness
                    Region.ZonesInfo.Find(z => z.ZoneId == 7)      // Barak V
                };
                break;

            case 14:     // T2 Empire vs Chaos
                Zones = new List <Zone_Info>
                {
                    Region.ZonesInfo.Find(z => z.ZoneId == 101),     // Troll Country
                    Region.ZonesInfo.Find(z => z.ZoneId == 107)      // Ostland
                };
                break;

            case 15:     // T2 High Elf vs Dark Elf
                Zones = new List <Zone_Info>
                {
                    Region.ZonesInfo.Find(z => z.ZoneId == 201),     // The Shadowlands
                    Region.ZonesInfo.Find(z => z.ZoneId == 207)      // Ellyrion
                };
                break;

            case 16:     // T3 High Elf vs Dark Elf
                Zones = new List <Zone_Info>
                {
                    Region.ZonesInfo.Find(z => z.ZoneId == 202),     // Avelorn
                    Region.ZonesInfo.Find(z => z.ZoneId == 208)      // Saphery
                };
                break;
            }

            // RB   4/29/2016   If this is a T4 Campaign region and we are building this Battlefront for the first time, load it after setting BOs.
            LoadPairing();
        }
        public static void F_INIT_PLAYER(BaseClient client, PacketIn packet)
        {
            GameClient cclient = (GameClient)client;

            Player Plr = cclient.Plr;

            if (Plr == null)
            {
                return;
            }

            if (!Plr.IsInWorld()) // If the player is not on a map, then we add it to the map
            {
                ushort zoneId   = Plr.Info.Value.ZoneId;
                ushort regionId = (ushort)Plr.Info.Value.RegionId;

                Zone_Info info = ZoneService.GetZone_Info(zoneId);
                if (info?.Type == 0)
                {
                    RegionMgr region = WorldMgr.GetRegion(regionId, true);
                    if (region.AddObject(Plr, zoneId, true))
                    {
                        return;
                    }
                }
                else if (info?.Type == 4 || info?.Type == 5 || info?.Type == 6) // login into a instance
                {
                    if (!WorldMgr.InstanceMgr.ZoneIn(Plr, (byte)info?.Type))    // cant login into the instace port to exit
                    {
                        Instance_Info II;
                        InstanceService._InstanceInfo.TryGetValue(zoneId, out II);
                        Zone_jump ExitJump = ZoneService.GetZoneJump(II.exitzonejup);
                        if (ExitJump == null)
                        {
                            Log.Error("Exit Jump in Instance", " " + zoneId + " missing!");
                        }
                        else
                        {
                            if (ExitJump.Type == 4)
                            {
                                WorldMgr.InstanceMgr.ZoneIn(Plr, 4, ExitJump);
                            }
                            else
                            {
                                Plr.Teleport(ExitJump.ZoneID, ExitJump.WorldX, ExitJump.WorldY, ExitJump.WorldZ, ExitJump.WorldO);
                            }
                        }
                    }
                    return;
                }

                // Warp a player to their bind point if they attempt to load into a scenario map.
                RallyPoint rallyPoint = RallyPointService.GetRallyPoint(Plr.Info.Value.RallyPoint);

                if (rallyPoint != null)
                {
                    Plr.Teleport(rallyPoint.ZoneID, rallyPoint.WorldX, rallyPoint.WorldY, rallyPoint.WorldZ, rallyPoint.WorldO);
                }

                else
                {
                    CharacterInfo cInfo = CharMgr.GetCharacterInfo(Plr.Info.Career);
                    Plr.Teleport(cInfo.ZoneId, (uint)cInfo.WorldX, (uint)cInfo.WorldY, (ushort)cInfo.WorldZ,
                                 (ushort)cInfo.WorldO);
                }
            }
            else
            {
                Plr.Loaded = false;
                Plr.StartInit();
            }
        }