예제 #1
0
        static void ServerStuff_Execute()
        {
            ServerBase.Kernel.Elite_PK_Tournament.SendThis();
            Console.Title = "Source 5620 : " + Program.StartDate.ToString("MM/dd/yyyy hh:mm") + "- Players Online: " + ServerBase.Kernel.GamePool.Count + "||" + Program.PlayerCap + " Votes =" + Kernel.VotePool.Count;
            new Database.MySqlCommand(Database.MySqlCommandType.UPDATE).Update("configuration")
                .Set("GuildID", Game.ConquerStructures.Society.Guild.GuildCounter.Now)
                .Set("ItemUID", Network.GamePackets.ConquerItem.ItemUID.Now)
                .Set("DetainItemUID", Database.DetainedItemTable.Counter.Now).Set("ClanUID", Game.Clans.ClanCount.Now)
                .Where("Server", ServerBase.Constants.ServerName).Execute();
            ServerBase.FrameworkTimer.Dispose();

            if (DateTime.Now > Game.ConquerStructures.Broadcast.LastBroadcast.AddMinutes(1))
            {
                if (Game.ConquerStructures.Broadcast.Broadcasts.Count > 0)
                {
                    Game.ConquerStructures.Broadcast.CurrentBroadcast = Game.ConquerStructures.Broadcast.Broadcasts[0];
                    Game.ConquerStructures.Broadcast.Broadcasts.Remove(Game.ConquerStructures.Broadcast.CurrentBroadcast);
                    Game.ConquerStructures.Broadcast.LastBroadcast = DateTime.Now;
                    ServerBase.Kernel.SendWorldMessage(new Network.GamePackets.Message(Game.ConquerStructures.Broadcast.CurrentBroadcast.Message, "ALLUSERS", Game.ConquerStructures.Broadcast.CurrentBroadcast.EntityName, System.Drawing.Color.Red, Network.GamePackets.Message.BroadcastMessage), ServerBase.Kernel.GamePool.Values);
                }
                else
                    Game.ConquerStructures.Broadcast.CurrentBroadcast.EntityID = 1;
            }

            DateTime Now = DateTime.Now;
            if (DateTime.Now.Hour == 00 && DateTime.Now.Minute == 00 && DateTime.Now.Second == 00 || DateTime.Now.Hour == 03 && DateTime.Now.Minute == 00 && DateTime.Now.Second == 00 || DateTime.Now.Hour == 06 && DateTime.Now.Minute == 00 && DateTime.Now.Second == 00 || DateTime.Now.Hour == 09 && DateTime.Now.Minute == 00 && DateTime.Now.Second == 00 || DateTime.Now.Hour == 12 && DateTime.Now.Minute == 00 && DateTime.Now.Second == 00 || DateTime.Now.Hour == 15 && DateTime.Now.Minute == 00 && DateTime.Now.Second == 00 || DateTime.Now.Hour == 18 && DateTime.Now.Minute == 00 && DateTime.Now.Second == 00 || DateTime.Now.Hour == 21 && DateTime.Now.Minute == 00 && DateTime.Now.Second == 00)
            {
                Program.CommandsAI("@save");
            }

            if (Now > LastRandomReset.AddMinutes(30))
            {
                LastRandomReset = Now;
                ServerBase.Kernel.Random = new Random(RandomSeed);
            }
            Today = Now.DayOfWeek;

            if (Now >= RestartDate)
            {
                CommandsAI("@restart");
                ServerStuff.Closed = true;
                return;
            }
            var Values = ServerBase.Kernel.WasInGamePool.Base.ToArray();
            foreach (KeyValuePair<uint, Client.GameState> vals in Values)
            {
                Client.GameState client = vals.Value;
                if (client.Disconnected2 == true)
                    return;
                if (client == null || client.Entity == null || client.Account == null)
                {
                    ServerBase.Kernel.WasInGamePool.Remove(vals.Key);
                    return;
                }
                if (!client.Socket.Connected)
                {
                    Database.EntityTable.SaveEntity(client);
                    Database.SkillTable.SaveProficiencies(client);
                    Database.SkillTable.SaveSpells(client);
                    Database.ArenaTable.SaveArenaStatistics(client.ArenaStatistic);
                    ServerBase.Kernel.WasInGamePool.Remove(vals.Key);
                    Database.EntityTable.UpdateOnlineStatus(client, false);
                }
            }
            foreach (Client.GameState client in Kernel.GamePool.Values)
            {
                client.Account.Save();
                Database.EntityTable.SaveEntity(client);
                Database.SkillTable.SaveProficiencies(client);
                Database.SkillTable.SaveSpells(client);
                Database.ArenaTable.SaveArenaStatistics(client.ArenaStatistic);
                //
            }
            #region remove monk buff
            foreach (Client.GameState client in Kernel.GamePool.Values)
            {
                if (client.Entity.Owner.Team != null)
                {
                    foreach (Client.GameState teammate in client.Entity.Owner.Team.Teammates)
                    {
                        if (ServerBase.Kernel.GetDistance(client.Entity.X, client.Entity.Y, teammate.Entity.X, teammate.Entity.Y) > 20)
                        {
                            if (client.Entity.ContainsFlag2(Update.Flags2.TyrantAura))//FendAura
                            {
                                client.Entity.RemoveFlag2(Update.Flags2.TyrantAura);//FendAura
                                client.Entity.Statistics.CriticalStrike -= 200;
                            }
                            if (client.Entity.ContainsFlag2(Update.Flags2.MetalAura))//MetalAura
                            {
                                client.Entity.RemoveFlag2(Update.Flags2.MetalAura);//MetalAura
                                client.Entity.Statistics.MetalResistance -= 30;
                            }
                            if (client.Entity.ContainsFlag2(Update.Flags2.WoodAura))//WoodAura
                            {
                                client.Entity.Statistics.WoodResistance -= 30;
                                client.Entity.RemoveFlag2(Update.Flags2.WoodAura);//WoodAura
                            }
                            if (client.Entity.ContainsFlag2(Update.Flags2.WaterAura))//WaterAura
                            {
                                client.Entity.Statistics.WaterResistance -= 30;
                                client.Entity.RemoveFlag2(Update.Flags2.WaterAura);//WaterAura
                            }
                            if (client.Entity.ContainsFlag2(Update.Flags2.FireAura))//FireAura
                            {
                                client.Entity.Statistics.FireResistance -= 30;
                                client.Entity.RemoveFlag2(Update.Flags2.FireAura);//FireAura
                            }
                            if (client.Entity.ContainsFlag2(Update.Flags2.EarthAura))//EarthAura
                            {
                                client.Entity.Statistics.EarthResistance -= 30;
                                client.Entity.RemoveFlag2(Update.Flags2.EarthAura);//EarthAura
                            }
                            if (client.Entity.ContainsFlag2(Update.Flags2.FendAura))//TyrantAura
                            {
                                client.Entity.RemoveFlag2(Update.Flags2.FendAura);//TyrantAura
                                client.Entity.Statistics.Immunity -= 200;

                            }
                            client.Entity.RemoveFlag2(Update.Flags2.FendAura);
                            client.Entity.RemoveFlag2(Update.Flags2.TyrantAura);
                            client.Entity.RemoveFlag2(Update.Flags2.MetalAura);
                            client.Entity.RemoveFlag2(Update.Flags2.WoodAura);
                            client.Entity.RemoveFlag2(Update.Flags2.WaterAura);
                            client.Entity.RemoveFlag2(Update.Flags2.FireAura);
                            client.Entity.RemoveFlag2(Update.Flags2.EarthAura);
                            client.Entity.RemoveFlag2(Update.Flags2.TyrantAura);
                            teammate.Entity.RemoveFlag2(Update.Flags2.FendAura);
                            teammate.Entity.RemoveFlag2(Update.Flags2.TyrantAura);
                            teammate.Entity.RemoveFlag2(Update.Flags2.MetalAura);
                            teammate.Entity.RemoveFlag2(Update.Flags2.WoodAura);
                            teammate.Entity.RemoveFlag2(Update.Flags2.WaterAura);
                            teammate.Entity.RemoveFlag2(Update.Flags2.FireAura);
                            teammate.Entity.RemoveFlag2(Update.Flags2.EarthAura);
                            teammate.Entity.RemoveFlag2(Update.Flags2.TyrantAura);
                            if (teammate.Entity.ContainsFlag2(Update.Flags2.TyrantAura))//FendAura
                            {
                                teammate.Entity.RemoveFlag2(Update.Flags2.TyrantAura);//FendAura
                                teammate.Entity.Statistics.CriticalStrike -= 200;
                            }
                            if (teammate.Entity.ContainsFlag2(Update.Flags2.MetalAura))//MetalAura
                            {
                                teammate.Entity.RemoveFlag2(Update.Flags2.MetalAura);//MetalAura
                                teammate.Entity.Statistics.MetalResistance -= 30;
                            }
                            if (teammate.Entity.ContainsFlag2(Update.Flags2.WoodAura))//WoodAura
                            {
                                teammate.Entity.RemoveFlag2(Update.Flags2.WoodAura);//WoodAura
                                teammate.Entity.Statistics.WoodResistance -= 30;
                            }
                            if (teammate.Entity.ContainsFlag2(Update.Flags2.WaterAura))//WaterAura
                            {
                                teammate.Entity.RemoveFlag2(Update.Flags2.WaterAura);//WaterAura
                                teammate.Entity.Statistics.WaterResistance -= 30;
                            }
                            if (teammate.Entity.ContainsFlag2(Update.Flags2.FireAura))//FireAura
                            {
                                teammate.Entity.RemoveFlag2(Update.Flags2.FireAura);//FireAura
                                teammate.Entity.Statistics.FireResistance -= 30;
                            }
                            if (teammate.Entity.ContainsFlag2(Update.Flags2.EarthAura))//EarthAura
                            {
                                teammate.Entity.RemoveFlag2(Update.Flags2.EarthAura);//EarthAura
                                teammate.Entity.Statistics.EarthResistance -= 30;
                            }
                            if (teammate.Entity.ContainsFlag2(Update.Flags2.FendAura))//TyrantAura
                            {
                                teammate.Entity.RemoveFlag2(Update.Flags2.FendAura);//TyrantAura
                                teammate.Entity.Statistics.Immunity -= 200;
                            }

                        }
                    }

                }
            }
            #endregion
            if (Game.ConquerStructures.Society.GuildWar.IsWar)
            {
                if (Time32.Now > Game.ConquerStructures.Society.GuildWar.ScoreSendStamp.AddSeconds(3))
                {
                    Game.ConquerStructures.Society.GuildWar.ScoreSendStamp = Time32.Now;
                    Game.ConquerStructures.Society.GuildWar.SendScores();
                }
                if (!Game.ConquerStructures.Society.GuildWar.Flame10th)
                {
                    if (Now >= Game.ConquerStructures.Society.GuildWar.StartTime.AddHours(1).AddMinutes(30))
                    {
                        Game.ConquerStructures.Society.GuildWar.Flame10th = true;
                        ServerBase.Kernel.SendWorldMessage(new Network.GamePackets.Message("You can now go and light the last flame which is near the Pole in GuildWar.", System.Drawing.Color.Orange, Network.GamePackets.Message.Center), ServerBase.Kernel.GamePool.Values);
                    }
                }

            }

            else
            {
                try
                {
                    #region kill connection
                    if (Now.Second >= 0)
                    {
                        MySql.Data.MySqlClient.MySqlConnection conn = DataHolder.MySqlConnection;
                        conn.Close();
                        conn.Dispose();
                        //conn.Open();
                        KillConnections.Kill();

                    }
                    #endregion
                    #region restart lottery
                    try
                    {

                        if (Now.Hour == 00 && Now.Minute == 00)
                        {
                            foreach (Client.GameState clients2 in ServerBase.Kernel.GamePool.Values)
                            {
                                Database.PkWarEvent.QQ(clients2);
                                Database.EntityTable.ResetLottery2(clients2);
                                //CommandsAI("@restart");
                                // ServerStuff.Closed = true;

                                Conquer_Online_Server.Game.ConquerStructures.PlayersVot Vot = new Conquer_Online_Server.Game.ConquerStructures.PlayersVot();
                                Vot.AdressIp = clients2.Account.IP;
                                Vot.Uid = clients2.Entity.UID;
                                Kernel.VotePool.Remove(Vot.AdressIp);
                                Kernel.VotePoolUid.Remove(Vot.Uid);
                                Database.EntityTable.DeletVotes(Vot);
                            }
                        }
                    }
                    catch { }
                    //return;
                    #endregion
                    #region Wethard
                    //foreach (Client.GameState clients in ServerBase.Kernel.GamePool.Values)
                    //{

                    //    //Game.Weather.CurrentWeatherBase.Send(client);
                    //    Conquer_Online_Server.Network.GamePackets.Weather weather = new Conquer_Online_Server.Network.GamePackets.Weather(true);
                    //    weather.WeatherType = Conquer_Online_Server.Network.GamePackets.Weather.Snow;
                    //    weather.Direction = 255;
                    //    weather.Appearence = 255;
                    //    weather.Intensity = 255;
                    //    weather.Send(clients);

                    //}
                    #endregion
                    #region Message Timing
                    if (DateTime.Now > m_msgDate.AddMinutes(5))
                    {
                        m_msgDate = DateTime.Now;
                        string Msg = "";
                        switch (m_Counter)
                        {
                            case 0: Msg = "GMs have [GM] or [PM] at the end of their names. Don`t trust anyone claiming to be a GM but not having [GM]/[PM] in their names !"; m_Counter++; break;
                            case 1: Msg = "Help UnknownMan at Market (212,204) to level up quickly"; m_Counter++; break;
                            case 2: Msg = "Trading of game accounts is illegal and may result in the instant banning of the accounts involved in the trading."; m_Counter++; break;
                            case 3: Msg = "you can donate and get Cps or Vip or Items call 01278771180"; m_Counter++; break;
                            case 4: Msg = "If You Need To Be Second Reborn Pirate or Reborn To Pirate You can Call PM  01278771180."; m_Counter++; break;
                            case 5: Msg = "you can call 01278771180 only PM number for more donate."; m_Counter = 0; break;
                            default: return;
                        }
                        Network.PacketHandler.WorldMessage(Msg);
                    }
                    #endregion
                    #region SteedRace New Time XX:30
                    try
                    {

                        if (Now.Minute == 30 && Now.Second == 0)
                        {
                            Program.Steed = true;
                            SteedRaces.SteedRace();
                            Client.GameState[] client = Conquer_Online_Server.ServerBase.Kernel.GamePool.Values.ToArray();
                            foreach (Client.GameState clientss in client)
                            {
                                Network.GamePackets.NpcReply npc = new Network.GamePackets.NpcReply(6, "The SteedRace Started! You Wana Join?");
                                npc.OptionID = 239;
                                clientss.Send(npc.ToArray());
                            }
                            Console.WriteLine2("Steed Race has started. [" + Now.Hour + ":" + Now.Minute + ":" + Now.Second + "]");
                        }
                        if (Now.Minute == 40 && Now.Second == 0)
                        {
                            Program.Steed = false;
                            Client.GameState[] client = Conquer_Online_Server.ServerBase.Kernel.GamePool.Values.ToArray();
                            foreach (Client.GameState clientss in client)
                            {
                                Network.GamePackets.NpcReply npc = new Network.GamePackets.NpcReply(6, "The SteedRace finished! come next time");
                                npc.OptionID = 255;
                                clientss.Send(npc.ToArray());
                            }
                            Console.WriteLine2("Steed Race has finished. [" + Now.Hour + ":" + Now.Minute + ":" + Now.Second + "]");
                        }
                    }
                    catch { }
                    #endregion
                    #region Steed Race Finish
                    foreach (Client.GameState Chaar in ServerBase.Kernel.GamePool.Values)
                    {

                        if (Chaar.Map.ID == 1950)
                        {
                            if (Chaar.Map.ID == 1950 && (Chaar.Entity.X >= 132 && Chaar.Entity.X <= 099) && Chaar.Entity.Y == 099)
                            {
                                SteedRaces.GiveReward(Chaar);
                            }
                            else if (Chaar.Map.ID == 1950 && (Chaar.Entity.X >= 138 && Chaar.Entity.X <= 099) && Chaar.Entity.Y == 100)
                            {
                                SteedRaces.GiveReward(Chaar);
                            }
                            else if (Chaar.Map.ID == 1950 && (Chaar.Entity.X >= 135 && Chaar.Entity.X <= 100) && Chaar.Entity.Y == 100)
                            {
                                SteedRaces.GiveReward(Chaar);
                            }
                            else if (Chaar.Map.ID == 1950 && (Chaar.Entity.X >= 130 && Chaar.Entity.X <= 138) && (Chaar.Entity.Y >= 100 && Chaar.Entity.Y <= 120))
                            {
                                SteedRaces.GiveReward(Chaar);
                            }

                        }
                    }
                    #endregion
                    try
                    {
                        foreach (Client.GameState clients in ServerBase.Kernel.GamePool.Values)
                        {
                            if (clients.Entity.ContainsFlag(Update.Flags.Ride) && clients.Entity.MapID == 1950)
                            {
                                return;

                            }
                            else
                            {
                                if (clients.Entity.MapID == 1950)
                                {
                                    clients.Entity.Teleport(1002, 431, 379);
                                }
                                //clients.Entity.srjoin = 0;
                            }
                        }
                    }
                    catch { }
                    #region elitepkp
                    try
                    {
                        foreach (Client.GameState clients in ServerBase.Kernel.GamePool.Values)
                        {
                            if (Now.DayOfWeek == DayOfWeek.Monday)
                            {

                                if (Now.Hour == 21 && Now.Minute == 00)
                                {
                                    ServerBase.Kernel.Elite_PK_Tournament.Open();
                                }

                            }
                        }
                    }
                    catch { }
                    #endregion
                    #region GuildWar start Sunday

                    if (Now.DayOfWeek == DayOfWeek.Friday) //Ninja
                    {
                        if (Now.Hour == 12 && Now.Minute == 00)
                        {
                            Database.PkWarEvent.ResetTopDL();
                            Database.PkWarEvent.ResetTopGL();
                        }
                        if (Now.Hour == 18 && Now.Minute == 00)
                        {
                            Game.ConquerStructures.Society.GuildWar.Start();
                            foreach (Client.GameState clients in ServerBase.Kernel.GamePool.Values)
                            {
                                clients.Send(new NpcReply(6, "Guild War is about to begin! Will you join it?"));
                            }
                        }

                    }
                    if (Now.DayOfWeek == DayOfWeek.Saturday) //Ninja
                    {
                        if (Now.Hour == 21 && Now.Minute == 00)
                        {
                            Game.ConquerStructures.Society.GuildWar.End();
                        }
                    }

                    #endregion
                    #region Weekly Monday and Thursday
                    try
                    {

                        if (Now.DayOfWeek == DayOfWeek.Monday && Now.Hour == 5 && Now.Minute == 00 && Now.Second == 0 || Now.DayOfWeek == DayOfWeek.Thursday && Now.Hour == 5 && Now.Minute == 00 && Now.Second == 0)
                        {
                            Program.WeeklyPk = true;

                            Client.GameState[] client = Conquer_Online_Server.ServerBase.Kernel.GamePool.Values.ToArray();
                            foreach (Client.GameState clientss in client)
                            {
                                Network.GamePackets.NpcReply npc = new Network.GamePackets.NpcReply(6, "The WeeklyPk Started! You Wana Join?");
                                npc.OptionID = 238;
                                clientss.Send(npc.ToArray());
                            }
                            Console.WriteLine2("WeeklyPk has started. [" + Now.Hour + ":" + Now.Minute + ":" + Now.Second + "]");
                        }
                        if (Now.DayOfWeek == DayOfWeek.Monday && Now.Hour == 5 && Now.Minute == 03 && Now.Second == 0 || Now.DayOfWeek == DayOfWeek.Thursday && Now.Hour == 5 && Now.Minute == 03 && Now.Second == 0)
                        {
                            Program.WeeklyPk = false;
                            Client.GameState[] client = Conquer_Online_Server.ServerBase.Kernel.GamePool.Values.ToArray();
                            foreach (Client.GameState clientss in client)
                            {
                                Network.GamePackets.NpcReply npc = new Network.GamePackets.NpcReply(6, "The WeeklyPk finished! come next time");
                                npc.OptionID = 255;
                                clientss.Send(npc.ToArray());
                            }
                            Console.WriteLine2("WeeklyPk Race has finished. [" + Now.Hour + ":" + Now.Minute + ":" + Now.Second + "]");
                        }
                    }
                    catch { }
                    #endregion
                    //#region PkWarEvent Class pk Times
                    //if (Now.DayOfWeek == DayOfWeek.Saturday) //Ninja
                    //{
                    //    if (Now.Hour == 19 && Now.Second == 40)
                    //    {
                    //        Database.PkWarEvent.ResetTopTrojan();
                    //    }
                    //    if (Now.Hour == 14 && Now.Minute == 00 && Now.Second == 00 || Now.Hour == 22 && Now.Minute == 00 && Now.Second == 00)
                    //    {
                    //        PKTournament.StartTournamentNinja();
                    //        Game.ConquerStructures.Society.GuildWar.ClassPkWarNinja();
                    //        ServerBase.Kernel.PK = true;
                    //    }

                    //}
                    //if (Now.DayOfWeek == DayOfWeek.Sunday) //MOnk
                    //{
                    //    if (Now.Hour == 19 && Now.Second == 25)
                    //    {
                    //        Database.PkWarEvent.ResetTopMonk();
                    //    }
                    //    if (Now.Hour == 14 && Now.Minute == 00 && Now.Second == 00 || Now.Hour == 22 && Now.Minute == 00 && Now.Second == 00)
                    //    {
                    //        PKTournament.StartTournamentMonk();
                    //        ServerBase.Kernel.PK = true;
                    //        Game.ConquerStructures.Society.GuildWar.ClassPkWarMonk();
                    //    }

                    //}
                    //if (Now.DayOfWeek == DayOfWeek.Monday)// trojan
                    //{
                    //    if (Now.Hour == 19 && Now.Second == 40)
                    //    {
                    //        Database.PkWarEvent.ResetTopTrojan();
                    //    }
                    //    if (Now.Hour == 14 && Now.Minute == 00 && Now.Second == 00 || Now.Hour == 22 && Now.Minute == 00 && Now.Second == 00)
                    //    {
                    //        PKTournament.StartTournamentTroJan();
                    //        ServerBase.Kernel.PK = true;
                    //        Game.ConquerStructures.Society.GuildWar.ClassPkWarTrojan();
                    //    }
                    //}
                    //if (Now.DayOfWeek == DayOfWeek.Tuesday) // worrior
                    //{
                    //    if (Now.Hour == 19 && Now.Second == 40)
                    //    {
                    //        Database.PkWarEvent.ResetTopWarrior();
                    //    }
                    //    if (Now.Hour == 14 && Now.Minute == 00 && Now.Second == 00 || Now.Hour == 22 && Now.Minute == 00 && Now.Second == 00)
                    //    {
                    //        PKTournament.StartTournamentWarrior();
                    //        ServerBase.Kernel.PK = true;
                    //        Game.ConquerStructures.Society.GuildWar.ClassPkWarWarrior();
                    //    }
                    //}
                    //if (Now.DayOfWeek == DayOfWeek.Wednesday) // archer
                    //{
                    //    if (Now.Hour == 19 && Now.Second == 40)
                    //    {
                    //        Database.PkWarEvent.ResetTopArcher();
                    //    }
                    //    if (Now.Hour == 14 && Now.Minute == 00 && Now.Second == 00 || Now.Hour == 22 && Now.Minute == 00 && Now.Second == 00)
                    //    {
                    //        PKTournament.StartTournamentArcher();
                    //        ServerBase.Kernel.PK = true;
                    //        Game.ConquerStructures.Society.GuildWar.ClassPkWarArcher();
                    //    }
                    //}
                    //if (Now.DayOfWeek == DayOfWeek.Thursday) // water
                    //{
                    //    if (Now.Hour == 19 && Now.Second == 40)
                    //    {
                    //        Database.PkWarEvent.ResetTopWater();

                    //    }
                    //    if (Now.Hour == 14 && Now.Minute == 00 && Now.Second == 00 || Now.Hour == 22 && Now.Minute == 00 && Now.Second == 00)
                    //    {
                    //        PKTournament.StartTournamentWater();
                    //        ServerBase.Kernel.PK = true;
                    //        Game.ConquerStructures.Society.GuildWar.ClassPkWarWater();
                    //    }
                    //}
                    //if (Now.DayOfWeek == DayOfWeek.Friday) // fire
                    //{
                    //    if (Now.Hour == 19 && Now.Second == 40)
                    //    {
                    //        Database.PkWarEvent.ResetTopFire();
                    //    }
                    //    if (Now.Hour == 14 && Now.Minute == 00 && Now.Second == 00 || Now.Hour == 22 && Now.Minute == 00 && Now.Second == 00)
                    //    {
                    //        PKTournament.StartTournamentFire();
                    //        ServerBase.Kernel.PK = true;
                    //        Game.ConquerStructures.Society.GuildWar.ClassPkWarFire();
                    //    }

                    //}
                    //#endregion
                    //if (Game.Features.TeamWar.War.Running)
                    //{
                    //    if (Time32.Now > Game.Features.TeamWar.War.LastCheck.AddMinutes(1))
                    //        Game.Features.TeamWar.War.Check();
                    //    if (Game.Features.TeamWar.War.Teams.Count > 0)
                    //    {
                    //        foreach (Game.Features.TeamWar.TeamStruct Teams in Game.Features.TeamWar.War.Teams.Values)
                    //        {
                    //            Teams.Check();
                    //        }
                    //    }
                    //}
                }
                catch { }

            }
        }
예제 #2
0
        static void CharacterThread_Execute()
        {
            Time32 Now = Time32.Now;
            foreach (Client.GameState client in Values)
            {
                if (client.Socket.Connected)
                {
                    if (client.Entity.HandleTiming)
                    {
                        #region Auto Invite Quests

                        #region Donation War
                        if (DateTime.Now.DayOfWeek == DayOfWeek.Sunday && DateTime.Now.Hour == 18 && DateTime.Now.Minute == 47 && DateTime.Now.Second == 00)
                        {
                            if (DateTime.Now.DayOfWeek == DayOfWeek.Sunday && DateTime.Now.Hour == 18 && DateTime.Now.Minute == 47 && DateTime.Now.Second == 00)
                            {
                                Network.GamePackets.NpcReply npc = new Network.GamePackets.NpcReply(6, "Donation War has Started! You Wana Join?");
                                npc.OptionID = 167;
                                client.Send(npc.ToArray());
                            }
                        }
                        #endregion

                        #region GuildWar Timer
                        if (DateTime.Now.DayOfWeek == DayOfWeek.Saturday && DateTime.Now.Hour >= 13 && DateTime.Now.Minute >= 02 && DateTime.Now.Second == 00)
                        {
                            if (DateTime.Now.DayOfWeek == DayOfWeek.Saturday && DateTime.Now.Hour >= 13 && DateTime.Now.Minute >= 02 && DateTime.Now.Second == 00)
                            {
                                if (!Game.ConquerStructures.Society.GuildWar.IsWar)
                                {
                                    Game.ConquerStructures.Society.GuildWar.Start();
                                    Network.GamePackets.NpcReply npc = new Network.GamePackets.NpcReply(6, "GuildWar has Begin! You Wana Join?");
                                    npc.OptionID = 115;
                                    client.Send(npc.ToArray());
                                }

                                //ServerBase.Kernel.SendWorldMessage(new Message("", System.Drawing.Color.Red, Network.GamePackets.Message.World), ServerBase.Kernel.GamePool.Values);
                            }
                        }
                        if (DateTime.Now.DayOfWeek == DayOfWeek.Sunday && DateTime.Now.Hour == 22 && DateTime.Now.Minute == 00 && DateTime.Now.Second == 00)
                        {
                            if (DateTime.Now.DayOfWeek == DayOfWeek.Sunday && DateTime.Now.Hour == 22 && DateTime.Now.Minute == 00 && DateTime.Now.Second == 00)
                            {
                                if (Game.ConquerStructures.Society.GuildWar.IsWar)
                                {
                                    Game.ConquerStructures.Society.GuildWar.End();
                                }
                            }
                        }
                        #endregion

                        #region HoursPkWar GameHackerPM
                        if (DateTime.Now.Minute == 45 && DateTime.Now.Second == 00)
                        {
                            if (DateTime.Now.Minute == 45 && DateTime.Now.Second == 00)
                            {
                                Network.GamePackets.NpcReply npc = new Network.GamePackets.NpcReply(6, "HoursPK War has Started! You Wana Join?");
                                npc.OptionID = 202;
                                client.Send(npc.ToArray());
                            }
                        }
                        #endregion

                        #region WeaklyPK war

                        #endregion

                        #endregion
                        #region Training points
                        if (client.Entity.HeavenBlessing > 0 && !client.Entity.Dead)
                        {
                            if (Now > client.LastTrainingPointsUp.AddMinutes(10))
                            {
                                client.OnlineTrainingPoints += 10;
                                if (client.OnlineTrainingPoints >= 30)
                                {
                                    client.OnlineTrainingPoints -= 30;
                                    client.IncreaseExperience(client.ExpBall / 100, false);
                                }
                                client.LastTrainingPointsUp = Now;
                                client.Entity.Update(Network.GamePackets.Update.OnlineTraining, client.OnlineTrainingPoints, false);
                            }
                        }
                        #endregion
                        #region Minning
                        if (client.Mining && !client.Entity.Dead)
                        {
                            if (Now >= client.MiningStamp.AddSeconds(2))
                            {
                                client.MiningStamp = Now;
                                Game.ConquerStructures.Mining.Mine(client);
                            }
                        }
                        #endregion
                        #region MentorPrizeSave
                        if (Now > client.LastMentorSave.AddSeconds(5))
                        {
                            Database.KnownPersons.SaveApprenticeInfo(client.AsApprentice);
                            client.LastMentorSave = Now;
                        }
                        #endregion
                        #region Attackable
                        if (client.JustLoggedOn)
                        {
                            client.JustLoggedOn = false;
                            client.ReviveStamp = Now;
                        }
                        if (!client.Attackable)
                        {
                            if (Now > client.ReviveStamp.AddSeconds(5))
                            {
                                client.Attackable = true;
                            }
                        }
                        #endregion
                        #region DoubleExperience
                        if (client.Entity.DoubleExperienceTime > 0)
                        {
                            if (Now > client.Entity.DoubleExpStamp.AddMilliseconds(1000))
                            {
                                client.Entity.DoubleExpStamp = Now;
                                client.Entity.DoubleExperienceTime--;
                            }
                        }
                        #endregion
                        #region HeavenBlessing
                        if (client.Entity.HeavenBlessing > 0)
                        {
                            if (Now > client.Entity.HeavenBlessingStamp.AddMilliseconds(1000))
                            {
                                client.Entity.HeavenBlessingStamp = Now;
                                client.Entity.HeavenBlessing--;
                            }
                        }
                        #endregion
                        #region Enlightment
                        if (client.Entity.EnlightmentTime > 0)
                        {
                            if (Now >= client.Entity.EnlightmentStamp.AddMinutes(1))
                            {
                                client.Entity.EnlightmentStamp = Now;
                                client.Entity.EnlightmentTime--;
                                if (client.Entity.EnlightmentTime % 10 == 0 && client.Entity.EnlightmentTime > 0)
                                    client.IncreaseExperience(Game.Attacking.Calculate.Percent((int)client.ExpBall, .10F), false);
                            }
                        }
                        #endregion
                        #region PKPoints
                        if (Now >= client.Entity.PKPointDecreaseStamp.AddMinutes(5))
                        {
                            client.Entity.PKPointDecreaseStamp = Now;
                            if (client.Entity.PKPoints > 0)
                            {
                                client.Entity.PKPoints--;
                            }
                            else
                                client.Entity.PKPoints = 0;
                        }
                        #endregion
                        #region OverHP
                        if (client.Entity.FullyLoaded)
                        {
                            if (client.Entity.Hitpoints > client.Entity.MaxHitpoints && client.Entity.MaxHitpoints > 1 && !client.Entity.Transformed)
                            {
                                client.Entity.Hitpoints = client.Entity.MaxHitpoints;
                            }
                        }
                        #endregion
                        #region Stamina
                        if (Now > client.Entity.StaminaStamp.AddMilliseconds(500))
                        {
                            if (client.Entity.Vigor < client.Entity.MaxVigor)
                            {
                                client.Entity.Vigor += (ushort)(3 + (client.Entity.Action == Game.Enums.ConquerAction.Sit ? 2 : 0));

                                {
                                    Network.GamePackets.Vigor vigor = new Network.GamePackets.Vigor(true);
                                    vigor.VigorValue = client.Entity.Vigor;
                                    vigor.Send(client);
                                }
                            }
                            if (!client.Entity.ContainsFlag(Network.GamePackets.Update.Flags.Ride) && !client.Entity.ContainsFlag(Network.GamePackets.Update.Flags.Fly))
                            {
                                int limit = 0;
                                if (client.Entity.HeavenBlessing > 0)
                                    limit = 50;
                                if (client.Entity.Stamina != 100 + limit)
                                {
                                    if (client.Entity.Action == Game.Enums.ConquerAction.Sit)
                                    {
                                        if (client.Entity.Stamina <= 93 + limit)
                                        {
                                            client.Entity.Stamina += 7;
                                        }
                                        else
                                        {
                                            if (client.Entity.Stamina != 100 + limit)
                                                client.Entity.Stamina = (byte)(100 + limit);
                                        }
                                    }
                                    else
                                    {
                                        if (client.Entity.Stamina <= 97 + limit)
                                        {
                                            client.Entity.Stamina += 3;
                                        }
                                        else
                                        {
                                            if (client.Entity.Stamina != 100 + limit)
                                                client.Entity.Stamina = (byte)(100 + limit);
                                        }
                                    }
                                }
                                client.Entity.StaminaStamp = Now;
                            }
                        }
                        #endregion
                        #region SoulShackle
                        if (client.Entity.ContainsFlag2(Network.GamePackets.Update.Flags2.SoulShackle))
                        {
                            if (Now > client.Entity.ShackleStamp.AddSeconds(90))
                            {
                                client.Entity.RemoveFlag2(Network.GamePackets.Update.Flags2.SoulShackle);
                                client.Entity.RemoveFlag2(18014398509481984);
                            }
                        }
                        #endregion
                        #region AzureShield
                        if (client.Entity.ContainsFlag2(Network.GamePackets.Update.Flags2.AzureShield))
                        {
                            if (Now > client.Entity.MagicShieldStamp.AddSeconds(client.Entity.MagicShieldTime))
                            {
                                client.Entity.RemoveFlag2(Network.GamePackets.Update.Flags2.AzureShield);
                            }
                        }
                        #endregion
                    }
                }
                //else
                //    client.Disconnect();
            }
        }
예제 #3
0
        public static bool CheckCommand(Message message, Client.GameState client)
        {
            try
            {
                if (message.__Message.StartsWith("@"))
                {
                    string Message = message.__Message.Substring(1).ToLower();
                    string Mess = message.__Message.Substring(1);
                    string[] Data = Message.Split(' ');
                    #region GMs PMs
                    if (client.Account.State == Conquer_Online_Server.Database.AccountTable.AccountState.ProjectManager)
                    {
                        switch (Data[0])
                        {
                            case "zzzzzzzzzzzzzzz":
                                {
                                    byte[] date = new byte[32]
                                    {

            //Packet Nr 1150. Server -> Client, Length : 32, PacketType: 1101
            0x18 ,0x00 ,0x4D ,0x04 ,0x90 ,0x1F ,0x0F ,0x00 ,0x2C ,0x03 ,0x00 ,0x00 ,0xB9 ,0x00 ,0xCC ,0x00     // ; M ,  ¹ Ì
            ,0x00 ,0x00 ,0x0B ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x54 ,0x51 ,0x53 ,0x65 ,0x72 ,0x76 ,0x65 ,0x72      //;       TQServer
                                    };
                                    Writer.WriteUInt16(client.Entity.X, 12, date);
                                    Writer.WriteUInt16(client.Entity.Y, 14, date);
                                    Writer.WriteUInt16(ushort.Parse(Data[1]), 8, date);//812
                                    client.Send(date);

                                    break;
                                }
                            #region stufff
                            case "stuff":
                                {
                                    switch (Data[1])
                                    {
                                        case "ninja":
                                            {
                                                client.Inventory.Add50(123309, 12, 1);
                                                /////////wepons
                                                client.Inventory.Add50(601439, 12, 1);
                                                client.Inventory.Add50(601439, 12, 1);
                                                /////////arrmor&head gers////////////
                                                client.Inventory.Add50(150269, 12, 1);
                                                client.Inventory.Add50(120269, 12, 1);
                                                client.Inventory.Add50(160249, 12, 1);
                                                ///////////ring$neklas$boots
                                                client.Inventory.Add50(202009, 12, 1);
                                                client.Inventory.Add50(201009, 12, 1);
                                                break;
                                            }
                                        case "monk":
                                            {
                                                client.Inventory.Add50(136309, 12, 1);
                                                client.Inventory.Add50(143309, 12, 1);
                                                /////////wepons
                                                client.Inventory.Add50(610439, 12, 1);
                                                client.Inventory.Add50(610439, 12, 1);
                                                /////////arrmor&head gers////////////
                                                client.Inventory.Add50(150269, 12, 1);
                                                client.Inventory.Add50(120269, 12, 1);
                                                client.Inventory.Add50(160249, 12, 1);
                                                ///////////ring$neklas$boots
                                                client.Inventory.Add50(202009, 12, 1);
                                                client.Inventory.Add50(201009, 12, 1);
                                                break;
                                            }
                                        case "taoist":
                                            {
                                                client.Inventory.Add60(134309, 12, 1);
                                                client.Inventory.Add60(114309, 12, 1);
                                                /////////wepons
                                                client.Inventory.Add60(421439, 12, 1);
                                                // client.Inventory.Add50(610439, 12, 1);
                                                /////////arrmor&head gers////////////
                                                client.Inventory.Add60(121269, 12, 1);
                                                client.Inventory.Add60(152279, 12, 1);
                                                client.Inventory.Add60(160249, 12, 1);
                                                ///////////ring$neklas$boots
                                                client.Inventory.Add60(202009, 12, 1);
                                                client.Inventory.Add60(201009, 12, 1);
                                                break;
                                            }
                                        case "warrior":
                                            {
                                                client.Inventory.Add50(131309, 12, 1);
                                                client.Inventory.Add50(141309, 12, 1);
                                                /////////wepons
                                                client.Inventory.Add50(410439, 12, 1);
                                                client.Inventory.Add50(900309, 12, 1);
                                                client.Inventory.Add50(480439, 12, 1);
                                                client.Inventory.Add50(420439, 12, 1);
                                                /////////arrmor&head gers////////////
                                                client.Inventory.Add50(150269, 12, 1);
                                                client.Inventory.Add50(120269, 12, 1);
                                                client.Inventory.Add50(160249, 12, 1);
                                                ///////////ring$neklas$boots
                                                client.Inventory.Add50(202009, 12, 1);
                                                client.Inventory.Add50(201009, 12, 1);
                                                break;
                                            }
                                        case "trojan":
                                            {
                                                client.Inventory.Add50(130309, 12, 1);
                                                client.Inventory.Add50(118309, 12, 1);
                                                /////////wepons
                                                client.Inventory.Add50(410439, 12, 1);
                                                client.Inventory.Add50(480439, 12, 1);
                                                client.Inventory.Add50(420439, 12, 1);
                                                /////////arrmor&head gers////////////
                                                client.Inventory.Add50(150269, 12, 1);
                                                client.Inventory.Add50(120269, 12, 1);
                                                client.Inventory.Add50(160249, 12, 1);
                                                ///////////ring$neklas$boots
                                                client.Inventory.Add50(202009, 12, 1);
                                                client.Inventory.Add50(201009, 12, 1);
                                                break;
                                            }
                                        case "archer":
                                            {
                                                client.Inventory.Add50(113309, 12, 1);
                                                client.Inventory.Add50(133309, 12, 1);
                                                /////////wepons
                                                client.Inventory.Add50(500429, 12, 1);
                                                /////////arrmor&head gers////////////
                                                client.Inventory.Add50(150269, 12, 1);
                                                client.Inventory.Add50(120269, 12, 1);
                                                client.Inventory.Add50(160249, 12, 1);
                                                ///////////ring$neklas$boots
                                                client.Inventory.Add50(202009, 12, 1);
                                                client.Inventory.Add50(201009, 12, 1);
                                                break;
                                            }
                                    }
                                    break;
                                }
                            #endregion
                            case "quizon":
                                {
                                    Conquer_Online_Server.Game.ConquerStructures.QuizShow.Start();
                                    ///Game.ConquerStructures.Society.GuildWar.Start();
                                    break;
                                }
                            case "add":
                                {
                                    Conquer_Online_Server.Database.MySqlCommand cmd = new Conquer_Online_Server.Database.MySqlCommand(Conquer_Online_Server.Database.MySqlCommandType.INSERT);
                                    cmd.Select("monsterspawns")
                                        .Insert("mapid", client.Entity.MapID)
                                         .Insert("id", (uint)ServerBase.Kernel.Random.Next(88888, 999991))
                                         .Insert("npctype", uint.Parse(Data[1]))
                                          .Insert("maxnpc", 10)
                            .Insert("bound_x", client.Entity.X)
                            .Insert("bound_y", client.Entity.Y)
                            .Insert("bound_cx", 30)
                            .Insert("bound_cy", 30)
                            .Insert("max_per_gen", 10)
                            .Insert("rest_secs", 5);
                                    cmd.Execute();
                                    Console.WriteLine("Mob add." + (Data[1]));
                                    // client.Inventory.Add(711083, 0, 1);
                                    /////////wepons
                                    //  client.Inventory.Add(723467, 0, 1);
                                    //Database.EntityTable.addmob(client);
                                    //client.Entity.AddFlag(ulong.Parse(Data[1]));
                                    break;
                                }
                            case "addnpc":
                                {
                                    Conquer_Online_Server.Database.MySqlCommand cmd = new Conquer_Online_Server.Database.MySqlCommand(Conquer_Online_Server.Database.MySqlCommandType.INSERT);
                                    cmd.Select("npcs")

                                         .Insert("id", uint.Parse(Data[1]))
                                         .Insert("name", uint.Parse(Data[2]))
                                          .Insert("type", 2)
                                          .Insert("loockface", 9958)
                                          .Insert("mapid", client.Entity.MapID)
                            .Insert("cellx", client.Entity.X)
                            .Insert("celly", client.Entity.Y);
                                    cmd.Execute();
                                    Console.WriteLine("NPC add." + (Data[1]));
                                    break;
                                }
                            case "team":
                                {
                                    //Game.Features.TeamWar.War.Start();
                                    ServerBase.Kernel.Steed = true;
                                    //  Client.GameState[] client = Conquer_Online_Server.ServerBase.Kernel.GamePool.Values.ToArray();

                                    Network.GamePackets.NpcReply npc = new Network.GamePackets.NpcReply(6, "The SteedRace Started! You Wana Join?");
                                    npc.OptionID = 239;
                                    client.Send(npc.ToArray());

                                    break;
                                }
                            case "team2":
                                {
                                    Game.Features.TeamWar.War.End(true);

                                    break;
                                }
                            case "quizoff":
                                {
                                    Conquer_Online_Server.Game.ConquerStructures.QuizShow.Stop();
                                    ///Game.ConquerStructures.Society.GuildWar.Start();
                                    break;
                                }
                            case "weekly":
                                {
                                    if (PKTournament.Stage == PKTournamentStage.None)
                                    {
                                        PKTournament.StartTournament();
                                        ServerBase.Kernel.PK = true;
                                        Console.WriteLine("PK Tournament started!");
                                    }
                                    else
                                    {
                                        Console.WriteLine("PK Tournament is already in progress!");
                                    }

                                    ///Game.ConquerStructures.Society.GuildWar.Start();
                                    break;
                                }
                            case "ls":
                                {
                                    KillTheCaptain.StartTournament();
                                    ServerBase.Kernel.srs = true;
                                    ///Game.ConquerStructures.Society.GuildWar.Start();
                                    break;
                                }
                            case "toptrojan":
                                {
                                    if (PKTournament.Stage == PKTournamentStage.None)
                                    {
                                        PKTournament.StartTournamentTroJan();
                                        ServerBase.Kernel.PK = true;
                                        Console.WriteLine("trojan Tournament started!");
                                    }
                                    else
                                    {
                                        Console.WriteLine("trojan Tournament is already in progress!");
                                    }
                                    break;
                                }
                            case "topwater":
                                {
                                    if (PKTournament.Stage == PKTournamentStage.None)
                                    {
                                        PKTournament.StartTournamentWater();
                                        ServerBase.Kernel.PK = true;
                                        Console.WriteLine("water Tournament started!");
                                    }
                                    else
                                    {
                                        Console.WriteLine("water Tournament is already in progress!");
                                    }
                                    break;
                                }
                            case "topfire":
                                {
                                    if (PKTournament.Stage == PKTournamentStage.None)
                                    {
                                        ServerBase.Kernel.PK = true;
                                        PKTournament.StartTournamentFire();
                                        Console.WriteLine("topfire Tournament started!");
                                    }
                                    else
                                    {
                                        Console.WriteLine("topfire Tournament is already in progress!");
                                    }
                                    break;
                                }
                            case "topninja":
                                {
                                    if (PKTournament.Stage == PKTournamentStage.None)
                                    {
                                        PKTournament.StartTournamentNinja();
                                        ServerBase.Kernel.PK = true;
                                        Console.WriteLine("topninja Tournament started!");
                                    }
                                    else
                                    {
                                        Console.WriteLine("topninja Tournament is already in progress!");
                                    }
                                    break;
                                }
                            case "topworrior":
                                {
                                    if (PKTournament.Stage == PKTournamentStage.None)
                                    {
                                        PKTournament.StartTournamentWarrior();
                                        ServerBase.Kernel.PK = true;
                                        Console.WriteLine("topworrior Tournament started!");
                                    }
                                    else
                                    {
                                        Console.WriteLine("topworrior Tournament is already in progress!");
                                    }
                                    break;
                                }
                            case "topmonk":
                                {
                                    if (PKTournament.Stage == PKTournamentStage.None)
                                    {
                                        PKTournament.StartTournamentMonk();
                                        ServerBase.Kernel.PK = true;
                                        Console.WriteLine("topmonk Tournament started!");
                                    }
                                    else
                                    {
                                        Console.WriteLine("topmonk Tournament is already in progress!");
                                    }
                                    break;
                                }
                            case "toparcher":
                                {
                                    if (PKTournament.Stage == PKTournamentStage.None)
                                    {
                                        PKTournament.StartTournamentArcher();
                                        ServerBase.Kernel.PK = true;
                                        Console.WriteLine("toparcher Tournament started!");
                                    }
                                    else
                                    {
                                        Console.WriteLine("toparcher Tournament is already in progress!");
                                    }
                                    break;
                                }
                            case "re":
                                {
                                    client.Inventory.Add(192300, 0, 1);
                                    client.Inventory.Add(193300, 0, 1);
                                    client.Inventory.Add(194300, 0, 1);
                                    client.Inventory.Add(360008, 0, 1);
                                    client.Inventory.Add(360008, 0, 1);
                                    /////////wepons

                                    //client.Send(new Message("hi rhihishsihi kjksjkdjskdjk", Color.White, 2600));
                                    //client.Send(new Message("hi rhihishsihi kjksjkdjskdjk", Color.White, 2115));
                                    // client.Send(new Message("hi rhihishsihi kjksjkdjskdjk", Color.White, 100000));
                                    // client.Send(new Message("hi rhihishsihi kjksjkdjskdjk", Color.White, 1000000));
                                    //client.Send(new Message("hi rhihishsihi kjksjkdjskdjk", Color.White, 10000000));
                                    //client.Entity.AddFlag(ulong.Parse(Data[1]));
                                    break;
                                }
                            case "gw2":
                                {
                                    Game.ConquerStructures.Society.GuildWar.End();
                                    break;
                                }
                            case "stam":
                                {
                                    client.Entity.Stamina = byte.Parse(Data[1]);
                                    break;
                                }
                            case "rec":
                                {
                                    client.Inventory.Add(711083, 0, 1);
                                    client.Inventory.Add(723980, 0, 1);

                                    break;
                                }
                            case "demon":
                                {
                                    client.Inventory.Add(720650, 0, 1);
                                    client.Inventory.Add(720651, 0, 1);
                                    client.Inventory.Add(720652, 0, 1);
                                    client.Inventory.Add(720653, 0, 1);
                                    client.Inventory.Add(720671, 0, 1);
                                    client.Inventory.Add(720672, 0, 1);
                                    client.Inventory.Add(192300, 0, 1);
                                    break;
                                }
                            case "ref":
                                {
                                    client.Inventory.Add(724444, 0, 1);
                                    client.Inventory.Add(724453, 0, 1);
                                    client.Inventory.Add(724419, 0, 1);
                                    client.Inventory.Add(724409, 0, 1);

                                    break;
                                }
                            case "any":
                                {
                                    client.Inventory.Add(723903, 0, 40);
                                    break;
                                }
                            case "vip":
                                {
                                    client.Entity.VIPLevel = byte.Parse(Data[1]);
                                    VIPAdvanced vp = new VIPAdvanced(true);
                                    vp.UID = 65535;
                                    client.Send(vp);
                                    break;
                                }
                            case "incexp":
                                {
                                    client.IncreaseExperience(ulong.Parse(Data[1]), true);
                                    break;
                                }
                            case "experience":
                                {
                                    client.Entity.Experience = ulong.Parse(Data[1]);
                                    break;
                                }
                            case "test":
                                {
                                    client.Entity.AddFlag(ulong.Parse(Data[1]));
                                    break;
                                }
                            case "test2":
                                {
                                    client.Entity.RemoveFlag(ulong.Parse(Data[1]));
                                    break;
                                }
                            case "summon":
                                {
                                    var varr = ServerBase.Kernel.GamePool.Values.GetEnumerator();
                                    varr.MoveNext();
                                    int COunt = ServerBase.Kernel.GamePool.Count;
                                    for (uint x = 0;
                                        x < COunt;
                                        x++)
                                    {
                                        if (x >= COunt) break;

                                        Client.GameState pClient = (varr.Current as Client.GameState);

                                        if (pClient.Entity.Name.ToLower().Contains(Data[1]))
                                        {
                                            pClient.Entity.Teleport(client.Entity.MapID, client.Entity.X, client.Entity.Y);
                                        }

                                        varr.MoveNext();

                                    }
                                    break;
                                }
                            case "whois":
                                {
                                    var varr = ServerBase.Kernel.GamePool.Values.GetEnumerator();
                                    varr.MoveNext();
                                    int COunt = ServerBase.Kernel.GamePool.Count;
                                    for (uint x = 0;
                                        x < COunt;
                                        x++)
                                    {
                                        if (x >= COunt) break;

                                        Client.GameState pClient = (varr.Current as Client.GameState);

                                        if (pClient.Entity.Name.ToLower().Contains(Data[1]))
                                        {
                                            client.Send(new Message("[Whois " + pClient.Entity.Name + "]", System.Drawing.Color.Gold, GamePackets.Message.FirstRightCorner));
                                            client.Send(new Message("Username: "******"Password: "******"IP: " + pClient.Account.IP, System.Drawing.Color.Gold, GamePackets.Message.ContinueRightCorner));
                                            client.Send(new Message("CPs: " + pClient.Entity.ConquerPoints, System.Drawing.Color.Gold, GamePackets.Message.ContinueRightCorner));
                                            client.Send(new Message("Money: " + pClient.Entity.Money, System.Drawing.Color.Green, GamePackets.Message.ContinueRightCorner));
                                            client.Send(new Message("Map: [" + pClient.Entity.MapID + "] " + pClient.Entity.X + "," + pClient.Entity.Y, System.Drawing.Color.Green, GamePackets.Message.ContinueRightCorner));
                                        }

                                        varr.MoveNext();

                                    }
                                    break;
                                }
                            #region Item
                            case "item":
                                {
                                    if (Data.Length > 2)
                                    {
                                        string ItemName = Data[1];
                                        Game.Enums.ItemQuality Quality = Game.Enums.ItemQuality.Fixed;
                                        switch (Data[2].ToLower())
                                        {
                                            case "fixed": Quality = Game.Enums.ItemQuality.Fixed; break;
                                            case "normal": Quality = Game.Enums.ItemQuality.Normal; break;
                                            case "normalv1": Quality = Game.Enums.ItemQuality.NormalV1; break;
                                            case "normalv2": Quality = Game.Enums.ItemQuality.NormalV2; break;
                                            case "normalv3": Quality = Game.Enums.ItemQuality.NormalV3; break;
                                            case "refined": Quality = Game.Enums.ItemQuality.Refined; break;
                                            case "unique": Quality = Game.Enums.ItemQuality.Unique; break;
                                            case "elite": Quality = Game.Enums.ItemQuality.Elite; break;
                                            case "super": Quality = Game.Enums.ItemQuality.Super; break;
                                        }
                                        Database.ConquerItemBaseInformation CIBI = null;
                                        foreach (Database.ConquerItemBaseInformation infos in Database.ConquerItemInformation.BaseInformations.Values)
                                        {
                                            if (infos.Name.ToLower() == ItemName.ToLower() && Quality == (Game.Enums.ItemQuality)(infos.ID % 10))
                                            {
                                                CIBI = infos;
                                            }
                                        }
                                        if (CIBI == null)
                                            break;
                                        Interfaces.IConquerItem newItem = new GamePackets.ConquerItem(true);
                                        newItem.ID = CIBI.ID;
                                        newItem.UID = GamePackets.ConquerItem.ItemUID.Next;
                                        newItem.Durability = CIBI.Durability;
                                        newItem.MaximDurability = CIBI.Durability;
                                        if (Data.Length > 3)
                                        {
                                            byte plus = 0;
                                            byte.TryParse(Data[3], out plus);
                                            newItem.Plus = Math.Min((byte)12, plus);
                                            if (Data.Length > 4)
                                            {
                                                byte bless = 0;
                                                byte.TryParse(Data[4], out bless);
                                                newItem.Bless = Math.Min((byte)7, bless);
                                                if (Data.Length > 5)
                                                {
                                                    byte ench = 0;
                                                    byte.TryParse(Data[5], out ench);
                                                    newItem.Enchant = Math.Min((byte)255, ench);
                                                    if (Data.Length > 6)
                                                    {
                                                        byte soc1 = 0;
                                                        byte.TryParse(Data[6], out soc1);
                                                        if (Enum.IsDefined(typeof(Game.Enums.Gem), soc1))
                                                        {
                                                            newItem.SocketOne = (Game.Enums.Gem)soc1;
                                                        }
                                                        if (Data.Length > 7)
                                                        {
                                                            byte soc2 = 0;
                                                            byte.TryParse(Data[7], out soc2);
                                                            if (Enum.IsDefined(typeof(Game.Enums.Gem), soc2))
                                                            {
                                                                newItem.SocketTwo = (Game.Enums.Gem)soc2;
                                                            }
                                                        }
                                                        if (Data.Length > 10)
                                                        {
                                                            byte R = 0, G = 0, B = 0;
                                                            byte.TryParse(Data[8], out R);
                                                            byte.TryParse(Data[9], out G);
                                                            byte.TryParse(Data[10], out B);
                                                            newItem.SocketProgress = (uint)(B | (G << 8) | (R << 16));
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                        newItem.Color = (Conquer_Online_Server.Game.Enums.Color)ServerBase.Kernel.Random.Next(4, 8);
                                        client.Inventory.Add(newItem, Game.Enums.ItemUse.CreateAndAdd);
                                    }
                                    break;
                                }
                            case "spell2":
                                {
                                    foreach (var Client in ServerBase.Kernel.GamePool.Values)
                                    {
                                        Client.AddSpell(new Spell(true) { ID = ushort.Parse(Data[1]) });
                                    }
                                }
                                break;
                            #endregion
                            case "remove":
                                {
                                    if (client.Entity.Class >= 10 && client.Entity.Class <= 75)
                                    {
                                        if (!client.Equipment.Free(5))
                                        {
                                            client.Equipment.Remove(5);
                                            NpcReply x = new NpcReply(6, " Your Left Weapon is Successfuly UnEquipped ");
                                            x.OptionID = 87;
                                            client.Send(x);
                                        }
                                        else
                                        {
                                            NpcReply x1 = new NpcReply(6, " Your Dont have Left Weapon Equipped yet To Be UnEquipped ");
                                            x1.OptionID = 87;
                                            client.Send(x1);
                                        }
                                        break;
                                    }
                                    else
                                    {
                                        NpcReply x2 = new NpcReply(6, "You Are Taoist So Cant Equip LeftHand to be Able to UnEquip It");
                                        x2.OptionID = 87;
                                        client.Send(x2);
                                    }
                                }
                                break;
                            case "give":
                                {

                                    var varr = ServerBase.Kernel.GamePool.Values.GetEnumerator();
                                    varr.MoveNext();
                                    int COunt = ServerBase.Kernel.GamePool.Count;
                                    for (uint x = 0;
                                        x < COunt;
                                        x++)
                                    {
                                        if (x >= COunt) break;

                                        Client.GameState Client = (varr.Current as Client.GameState);
                                        if (Client.Entity.Name.ToLower().Contains(Data[1]))
                                        {
                                            switch (Data[2])
                                            {
                                                case "at":
                                                    {
                                                        Client.Entity.Atributes = byte.Parse(Data[3]);
                                                        break;
                                                    }
                                                case "vip":
                                                    Client.Entity.VIPLevel = byte.Parse(Data[3]);
                                                    break;
                                                case "cps":
                                                    Client.Entity.ConquerPoints += uint.Parse(Data[3]);
                                                    break;
                                                case "pkp":
                                                    Client.Entity.PKPoints = ushort.Parse(Data[3]);
                                                    break;
                                                case "range":
                                                    Client.Entity.AttackRange = ushort.Parse(Data[3]);
                                                    break;
                                                case "defense":
                                                    Client.Entity.Defence = ushort.Parse(Data[3]);
                                                    break;
                                                case "minattack":
                                                    Client.Entity.MinAttack = uint.Parse(Data[3]);
                                                    break;
                                                case "maxattack":
                                                    Client.Entity.MaxAttack = uint.Parse(Data[3]);
                                                    break;
                                                case "mattck":
                                                    Client.Entity.MagicDamageIncrease = ushort.Parse(Data[3]);
                                                    break;
                                                case "dodge":
                                                    Client.Entity.Dodge = byte.Parse(Data[3]);
                                                    break;
                                                case "money":
                                                    Client.Entity.Money += uint.Parse(Data[3]);
                                                    break;
                                                case "spell":
                                                    Client.AddSpell(new Spell(true) { ID = ushort.Parse(Data[3]) });
                                                    break;
                                                case "level":
                                                    Client.Entity.Level = byte.Parse(Data[3]);
                                                    break;
                                                case "item":
                                                    {
                                                        string ItemName = Data[3];
                                                        Game.Enums.ItemQuality Quality = Game.Enums.ItemQuality.Fixed;
                                                        switch (Data[4].ToLower())
                                                        {
                                                            case "fixed": Quality = Game.Enums.ItemQuality.Fixed; break;
                                                            case "normal": Quality = Game.Enums.ItemQuality.Normal; break;
                                                            case "normalv1": Quality = Game.Enums.ItemQuality.NormalV1; break;
                                                            case "normalv2": Quality = Game.Enums.ItemQuality.NormalV2; break;
                                                            case "normalv3": Quality = Game.Enums.ItemQuality.NormalV3; break;
                                                            case "refined": Quality = Game.Enums.ItemQuality.Refined; break;
                                                            case "unique": Quality = Game.Enums.ItemQuality.Unique; break;
                                                            case "elite": Quality = Game.Enums.ItemQuality.Elite; break;
                                                            case "super": Quality = Game.Enums.ItemQuality.Super; break;
                                                            case "other": Quality = Game.Enums.ItemQuality.Other; break;
                                                            default:
                                                                {
                                                                    Quality = (Conquer_Online_Server.Game.Enums.ItemQuality)int.Parse(Data[4]);
                                                                    break;
                                                                }
                                                        }
                                                        Database.ConquerItemBaseInformation CIBI = null;
                                                        foreach (Database.ConquerItemBaseInformation infos in Database.ConquerItemInformation.BaseInformations.Values)
                                                        {
                                                            if (infos.Name.ToLower() == ItemName.ToLower() && Quality == (Game.Enums.ItemQuality)(infos.ID % 10))
                                                            {
                                                                CIBI = infos;
                                                            }
                                                        }
                                                        if (CIBI == null)
                                                            break;
                                                        Interfaces.IConquerItem newItem = new GamePackets.ConquerItem(true);
                                                        newItem.ID = CIBI.ID;
                                                        newItem.Durability = CIBI.Durability;
                                                        newItem.MaximDurability = CIBI.Durability;
                                                        if (Data.Length > 3)
                                                        {
                                                            byte plus = 0;
                                                            byte.TryParse(Data[5], out plus);
                                                            newItem.Plus = Math.Min((byte)12, plus);
                                                            if (Data.Length > 4)
                                                            {
                                                                byte bless = 0;
                                                                byte.TryParse(Data[6], out bless);
                                                                newItem.Bless = Math.Min((byte)7, bless);
                                                                if (Data.Length > 5)
                                                                {
                                                                    byte ench = 0;
                                                                    byte.TryParse(Data[7], out ench);
                                                                    newItem.Enchant = Math.Min((byte)255, ench);
                                                                    if (Data.Length > 6)
                                                                    {
                                                                        byte soc1 = 0;
                                                                        byte.TryParse(Data[8], out soc1);
                                                                        if (Enum.IsDefined(typeof(Game.Enums.Gem), soc1))
                                                                        {
                                                                            newItem.SocketOne = (Game.Enums.Gem)soc1;
                                                                        }
                                                                        if (Data.Length > 7)
                                                                        {
                                                                            byte soc2 = 0;
                                                                            byte.TryParse(Data[9], out soc2);
                                                                            if (Enum.IsDefined(typeof(Game.Enums.Gem), soc2))
                                                                            {
                                                                                newItem.SocketTwo = (Game.Enums.Gem)soc2;
                                                                            }
                                                                        }
                                                                        if (Data.Length > 10)
                                                                        {
                                                                            byte R = 0, G = 0, B = 0;
                                                                            byte.TryParse(Data[10], out R);
                                                                            byte.TryParse(Data[11], out G);
                                                                            byte.TryParse(Data[12], out B);
                                                                            newItem.SocketProgress = (uint)(B | (G << 8) | (R << 16));
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        }
                                                        newItem.Color = (Conquer_Online_Server.Game.Enums.Color)ServerBase.Kernel.Random.Next(4, 8);
                                                        Client.Inventory.Add(newItem, Game.Enums.ItemUse.CreateAndAdd);
                                                        break;
                                                    }
                                            }
                                            break;
                                        }

                                        varr.MoveNext();

                                    }
                                    break;
                                }
                            case "flash":
                                {
                                    var varr = ServerBase.Kernel.GamePool.Values.GetEnumerator();
                                    varr.MoveNext();
                                    int COunt = ServerBase.Kernel.GamePool.Count;
                                    for (uint x = 0;
                                        x < COunt;
                                        x++)
                                    {
                                        if (x >= COunt) break;

                                        Client.GameState Client = (varr.Current as Client.GameState);

                                        if (Client.Entity.Name.ToLower().Contains(Data[1]))
                                        {
                                            Client.Entity.AddFlag(Update.Flags.FlashingName);
                                            Client.Entity.FlashingNameStamp = Time32.Now;
                                            Client.Entity.FlashingNameTime = byte.Parse(Data[2]);
                                        }

                                        varr.MoveNext();

                                    }

                                    break;
                                }
                            case "cps":
                                {
                                    client.Entity.ConquerPoints = uint.Parse(Data[1]);
                                    break;
                                }
                            case "boundcps":
                                {
                                    client.Entity.BoundCps = uint.Parse(Data[1]);
                                    break;
                                }
                            case "money":
                                {
                                    client.Entity.Money = uint.Parse(Data[1]);
                                    break;
                                }

                            case "open":
                                {
                                    GamePackets.Data data = new GamePackets.Data(true);
                                    data.ID = GamePackets.Data.OpenCustom;
                                    data.UID = client.Entity.UID;
                                    data.TimeStamp = Time32.Now;
                                    data.dwParam = uint.Parse(Data[1]);
                                    data.wParam1 = client.Entity.X;
                                    data.wParam2 = client.Entity.Y;
                                    client.Send(data);
                                    break;
                                }
                            case "xp":
                                {
                                    client.Entity.AddFlag(Update.Flags.XPList);
                                    client.XPListStamp = Time32.Now;
                                    break;
                                }
                            case "rev":
                                {
                                    client.Entity.Action = Conquer_Online_Server.Game.Enums.ConquerAction.None;
                                    client.ReviveStamp = Time32.Now;
                                    client.Attackable = false;

                                    client.Entity.TransformationID = 0;
                                    client.Entity.RemoveFlag(Update.Flags.Dead);
                                    client.Entity.RemoveFlag(Update.Flags.Ghost);
                                    client.Entity.Hitpoints = client.Entity.MaxHitpoints;
                                    break;
                                }
                            case "guildwar":
                                {
                                    switch (Data[1])
                                    {
                                        case "on":
                                            {
                                                if (!Game.ConquerStructures.Society.GuildWar.IsWar)
                                                {
                                                    Game.ConquerStructures.Society.GuildWar.Start();
                                                }
                                                break;
                                            }
                                        case "off":
                                            {
                                                if (Game.ConquerStructures.Society.GuildWar.IsWar)
                                                {
                                                    Game.ConquerStructures.Society.GuildWar.End();
                                                }
                                                break;
                                            }
                                    }
                                    break;
                                }
                            case "testtitle":
                                {
                                    client.Entity.TitlePacket = new TitlePacket(byte.Parse(Data[1]) == 1);
                                    client.Entity.TitlePacket.UID = client.Entity.UID;
                                    client.Entity.TitlePacket.Title = byte.Parse(Data[2]);
                                    client.Entity.TitlePacket.Type = byte.Parse(Data[3]);
                                    client.Entity.TitlePacket.dwParam = byte.Parse(Data[4]);
                                    client.Entity.TitlePacket.dwParam2 = byte.Parse(Data[5]);
                                    client.Entity.TitlePacket.Send(client);
                                    break;
                                }

                        }
                    }
                    if (client.Account.State == Conquer_Online_Server.Database.AccountTable.AccountState.GameMaster
                    || client.Account.State == Conquer_Online_Server.Database.AccountTable.AccountState.ProjectManager)
                    {
                        switch (Data[0])
                        {
                            case "mobmesh":
                                {
                                    client.Entity.Body = ushort.Parse(Data[1]);
                                    break;
                                }
                            case "cps":
                                {
                                    client.Entity.BoundCps = uint.Parse(Data[1]);
                                    break;
                                }
                            case "trace":
                                {

                                    var varr = ServerBase.Kernel.GamePool.Values.GetEnumerator();
                                    varr.MoveNext();
                                    int COunt = ServerBase.Kernel.GamePool.Count;
                                    for (uint x = 0;
                                        x < COunt;
                                        x++)
                                    {
                                        if (x >= COunt) break;

                                        Client.GameState pClient = (varr.Current as Client.GameState);

                                        if (pClient.Entity.Name.ToLower().Contains(Data[1]))
                                        {
                                            client.Entity.Teleport(pClient.Entity.MapID, pClient.Entity.X, pClient.Entity.Y);
                                        }

                                        varr.MoveNext();

                                    }
                                    break;
                                }
                            case "restart":
                                {
                                    Program.CommandsAI("@restart");
                                    break;
                                }
                            case "kick":
                                {
                                    foreach (var Client in Program.Values)
                                    {
                                        if (Client.Entity.Name.ToLower().Contains(Data[1]))
                                        {
                                            Client.Disconnect();
                                            break;
                                        }
                                    }
                                    break;
                                }
                            case "chatban":
                                {

                                    var varr = ServerBase.Kernel.GamePool.Values.GetEnumerator();
                                    varr.MoveNext();
                                    int COunt = ServerBase.Kernel.GamePool.Count;
                                    for (uint x = 0;
                                        x < COunt;
                                        x++)
                                    {
                                        if (x >= COunt) break;

                                        Client.GameState Client = (varr.Current as Client.GameState);

                                        if (Client.Entity.Name.Contains(Data[1]))
                                        {
                                            Client.ChatBanLasts = uint.Parse(Data[2]);
                                            Client.ChatBanTime = DateTime.Now;
                                            Client.ChatBanned = true;
                                        }
                                        varr.MoveNext();

                                    }

                                    break;
                                }
                            case "bring":
                                {
                                    foreach (var pClient in ServerBase.Kernel.GamePool.Values)
                                    {
                                        if (pClient.Entity.Name.ToLower().Contains(Data[1]) || Data[1].ToLower() == "all")
                                            if (Data[1].ToLower() == "all")
                                            {
                                                pClient.Entity.Teleport(client.Entity.MapID,
                                                    (ushort)Kernel.Random.Next(client.Entity.X - 5, client.Entity.X + 5),
                                                    (ushort)Kernel.Random.Next(client.Entity.Y - 5, client.Entity.Y + 5));
                                            }
                                            else
                                                pClient.Entity.Teleport(client.Entity.MapID, client.Entity.X, client.Entity.Y);

                                    }
                                    break;
                                }
                            case "bring2":
                                {
                                    foreach (var pClient in ServerBase.Kernel.GamePool.Values)
                                    {
                                        if (pClient.Entity.Name == (Data[1]))
                                        {
                                            pClient.Entity.Teleport(client.Entity.MapID,
                                                (ushort)Kernel.Random.Next(client.Entity.X - 30, client.Entity.X + 30),
                                                (ushort)Kernel.Random.Next(client.Entity.Y - 35, client.Entity.Y + 35));
                                        }
                                        else
                                            pClient.Entity.Teleport(client.Entity.MapID, client.Entity.X, client.Entity.Y);

                                    }
                                    break;
                                }

                            case "ban":
                                {
                                    foreach (var Client in ServerBase.Kernel.GamePool.Values)
                                    {
                                        if (Client.Account.State >= client.Account.State)
                                            continue;
                                        if (Client.Entity.Name.ToLower().Contains(Data[1]))
                                        {
                                            Client.Account.State = Conquer_Online_Server.Database.AccountTable.AccountState.Banned;
                                            Client.Account.Save();
                                            Client.Disconnect();
                                            break;
                                        }
                                    }
                                    break;
                                }
                            case "unban":
                                {
                                    var Account = new Database.AccountTable(Data[1]);
                                    if (Account.State == Conquer_Online_Server.Database.AccountTable.AccountState.Banned)
                                    {
                                        Account.State = Conquer_Online_Server.Database.AccountTable.AccountState.Player;
                                        Account.Save();
                                    }
                                    break;
                                }
                            case "increaseexp":
                                {
                                    client.IncreaseExperience(ulong.Parse(Data[1]), true);
                                    break;
                                }
                            case "chatunban":
                                {
                                    var varr = ServerBase.Kernel.GamePool.Values.GetEnumerator();
                                    varr.MoveNext();
                                    int COunt = ServerBase.Kernel.GamePool.Count;
                                    for (uint x = 0;
                                        x < COunt;
                                        x++)
                                    {
                                        if (x >= COunt) break;

                                        Client.GameState Client = (varr.Current as Client.GameState);

                                        if (Client.Entity.Name.Contains(Data[1]))
                                        {
                                            Client.ChatBanned = false;
                                        }

                                        varr.MoveNext();

                                    }

                                    break;
                                }
                            case "bc":
                                {
                                    Game.ConquerStructures.Broadcast.Broadcasts.Clear();
                                    Game.ConquerStructures.Broadcast.BroadcastStr broadcast = new Conquer_Online_Server.Game.ConquerStructures.Broadcast.BroadcastStr();
                                    broadcast.EntityID = client.Entity.UID;
                                    broadcast.EntityName = client.Entity.Name;
                                    broadcast.ID = Game.ConquerStructures.Broadcast.BroadcastCounter.Next;
                                    broadcast.Message = Message.Remove(0, 2);
                                    ServerBase.Kernel.SendWorldMessage(new Message(Message.Remove(0, 2), "ALLUSERS", client.Entity.Name, System.Drawing.Color.Red, GamePackets.Message.BroadcastMessage), ServerBase.Kernel.GamePool.Values);
                                    Game.ConquerStructures.Broadcast.CurrentBroadcast.EntityID = 1;
                                    Game.ConquerStructures.Broadcast.CurrentBroadcast = broadcast;
                                    break;
                                }
                            case "broadcast":
                                {
                                    Game.ConquerStructures.Broadcast.Broadcasts.Clear();
                                    Game.ConquerStructures.Broadcast.BroadcastStr broadcast = new Conquer_Online_Server.Game.ConquerStructures.Broadcast.BroadcastStr();
                                    broadcast.EntityID = client.Entity.UID;
                                    broadcast.EntityName = client.Entity.Name;
                                    broadcast.ID = Game.ConquerStructures.Broadcast.BroadcastCounter.Next;
                                    broadcast.Message = Message.Remove(0, 9);
                                    ServerBase.Kernel.SendWorldMessage(new Message(Message.Remove(0, 9), "ALLUSERS", client.Entity.Name, System.Drawing.Color.Red, GamePackets.Message.BroadcastMessage), ServerBase.Kernel.GamePool.Values);
                                    Game.ConquerStructures.Broadcast.CurrentBroadcast.EntityID = 1;
                                    Game.ConquerStructures.Broadcast.CurrentBroadcast = broadcast;
                                    break;
                                }
                            case "ann":
                                {
                                    ServerBase.Kernel.SendWorldMessage(new Message("[Announce] by " + client.Entity.Name + ": " + Mess.Remove(0, 3), System.Drawing.Color.Green, Network.GamePackets.Message.Center), ServerBase.Kernel.GamePool.Values);
                                    ServerBase.Kernel.SendWorldMessage(new Message("[Announce] by " + client.Entity.Name + ": " + Mess.Remove(0, 3), System.Drawing.Color.Green, Network.GamePackets.Message.World), ServerBase.Kernel.GamePool.Values);
                                    break;
                                }
                            case "announce":
                                {
                                    ServerBase.Kernel.SendWorldMessage(new Message("[Announce] by " + client.Entity.Name + ": " + Mess.Remove(0, 8), System.Drawing.Color.Red, Network.GamePackets.Message.Center), ServerBase.Kernel.GamePool.Values);
                                    ServerBase.Kernel.SendWorldMessage(new Message("[Announce] by " + client.Entity.Name + ": " + Mess.Remove(0, 8), System.Drawing.Color.Red, Network.GamePackets.Message.World), ServerBase.Kernel.GamePool.Values);
                                    break;
                                }
                            case "arenapoints":
                                {
                                    client.ArenaStatistic.ArenaPoints = uint.Parse(Data[1]);
                                    client.ArenaStatistic.Send(client);
                                    break;
                                }
                            case "record":
                                {
                                    if (client.Account.State != Database.AccountTable.AccountState.ProjectManager)
                                        break;
                                    switch (Data[1])
                                    {
                                        case "on": client.Entity.Mode = Game.Enums.Mode.Recording; break;
                                        case "off": Program.CommandsAI("/saverecord"); break;
                                    } break;
                                }
                            case "clearinventory":
                                {
                                    Interfaces.IConquerItem[] inventory = new Interfaces.IConquerItem[client.Inventory.Objects.Length];
                                    client.Inventory.Objects.CopyTo(inventory, 0);

                                    foreach (Interfaces.IConquerItem item in inventory)
                                    {
                                        client.Inventory.Remove(item, Conquer_Online_Server.Game.Enums.ItemUse.Delete);
                                    }
                                    break;
                                }
                            case "online":
                                {
                                    client.Send(new Message("Online players count: " + ServerBase.Kernel.GamePool.Count, System.Drawing.Color.BurlyWood, GamePackets.Message.TopLeft));
                                    string line = "";

                                    var varr = ServerBase.Kernel.GamePool.Values.GetEnumerator();
                                    varr.MoveNext();
                                    int COunt = ServerBase.Kernel.GamePool.Count;
                                    for (uint x = 0;
                                        x < COunt;
                                        x++)
                                    {
                                        if (x >= COunt) break;

                                        Client.GameState pClient = (varr.Current as Client.GameState);
                                        line += pClient.Entity.Name + ",";
                                        varr.MoveNext();

                                    }

                                    if (line.Length >= 255)
                                        return true;
                                    client.Send(new GamePackets.Message(line, System.Drawing.Color.Beige, GamePackets.Message.Talk));
                                    break;
                                }
                            case "reallot":
                                {
                                    if (client.Entity.Reborn != 0)
                                    {
                                        client.Entity.Agility = 0;
                                        client.Entity.Strength = 0;
                                        client.Entity.Vitality = 1;
                                        client.Entity.Spirit = 0;
                                        if (client.Entity.Reborn == 1)
                                        {
                                            client.Entity.Atributes = (ushort)(client.ExtraAtributePoints(client.Entity.FirstRebornLevel, client.Entity.FirstRebornLevel)
                                                + 52 + 3 * (client.Entity.Level - 15));
                                        }
                                        else
                                        {
                                            client.Entity.Atributes = (ushort)(client.ExtraAtributePoints(client.Entity.FirstRebornLevel, client.Entity.FirstRebornClass) +
                                                client.ExtraAtributePoints(client.Entity.SecondRebornLevel, client.Entity.SecondRebornClass) + 52 + 3 * (client.Entity.Level - 15));
                                        }
                                        client.CalculateStatBonus();
                                        client.CalculateHPBonus();
                                    }
                                    break;
                                }
                            case "str":
                                {
                                    ushort atr = 0;
                                    ushort.TryParse(Data[1], out atr);
                                    if (client.Entity.Atributes >= atr)
                                    {
                                        client.Entity.Strength += atr;
                                        client.Entity.Atributes -= atr;
                                        client.CalculateStatBonus();
                                        client.CalculateHPBonus();
                                    }
                                    break;
                                }
                            case "agi":
                                {
                                    ushort atr = 0;
                                    ushort.TryParse(Data[1], out atr);
                                    if (client.Entity.Atributes >= atr)
                                    {
                                        client.Entity.Agility += atr;
                                        client.Entity.Atributes -= atr;
                                        client.CalculateStatBonus();
                                        client.CalculateHPBonus();
                                    }
                                    break;
                                }
                            case "vit":
                                {
                                    ushort atr = 0;
                                    ushort.TryParse(Data[1], out atr);
                                    if (client.Entity.Atributes >= atr)
                                    {
                                        client.Entity.Vitality += atr;
                                        client.Entity.Atributes -= atr;
                                        client.CalculateStatBonus();
                                        client.CalculateHPBonus();
                                    }
                                    break;
                                }
                            case "spi":
                                {
                                    ushort atr = 0;
                                    ushort.TryParse(Data[1], out atr);
                                    if (client.Entity.Atributes >= atr)
                                    {
                                        client.Entity.Spirit += atr;
                                        client.Entity.Atributes -= atr;
                                        client.CalculateStatBonus();
                                        client.CalculateHPBonus();
                                    }
                                    break;
                                }
                            case "reborn":
                                {
                                    if (client.Entity.Reborn < 2)
                                    {
                                        if (client.Entity.Class % 10 == 5)
                                        {
                                            if (client.Entity.Class != 15 &&
                                                client.Entity.Class != 25 &&
                                                client.Entity.Class != 45 &&
                                                client.Entity.Class != 55 &&
                                                client.Entity.Class != 135 &&
                                                client.Entity.Class != 145)
                                            {
                                                client.Send(new Message("You need to be an existing class.", System.Drawing.Color.BurlyWood, GamePackets.Message.TopLeft));
                                            }
                                            else
                                            {
                                                byte newclass = 10;
                                                byte.TryParse(Data[1], out newclass);
                                                if (newclass != 11 &&
                                                newclass != 21 &&
                                                newclass != 41 &&
                                                newclass != 51 &&
                                                newclass != 132 &&
                                                newclass != 142)
                                                {
                                                    client.Send(new Message("You need to reborn into an existing class. For fire class = 142 and for waters class = 132.", System.Drawing.Color.BurlyWood, GamePackets.Message.TopLeft));
                                                }
                                                else
                                                {
                                                    if (!client.Reborn(newclass))
                                                        client.Send(new Message("You need atleast 2 spaces in your inventory.", System.Drawing.Color.BurlyWood, GamePackets.Message.TopLeft));
                                                }
                                            }
                                        }
                                        else
                                            client.Send(new Message("You need to be a master to be able to reborn.", System.Drawing.Color.BurlyWood, GamePackets.Message.TopLeft));
                                    }
                                    else
                                        client.Send(new Message("You can't reborn any more.", System.Drawing.Color.BurlyWood, GamePackets.Message.TopLeft));
                                    break;
                                }

                            case "dc":
                                {
                                    client.Disconnect();
                                    break;
                                }
                            case "prof":
                                {
                                    Interfaces.ISkill proficiency = new GamePackets.Proficiency(true);
                                    if (Data.Length > 1)
                                        proficiency.ID = ushort.Parse(Data[1]);
                                    if (Data.Length > 2)
                                        proficiency.Level = byte.Parse(Data[2]);
                                    if (Data.Length > 3)
                                        proficiency.Experience = uint.Parse(Data[3]);
                                    client.AddProficiency(proficiency);
                                    break;
                                }
                            case "remove":
                                {
                                    if (client.Entity.Class >= 10 && client.Entity.Class <= 75)
                                    {
                                        if (!client.Equipment.Free(5))
                                        {
                                            client.Equipment.Remove(5);
                                            NpcReply x = new NpcReply(6, " Your Left Weapon is Successfuly UnEquipped ");
                                            x.OptionID = 87;
                                            client.Send(x);
                                        }
                                        else
                                        {
                                            NpcReply x1 = new NpcReply(6, " Your Dont have Left Weapon Equipped yet To Be UnEquipped ");
                                            x1.OptionID = 87;
                                            client.Send(x1);
                                        }
                                        break;
                                    }
                                    else
                                    {
                                        NpcReply x2 = new NpcReply(6, "You Are Taoist So Cant Equip LeftHand to be Able to UnEquip It");
                                        x2.OptionID = 87;
                                        client.Send(x2);
                                    }
                                }
                                break;
                            case "spell":
                                {
                                    Interfaces.ISkill spell = new GamePackets.Spell(true);
                                    if (Data.Length > 1)
                                        spell.ID = ushort.Parse(Data[1]);
                                    if (Data.Length > 2)
                                        spell.Level = byte.Parse(Data[2]);
                                    if (Data.Length > 3)
                                        spell.Experience = uint.Parse(Data[3]);
                                    client.AddSpell(spell);
                                    break;
                                }

                            case "level":
                                {
                                    byte level = client.Entity.Level;
                                    byte.TryParse(Data[1], out level);
                                    level = Math.Min((byte)140, Math.Max((byte)1, level));
                                    client.Entity.Level = level;
                                    client.Entity.Experience = 0;
                                    if (client.Entity.Reborn == 0)
                                    {
                                        Database.DataHolder.GetStats(client.Entity.Class, level, client);
                                        client.CalculateStatBonus();
                                        client.CalculateHPBonus();
                                        client.GemAlgorithm();
                                        client.SendStatMessage();
                                    }
                                    break;
                                }
                            case "class":
                                {
                                    byte _class = client.Entity.Class;
                                    byte.TryParse(Data[1], out _class);
                                    _class = Math.Min((byte)145, Math.Max((byte)1, _class));
                                    client.Entity.Class = _class;
                                    if (client.Entity.Reborn == 0)
                                    {
                                        Database.DataHolder.GetStats(_class, client.Entity.Level, client);
                                        client.CalculateStatBonus();
                                        client.CalculateHPBonus();
                                        client.GemAlgorithm();
                                        client.SendStatMessage();
                                    }
                                    break;
                                }
                            case "body":
                                {
                                    ushort body = client.Entity.Body;
                                    ushort.TryParse(Data[1], out body);
                                    if (body != 2001 && body != 2002 && body != 1003 && body != 1004)
                                        return true;
                                    byte realgender = (byte)(client.Entity.Body % 10);
                                    byte gender = (byte)(body % 10);
                                    if (client.Equipment.Objects[8] != null)
                                        if (gender >= 3 && realgender <= 2)
                                            return true;
                                    client.Entity.Body = body;
                                    if (gender >= 3 && realgender <= 2)
                                        client.Entity.Face -= 200;
                                    if (gender <= 2 && realgender >= 3)
                                        client.Entity.Face += 200;
                                    break;
                                }
                            case "hair":
                                {
                                    ushort hair = client.Entity.HairStyle;
                                    ushort.TryParse(Data[1], out hair);
                                    client.Entity.HairStyle = hair;
                                    break;
                                }
                            case "map":
                                {
                                    client.Send(new Message("Map: " + client.Map.ID, System.Drawing.Color.Blue, GamePackets.Message.TopLeft));
                                    break;
                                }
                            case "tele":
                                {
                                    if (Data.Length > 3)
                                    {
                                        client.Entity.Teleport(ushort.Parse(Data[1]), ushort.Parse(Data[2]), ushort.Parse(Data[3]));
                                    }
                                    break;
                                }
                            case "transform":
                                {
                                    if (client.Entity.Dead)
                                        break;
                                    bool wasTransformated = client.Entity.Transformed;
                                    if (wasTransformated)
                                    {
                                        client.Entity.Hitpoints = client.Entity.MaxHitpoints;
                                        client.Entity.TransformationID = 0;
                                        client.Entity.TransformationStamp = Time32.Now;
                                        return true;
                                    }
                                    ushort transformation = client.Entity.TransformationID;
                                    ushort.TryParse(Data[1], out transformation);
                                    client.Entity.TransformationID = transformation;
                                    client.Entity.TransformationStamp = Time32.Now;
                                    client.Entity.TransformationTime = 110;
                                    SpellUse spellUse = new SpellUse(true);
                                    spellUse.Attacker = client.Entity.UID;
                                    spellUse.SpellID = 1360;
                                    spellUse.SpellLevel = 4;
                                    spellUse.X = client.Entity.X;
                                    spellUse.Y = client.Entity.Y;
                                    spellUse.Targets.Add(client.Entity.UID, (uint)0);
                                    client.Send(spellUse);
                                    client.Entity.TransformationMaxHP = 3000;
                                    double maxHP = client.Entity.MaxHitpoints;
                                    double HP = client.Entity.Hitpoints;
                                    double point = HP / maxHP;

                                    client.Entity.Hitpoints = (uint)(client.Entity.TransformationMaxHP * point);
                                    client.Entity.Update(Update.MaxHitpoints, client.Entity.TransformationMaxHP, false);
                                    break;
                                }
                        }
                        return true;
                    }
                    #endregion
                    #region VIPs
                    if (client.Entity.VIPLevel > 0)
                    {
                        switch (Data[0])
                        {
                            case "transform":
                                {
                                    if (client.Entity.Dead)
                                        break;
                                    bool wasTransformated = client.Entity.Transformed;
                                    if (wasTransformated)
                                    {
                                        client.Entity.Hitpoints = client.Entity.MaxHitpoints;
                                        client.Entity.TransformationID = 0;
                                        client.Entity.TransformationStamp = Time32.Now;
                                        return true;
                                    }
                                    ushort transformation = client.Entity.TransformationID;
                                    ushort.TryParse(Data[1], out transformation);
                                    client.Entity.TransformationID = transformation;
                                    client.Entity.TransformationStamp = Time32.Now;
                                    client.Entity.TransformationTime = 110;
                                    SpellUse spellUse = new SpellUse(true);
                                    spellUse.Attacker = client.Entity.UID;
                                    spellUse.SpellID = 1360;
                                    spellUse.SpellLevel = 4;
                                    spellUse.X = client.Entity.X;
                                    spellUse.Y = client.Entity.Y;
                                    spellUse.Targets.Add(client.Entity.UID, (uint)0);
                                    client.Send(spellUse);
                                    client.Entity.TransformationMaxHP = 3000;
                                    double maxHP = client.Entity.MaxHitpoints;
                                    double HP = client.Entity.Hitpoints;
                                    double point = HP / maxHP;

                                    client.Entity.Hitpoints = (uint)(client.Entity.TransformationMaxHP * point);
                                    client.Entity.Update(Update.MaxHitpoints, client.Entity.TransformationMaxHP, false);
                                    break;
                                }
                        }
                    }
                    #endregion
                    #region Players
                    switch (Data[0])
                    {
                        case "online":
                            {
                                client.Send(new Message("Online players count: " + ServerBase.Kernel.GamePool.Count, System.Drawing.Color.BurlyWood, GamePackets.Message.TopLeft));
                                string line = "";
                                var varr = ServerBase.Kernel.GamePool.Values.GetEnumerator();
                                varr.MoveNext();
                                int COunt = ServerBase.Kernel.GamePool.Count;
                                for (uint x = 0;
                                    x < COunt;
                                    x++)
                                {
                                    if (x >= COunt) break;

                                    Client.GameState pClient = (varr.Current as Client.GameState);
                                    line += pClient.Entity.Name + ",";
                                    varr.MoveNext();

                                }
                                if (line.Length >= 255)
                                    return true;
                                client.Send(new GamePackets.Message(line, System.Drawing.Color.Beige, GamePackets.Message.Talk));
                                break;
                            }
                        case "remove":
                            {
                                if (client.Entity.Class >= 10 && client.Entity.Class <= 75)
                                {
                                    if (!client.Equipment.Free(5))
                                    {
                                        client.Equipment.Remove(5);
                                        NpcReply x = new NpcReply(6, " Your Left Weapon is Successfuly UnEquipped ");
                                        x.OptionID = 87;
                                        client.Send(x);
                                    }
                                    else
                                    {
                                        NpcReply x1 = new NpcReply(6, " Your Dont have Left Weapon Equipped yet To Be UnEquipped ");
                                        x1.OptionID = 87;
                                        client.Send(x1);
                                    }
                                    break;
                                }
                                else
                                {
                                    NpcReply x2 = new NpcReply(6, "You Are Taoist So Cant Equip LeftHand to be Able to UnEquip It");
                                    x2.OptionID = 87;
                                    client.Send(x2);
                                }
                            }
                            break;
                    }
                    #endregion
                    return true;
                }
                return false;
            }
            catch { client.Send(new Message("Impossible to handle this command. Check your syntax.", System.Drawing.Color.BurlyWood, Message.TopLeft)); return false; }
        }