Ejemplo n.º 1
0
        // Controlador
        public static void Controller(Client client, P_211 rcv)
        {
            if (!Regex.IsMatch(rcv.Name, @"^[A-Za-z0-9-]{4,12}$"))
            {
                client.Close("Nome inválido!");
            }
            else if (rcv.Slot < 0 || rcv.Slot > 3)
            {
                client.Close( );
            }
            else if (!Regex.IsMatch(rcv.Password, @"^[A-Za-z0-9]{4,10}$"))
            {
                client.Close( );
            }
            else
            {
                // Retorna character da conta
                ref Character character = ref client.Account.Characters [rcv.Slot];

                // Verifica se está vaziu
                if (character == null)
                {
                    client.Close( );
                }
                else
                {
                    // Envia os pacotes de apagar personagem
                    client.Send(P_112.New(client));
                    client.Send(P_101.New($"Personagem [{rcv.Name}] deletado!"));
                }
            }
Ejemplo n.º 2
0
        // Controlador
        public static void Controller(Client client, P_20D rcv)
        {
            if (!Regex.IsMatch(rcv.UserName, @"^[A-Za-z0-9]{4,12}$"))
            {
                client.Close("Somente letras e números no login. 4 a 12 caracteres.");
            }
            else if (!Regex.IsMatch(rcv.Password, @"^[A-Za-z0-9]{4,10}$"))
            {
                client.Close("Somente letras e números na senha. 4 a 10 caracteres.");
            }
            else
            {
                // Pequeno LOG da conta
                Log.Information($"UserName: {rcv.UserName}, {rcv.UserName.Length}");
                Log.Information($"Password: {rcv.Password}, {rcv.Password.Length}");

                // Define os dados da conta na Account do cliente
                client.Account.SetLogin(rcv.UserName, rcv.Password, $"{Config.Random.Next ( 1000 , 9999 )}", new Character [4]);

                // Prepara o pacote de login
                P_10A p010A = P_10A.New(client);

                p010A.UserName = rcv.UserName;

                // Envia os pacotes pro login
                client.Send(p010A);
                client.Send(P_101.New($"Entre com sua senha numérica! [{client.Account.Numeric}]"));

                // Atualiza o status do cliente
                client.Status = ClientStatus.Numeric;
            }
        }
Ejemplo n.º 3
0
 public void Close(string Reason)
 {
     if (Reason == null)
     {
         throw new Exception("Reason == null");
     }
     this.Send(P_101.New(Reason));
 }
Ejemplo n.º 4
0
        // Controlador
        public static void Controller(Client client, P_20F rcv)
        {
            if (!Regex.IsMatch(rcv.Name, @"^[A-Za-z0-9-]{4,12}$"))
            {
                client.Send(P_101.New("Somente letras e números no nome. 4 a 12 caracteres."));
            }
            else if (rcv.Slot < 0 || rcv.Slot > 3)
            {
                client.Close( );
            }
            else if (rcv.ClassInfo < 0 || rcv.ClassInfo > 3)
            {
                client.Close( );
            }
            else
            {
                // Retorna character da conta
                ref Character character = ref client.Account.Characters [rcv.Slot];

                // Verifica se não está vaziu
                if (character != null)
                {
                    client.Close( );
                }
                else
                {
                    // Inicializa novo character
                    character = new Character( );

                    // Referencia o MOB do character
                    ref SMob mob = ref character.Mob;

                    // Inicializa a classe selecionada no MOB
                    switch (rcv.ClassInfo)
                    {
                    case 1: mob = SMob.FM(rcv.Name); break;

                    case 2: mob = SMob.BM(rcv.Name); break;

                    case 3: mob = SMob.HT(rcv.Name); break;

                    default: mob = SMob.TK(rcv.Name); break;
                    }

                    // Atualiza os status do MOB
                    Functions.GetCurrentScore(character, true);

                    // Envia os pacotes de criação de personagem
                    client.Send(P_110.New(client));
                    client.Send(P_101.New($"Personagem [{rcv.Name}] criado! Bom jogo!"));
                }
Ejemplo n.º 5
0
        // Controlador
        public static void Controller(Client client, P_211 rcv)
        {
            if (!Regex.IsMatch(rcv.Name, @"^[A-Za-z0-9-]{4,12}$"))
            {
                client.Close("Nome inválido!");
            }
            else if (rcv.Slot < 0 || rcv.Slot > 3)
            {
                client.Close();
            }
            else if (!Regex.IsMatch(rcv.Password, @"^[A-Za-z0-9]{4,10}$"))
            {
                client.Close();
            }
            else
            {
                Character character = client.Account.Characters[rcv.Slot];

                // Verifica se está vaziu
                if (character == null)
                {
                    client.Close();
                }
                else if (client.Account.Numeric.Equals(rcv.Password))
                {
                    if (UserMobDAO.DeleteCharFile(character))
                    {
                        client.Character = null;
                        client.Account.Characters[rcv.Slot] = null;

                        UserAccountDAO.CreateOrUpdateAccount(client.Account);

                        // Envia os pacotes de apagar personagem
                        client.Send(P_112.New(client));
                        client.Send(P_101.New($"Personagem [{rcv.Name}] deletado!"));
                    }
                    else
                    {
                        client.Send(P_101.New($"Erro ao deletar o personagem [{rcv.Name}]!"));
                    }
                }
                else
                {
                    client.Send(P_101.New($"Senha numérica invalida!"));
                }
            }
        }
Ejemplo n.º 6
0
        private static void AddXpMob(Client client, ulong pAddXp)
        {
            client.Character.Mob.Exp += (ulong)(pAddXp * P_39D.GetBonusXp(client.Character));

            //atualiza o xp do client
            client.Send(P_337.New(client));

            //trata as mensagens de level, 1/4, 2/4 e 3/4
            if (client.Character.Mob.BaseStatus.Level <= 399)
            {
                if (client.Character.Mob.Exp <= Rate.Exp_Mortal_Arch[client.Character.Mob.BaseStatus.Level])
                {
                    ulong vaLevelOrigem = client.Character.Mob.BaseStatus.Level == 0 ? 0 : Rate.Exp_Mortal_Arch[client.Character.Mob.BaseStatus.Level - 1];
                    ulong vaNextLevel   = Rate.Exp_Mortal_Arch[client.Character.Mob.BaseStatus.Level];

                    ulong diferenca = vaNextLevel - vaLevelOrigem;

                    ulong va1 = vaLevelOrigem + (diferenca / 4);
                    ulong va2 = vaLevelOrigem + ((diferenca / 4) * 2);
                    ulong va3 = vaLevelOrigem + ((diferenca / 4) * 3);

                    ulong xpAtual = client.Character.Mob.Exp;

                    if ((xpAtual >= va1 && xpAtual < va2))
                    {
                        client.Send(P_101.New("1/4 BONUS"));
                        client.Send(P_36A.New(client, Emotion.LevelUP, 3));
                    }
                    else if ((xpAtual >= va2 && xpAtual <= va3))
                    {
                        client.Send(P_101.New("2/4 BONUS"));
                        client.Send(P_36A.New(client, Emotion.LevelUP, 3));
                    }
                    else if ((xpAtual >= va3 && xpAtual <= vaNextLevel))
                    {
                        client.Send(P_101.New("3/4 BONUS"));
                        client.Send(P_36A.New(client, Emotion.LevelUP, 3));
                    }
                }
                else
                {
                    Functions.GetCurrentScore(client, true);
                    client.Send(P_101.New("++++++ Level Up ++++++"));
                    client.Send(P_36A.New(client, Emotion.LevelUP, 3));
                }
            }
        }
Ejemplo n.º 7
0
        // Controlador
        public static void Controller(Client client, P_FDE rcv)
        {
            if (!Regex.IsMatch(rcv.Numeric, @"^[0-9]{4,6}$"))
            {
                client.Close("Senha numérica inválida!");
            }
            else
            {
                Log.Information($"Numeric: {rcv.Numeric}, {rcv.Numeric.Length}");

                if (client.Status == ClientStatus.Numeric)
                {
                    if (client.Account.Numeric == string.Empty)
                    {
                        client.Account.Numeric = rcv.Numeric;
                        UserAccountDAO.CreateOrUpdateAccount(client.Account);
                    }
                    if (rcv.Numeric != client.Account.Numeric)
                    {
                        client.Send(SHeader.New(0x0FDF, Marshal.SizeOf <SHeader>(), 0));
                        client.Send(P_101.New($"Senha numérica inválida!"));
                    }
                    else
                    {
                        client.Send(SHeader.New(0x0FDE, Marshal.SizeOf <SHeader>(), 0));
                        client.Send(P_101.New("Seja bem-vindo ao Open WYD Server!"));

                        client.Status = ClientStatus.Characters;
                    }
                }
                else if (client.Status == ClientStatus.Characters)
                {
                    if (rcv.Change != 1)
                    {
                        client.Close();
                    }
                    else
                    {
                        client.Send(P_101.New("Alterar senha numérica em desenvolvimento!"));
                    }
                }
                else
                {
                    client.Close();
                }
            }
        }
Ejemplo n.º 8
0
        // Controlador
        public static void Controller(Client client, P_20F rcv)
        {
            if (!Regex.IsMatch(rcv.Name, @"^[A-Za-z0-9-]{4,12}$"))
            {
                client.Send(P_101.New("Somente letras e números no nome. 4 a 12 caracteres."));
            }
            else if (rcv.Slot < 0 || rcv.Slot > 3)
            {
                client.Close( );
            }
            else if (rcv.ClassInfo < 0 || rcv.ClassInfo > 3)
            {
                client.Close( );
            }
            else
            {
                // Retorna character da conta
                ref Character character = ref client.Account.Characters[rcv.Slot];

                // Verifica se não está vaziu
                if (character != null)
                {
                    client.Close( );
                }
                else
                {
                    character               = new Character(SMob.New());
                    character.Mob.Name      = rcv.Name;
                    character.Mob.ClassInfo = (ClassInfo)rcv.ClassInfo;
                    character               = UserMobDAO.CreateOrUpdateChar(character);

                    if (character != null)
                    {
                        //Atualiza o xml da account para salvar o novo char criado
                        UserAccountDAO.CreateOrUpdateAccount(client.Account);

                        // Envia os pacotes de criação de personagem
                        client.Send(P_110.New(client));
                        client.Send(P_101.New($"Personagem [{character.Mob.Name}] criado! Bom jogo!"));
                    }
                    else
                    {
                        client.Send(P_101.New($"Erro ao criar o personagem, contate o suporte!"));
                    }
                }
            }
Ejemplo n.º 9
0
        public static void controller(Client client, P_37A p37a)
        {
            int gold = client.Character.Mob.Gold + Config.Itemlist[client.Character.Mob.Inventory[p37a.SlotMob].Id].Price;

            if (gold > 2000000000)
            {
                client.Character.Mob.AddItemToCharacter(client, client.Character.Mob.Inventory[p37a.SlotMob], TypeSlot.Inventory, p37a.SlotMob);
                client.Send(P_101.New("O limite de 2 Bilhao de gold foi atingido!"));
            }
            else
            {
                client.Character.Mob.RemoveItemToCharacter(client, TypeSlot.Inventory, p37a.SlotMob);

                //atualiza o gold do mob
                client.Character.Mob.Gold = gold;
                client.Send(P_3AF.New(client, client.Character.Mob.Gold));
            }
        }
Ejemplo n.º 10
0
        // Controlador
        public static void Controller(Client client, P_20D rcv)
        {
            if (!Regex.IsMatch(rcv.UserName, @"^[A-Za-z0-9]{4,12}$"))
            {
                client.Close("Somente letras e números no login. 4 a 12 caracteres.");
            }
            else if (!Regex.IsMatch(rcv.Password, @"^[A-Za-z0-9]{4,10}$"))
            {
                client.Close("Somente letras e números na senha. 4 a 10 caracteres.");
            }
            else
            {
                Account account = UserAccountDAO.loadAccount(rcv.UserName, rcv.Password);

                //TODO: remover apos finalizar o emulador
                if (account == null)
                {
                    UserAccountDAO.CreateOrUpdateAccount(new Account(rcv.UserName, rcv.Password));
                    account = UserAccountDAO.loadAccount(rcv.UserName, rcv.Password);
                }

                if (account != null)
                {
                    client.Account = account;
                    // Prepara o pacote de login
                    P_10A p010A = P_10A.New(client);

                    p010A.UserName = rcv.UserName;

                    // Envia os pacotes pro login
                    client.Send(p010A);
                    client.Send(P_101.New($"Entre com sua senha numérica!"));

                    // Atualiza o status do cliente
                    client.Status = ClientStatus.Numeric;
                }
                else
                {
                    client.Send(P_101.New($"Usuario ou Senha invalida!"));
                }
            }
        }
Ejemplo n.º 11
0
        public static void controller(Client client, P_379 p379)
        {
            SMob      Npc    = Config.MobList.Where(a => a.Mob.ClientId == p379.NpcId).FirstOrDefault().Mob;
            SItem     itemId = Config.MobList.Where(a => a.Mob.ClientId == p379.NpcId).FirstOrDefault().Mob.Inventory[p379.SlotNpc];
            SItemList item   = Config.Itemlist[itemId.Id];

            if (item.Price <= client.Character.Mob.Gold)
            {
                int tamanho = 30;
                if (client.Character.Mob.Andarilho[0].Id != 0)
                {
                    tamanho += 15;
                }
                if (client.Character.Mob.Andarilho[1].Id != 0)
                {
                    tamanho += 15;
                }

                //checa se o inventario esta cheio
                if (client.Character.Mob.Inventory.Where(a => a.Id != 0).Count() == tamanho)
                {
                    client.Send(P_101.New("O inventario esta cheio."));
                }
                else
                {
                    client.Character.Mob.Gold -= item.Price;
                    client.Character.Mob.Inventory[p379.InventorySlot] = itemId;

                    //Adiciona o item no inventorio
                    client.Character.Mob.AddItemToCharacter(client, itemId, TypeSlot.Inventory, p379.InventorySlot);

                    //atualiza o gold do mob
                    client.Send(P_3AF.New(client, client.Character.Mob.Gold));
                }
            }
            else
            {
                client.Send(P_101.New("Gold insuficiente"));
            }
        }
Ejemplo n.º 12
0
        public byte [] Unk1;            // 16 a 35	= 20

        // Controlador
        public static void Controller(Client client, P_213 rcv)
        {
            if (rcv.Slot < 0 || rcv.Slot > 3)
            {
                client.Close( );
            }
            else
            {
                // Retorna o personagem selecionado
                Character character = client.Account.Characters [rcv.Slot];

                if (character == null)
                {
                    client.Close( );
                }
                else
                {
                    // Retorna um ClientId vaziu
                    short ClientId = client.Channel.GetClientId( );

                    if (ClientId < Config.Values.Clients.MinCid)
                    {
                        client.Send(P_101.New("Parece que este canal está lotado. Tente novamente!"));
                    }
                    else
                    {
                        // Retorna a posição de respawn
                        Coord coord = Functions.GetFreeRespawnCoord(client.Channel.Map, character);

                        if (coord == null)
                        {
                            client.Send(P_101.New("Parece que este o mapa está lotado. Tente novamente!"));
                        }
                        else
                        {
                            // Define o ClientId do cliente
                            client.ClientId = character.Mob.ClientId = ClientId;

                            // Define a posição do mob
                            character.Mob.LastPosition = SPosition.New(coord);

                            // Adiciona posição a lista de posições
                            character.Positions.Clear( );
                            character.Positions.Add(character.Mob.LastPosition);

                            // Define o cliente na coordenada
                            coord.Client = client;

                            // Envia o pacote de entrar no mundo
                            client.Send(P_114.New(character));

                            // Prepara o pacote de visão do cliente
                            P_364 p364 = P_364.New(character, EnterVision.LogIn);

                            // Envia o pacote de visão do cliente pro cliente
                            client.Send(p364);

                            // Altera o status do cliente
                            client.Status = ClientStatus.Game;

                            // Define o mapa, character do cliente e inicia o Surround
                            client.Map       = client.Channel.Map;
                            client.Character = character;
                            client.Surround  = new Surround(client);

                            // Atualiza os arredores e envia a visão para todos e para o cliente
                            client.Surround.UpdateSurrounds(null, entered => {
                                entered.ForEach(a => {
                                    switch (a)
                                    {
                                    case Client client2: {
                                        client.Send(P_364.New(client2.Character, EnterVision.Normal));
                                        client2.Send(p364);
                                        break;
                                    }
                                    }
                                });
                            }, null);

                            // Envia uma mensagem pro cliente
                            client.Send(P_101.New("Seja bem-vindo ao mundo do Open WYD Server!"));
                        }
                    }
                }
            }
        }
Ejemplo n.º 13
0
        public static void controller(Client client, P_376 p376)
        {
            SItem tempItem = new SItem();

            switch (p376.TypeSrc)
            {
            case (byte)TypeSlot.Storage:
                tempItem = client.Account.Storage.Item[p376.SrcSlot];
                switch (p376.TypeDest)
                {
                case (byte)TypeSlot.Storage:         // bau para o bau
                                                     //Se eh volatile nao faz a alteracao de posicao e sim agrupa-os
                    if (AgrupaVolatile(client, ref p376))
                    {
                        client.Account.Storage.Item[p376.SrcSlot]  = client.Account.Storage.Item[p376.DestSlot];
                        client.Account.Storage.Item[p376.DestSlot] = tempItem;
                    }
                    break;

                case (byte)TypeSlot.Inventory:         // bau para o inventorio

                    //Se eh volatile nao faz a alteracao de posicao e sim agrupa-os
                    if (AgrupaVolatile(client, ref p376))
                    {
                        client.Account.Storage.Item[p376.SrcSlot]     = client.Character.Mob.Inventory[p376.DestSlot];
                        client.Character.Mob.Inventory[p376.DestSlot] = tempItem;
                    }
                    break;

                case (byte)TypeSlot.Equip:         // bau para o equip

                    if (permicaoEquipItem(tempItem, client.Character.Mob, p376.DestSlot))
                    {
                        client.Account.Storage.Item[p376.SrcSlot] = client.Character.Mob.Equip[p376.DestSlot];
                        client.Character.Mob.Equip[p376.DestSlot] = tempItem;
                    }
                    else
                    {
                        client.Send(P_101.New("Não é permitido usar o item"));
                    }

                    Functions.GetCurrentScore(client, false);
                    break;
                }
                break;

            case (byte)TypeSlot.Inventory:
                tempItem = client.Character.Mob.Inventory[p376.SrcSlot];
                switch (p376.TypeDest)
                {
                case (byte)TypeSlot.Storage:         //Iventorio para o bau
                    //Se eh volatile nao faz a alteracao de posicao e sim agrupa-os
                    if (AgrupaVolatile(client, ref p376))
                    {
                        client.Character.Mob.Inventory[p376.SrcSlot] = client.Account.Storage.Item[p376.DestSlot];
                        client.Account.Storage.Item[p376.DestSlot]   = tempItem;
                    }
                    break;

                case (byte)TypeSlot.Inventory:         //Iventorio para o inventorio

                    //Se eh volatile nao faz a alteracao de posicao e sim agrupa-os
                    if (AgrupaVolatile(client, ref p376))
                    {
                        client.Character.Mob.Inventory[p376.SrcSlot]  = client.Character.Mob.Inventory[p376.DestSlot];
                        client.Character.Mob.Inventory[p376.DestSlot] = tempItem;
                    }

                    break;

                case (byte)TypeSlot.Equip:        //Iventorio para o equip

                    if (permicaoEquipItem(tempItem, client.Character.Mob, p376.DestSlot))
                    {
                        client.Character.Mob.Inventory[p376.SrcSlot] = client.Character.Mob.Equip[p376.DestSlot];
                        client.Character.Mob.Equip[p376.DestSlot]    = tempItem;
                    }
                    else
                    {
                        client.Send(P_101.New("Não é permitido usar o item"));
                    }

                    Functions.GetCurrentScore(client, false);
                    break;
                }
                break;

            case (byte)TypeSlot.Equip:
                tempItem = client.Character.Mob.Equip[p376.SrcSlot];
                switch (p376.TypeDest)
                {
                case (byte)TypeSlot.Storage:         //Equipe para o bau
                    client.Character.Mob.Equip[p376.SrcSlot]   = client.Account.Storage.Item[p376.DestSlot];
                    client.Account.Storage.Item[p376.DestSlot] = tempItem;
                    break;

                case (byte)TypeSlot.Inventory:         //Equipe para o iventario
                    client.Character.Mob.Equip[p376.SrcSlot]      = client.Character.Mob.Inventory[p376.DestSlot];
                    client.Character.Mob.Inventory[p376.DestSlot] = tempItem;
                    break;

                case (byte)TypeSlot.Equip:         // Equipe para equipe
                    client.Character.Mob.Equip[p376.SrcSlot]  = client.Character.Mob.Equip[p376.DestSlot];
                    client.Character.Mob.Equip[p376.DestSlot] = tempItem;
                    break;
                }
                Functions.GetCurrentScore(client, false);
                break;
            }
            client.Send(P_376.New(client, p376));
        }
Ejemplo n.º 14
0
        public static void controller(Client client, short mobId, ulong xpAdd)
        {
            //mata o mob
            client.Send(P_338.New(client, mobId, xpAdd));

            //obtem os itens do mob
            SMobList mob = client.MobView.Where(a => a.Mob.ClientId == mobId).FirstOrDefault();

            //regra de drop:
            //0  a 14 slot sao drop normal      Tx 90%
            //15 a 29 slot drop dificil         Tx 65%
            //30 a 44 slot drop raro            TX 40%
            //45 a 60 slot drop super raro      Tx 15%


            int   TaxaDrop    = new Random().Next(0, 100);
            SItem itemDropado = SItem.New();

            //inicia o slot com 60 pois para dar a probalidade de nao receber nenhum item
            int slot = 60;

            if (TaxaDrop >= 0 && TaxaDrop <= 15)
            {
                slot = new Random().Next(45, GetSlotAvailable(mob.Mob.Inventory, 45, 59));
            }

            if (TaxaDrop >= 16 && TaxaDrop <= 40)
            {
                slot = new Random().Next(30, GetSlotAvailable(mob.Mob.Inventory, 30, 44));
            }

            if (TaxaDrop >= 41 && TaxaDrop <= 65)
            {
                slot = new Random().Next(15, GetSlotAvailable(mob.Mob.Inventory, 15, 29));
            }

            if (TaxaDrop >= 66 && TaxaDrop <= 100)
            {
                slot = new Random().Next(0, GetSlotAvailable(mob.Mob.Inventory, 0, 14));
            }

            itemDropado = mob.Mob.Inventory[slot];

            if (itemDropado.Id != 0)
            {
                int tamanho = 30;
                if (client.Character.Mob.Andarilho[0].Id != 0)
                {
                    tamanho += 15;
                }
                if (client.Character.Mob.Andarilho[1].Id != 0)
                {
                    tamanho += 15;
                }

                //checa se o inventario esta cheio
                if (mob.Mob.Inventory.Where(a => a.Id != 0).Count() == tamanho)
                {
                    client.Send(P_101.New("O inventario esta cheio."));
                }
                else
                {
                    client.Character.Mob.Gold += mob.Mob.Gold < 0 ? mob.Mob.Gold * -1 : mob.Mob.Gold;
                    client.Character.Mob.Inventory.ToList().ForEach(a => { slot = 0; if (a.Id == 0)
                                                                           {
                                                                               return;
                                                                           }
                                                                           else
                                                                           {
                                                                               slot += 1;
                                                                           } });
                    client.Character.Mob.AddItemToCharacter(client, itemDropado, TypeSlot.Inventory, slot);
                }
            }
            Log.Normal($"Teve: {TaxaDrop}% de conseguir algum item");
        }
Ejemplo n.º 15
0
        public SPosition Dst;       // 12 a 16	= 4

        public static void Controller(Client client)
        {
            int posX = client.Character.Mob.LastPosition.X;
            int posY = client.Character.Mob.LastPosition.Y;

            if (posX >= 2116 && posY >= 2100 && posX <= 2119 && posY <= 2103) //Armia->Noatum  "X"
            {
                Teleport(client, SPosition.New(1046, 1725));
            }

            else if (posX >= 2140 && posY >= 2068 && posX <= 2143 && posY <= 2071) //Armia -> Campo de Treino
            {
                Teleport(client, SPosition.New(2590, 2096));
            }

            else if (posX >= 1044 && posY >= 1724 && posX <= 1047 && posY <= 1727)  //Noatum->Armia  "X"
            {
                Teleport(client, SPosition.New(2116, 2100));
            }

            else if (posX >= 1052 && posY >= 1708 && posX <= 1055 && posY <= 1711) //Noatum->Gelo  "X"
            {
                Teleport(client, SPosition.New(3649, 3109));
            }

            else if (posX >= 3648 && posY >= 3108 && posX <= 3651 && posY <= 3111) //Gelo->Noatum  "X"
            {
                Teleport(client, SPosition.New(1054, 1710));
            }

            else if (posX >= 1044 && posY >= 1716 && posX <= 1047 && posY <= 1719) //Noatum->Azram  "X"
            {
                Teleport(client, SPosition.New(2480, 1716));
            }

            else if (posX >= 2480 && posY >= 1716 && posX <= 2483 && posY <= 1720) //Azram -> Noatum"X"
            {
                Teleport(client, SPosition.New(1044, 1717));
            }

            else if (posX >= 2468 && posY >= 1716 && posX <= 2471 && posY <= 1719) // Azram -> Chefe de Treino
            {
                Teleport(client, SPosition.New(2250, 1557));
            }

            else if (posX >= 2452 && posY >= 1716 && posX <= 2455 && posY <= 1719) //Azram -> Perto da Agua
            {
                Teleport(client, SPosition.New(1969, 1713));
            }

            else if (posX >= 1044 && posY >= 1708 && posX <= 1047 && posY <= 1711) //Noatum->Erion  "X"
            {
                Teleport(client, SPosition.New(2456, 2016));
            }

            else if (posX >= 2456 && posY >= 2016 && posX <= 2459 && posY <= 2019) //Erion -> Noatum "X"
            {
                Teleport(client, SPosition.New(1044, 1708));
            }

            else if (posX >= 2452 && posY >= 1988 && posX <= 2455 && posY <= 1991) //Erion -> Campo de Erion
            {
                Teleport(client, SPosition.New(1990, 1756));
            }

            else if (posX >= 1056 && posY >= 1724 && posX <= 1059 && posY <= 1728) //Noatum -> Campo Deserto
            {
                Teleport(client, SPosition.New(1157, 1718));
            }
            //Adicionar teleporte para guerra qnd for domingo ao invez de campo de treino

            else if (posX >= 1312 && posY >= 1900 && posX <= 1315 && posY <= 1903) //Deserto->Kefra  "X"
            {
                Teleport(client, SPosition.New(2366, 4072));
            }

            else if (posX >= 2364 && posY >= 4072 && posX <= 2367 && posY <= 4075) //Kefra->Deserto  "X"
            {
                Teleport(client, SPosition.New(1314, 1901));
            }

            else if (posX >= 2364 && posY >= 3924 && posX <= 2367 && posY <= 3927)//Hall do Kefra to City Kefra
            {
                Teleport(client, SPosition.New(3250, 1703));
            }

            else if (posX >= 2362 && posY >= 3892 && posX <= 2370 && posY <= 3895)
            {
                Teleport(client, SPosition.New(2366, 3910));
            }

            else if (posX >= 2452 && posY >= 1716 && posX <= 2455 && posY <= 1719)
            {
                Teleport(client, SPosition.New(1965, 1770));
            }

            else if (posX >= 1108 && posY >= 1980 && posX <= 1111 && posY <= 1983)
            {
                Teleport(client, SPosition.New(3650, 3109));
            }

            else if (posX >= 744 && posY >= 3804 && posX <= 747 && posY <= 3807)
            {
                Teleport(client, SPosition.New(912, 3811));
            }

            else if (posX >= 744 && posY >= 3816 && posX <= 747 && posY <= 3819)
            {
                Teleport(client, SPosition.New(1006, 3993));
            }

            else if (posX >= 912 && posY >= 3808 && posX <= 915 && posY <= 3811) // Dungeon->Dungeon  "X"
            {
                Teleport(client, SPosition.New(747, 3806));
            }

            else if (posX >= 1516 && posY >= 3996 && posX <= 1519 && posY <= 3999)
            {
                client.Send(P_101.New($"Estamos em Construçao Sistema de teleporte  !."));
            }

            else if (posX >= 1056 && posY >= 1724 && posX <= 1059 && posY <= 1727)
            {
                int cHor = DateTime.Now.Hour;

                if (client.Character.Mob.Gold >= 500000)
                {
                    if (cHor >= 18 && cHor <= 19)
                    {
                        if (client.Character.Mob.Gold >= 500000)
                        {
                            client.Character.Mob.Gold -= 500000;
                            Teleport(client, SPosition.New(1160, 1726));
                        }
                        else
                        {
                            client.Send(P_101.New($"Custo do teleporte é de 500.000 gold."));
                        }
                    }
                    else
                    {
                        client.Character.Mob.Gold -= 500000;
                        Teleport(client, SPosition.New(3237, 1691));
                    }
                }
            }
        }