public static void Handle(byte[] Data, Client.GameState Client)
        {
            QuestInfoPacket info = new QuestInfoPacket(8);
            ushort num = BitConverter.ToUInt16(Data, 4);
            if (num == 3)
            {
                MySqlCommand cmd = new MySqlCommand(MySqlCommandType.SELECT);
                cmd.Select("heroquests").Where("hero", Client.Entity.UID).And("quest", 0xb71b2);
                PhoenixProject.Database.MySqlReader reader = new PhoenixProject.Database.MySqlReader(cmd);
                if (Client != null)
                {
                    info.Type = 3;
                    while (reader.Read())
                    {
                        info.AddQuest(reader.ReadUInt32("quest"), (QuestCompleteTypes)((ushort)reader.ReadUInt32("completeflag")));
                        HeroQuest quest2 = new HeroQuest
                        {
                            Identifier = reader.ReadUInt32("quest"),
                            DailyFinishes =  reader.ReadUInt32("dailyfinishes"),
                            CompleteFlag = (QuestCompleteTypes)((ushort) reader.ReadUInt32("completeflag"))
                        };
                        DateTime time3 = new DateTime(0x7b2, 1, 1);
                        quest2.CompleteTime = time3.ToLocalTime().AddSeconds(reader.ReadUInt32("completetime"));

                       // quest2.CompleteTime = new DateTime().FromUnix(Convert.ToUInt32(reader["completetime"]));
                        quest2.Step = reader.ReadUInt32("step");
                        HeroQuest quest = quest2;
                        Client.Quests.GetOrAdd(quest.Identifier, quest);
                    }
                    reader.Close();
                    reader.Dispose();
                }
                Client.Send((byte[])info);
                if (Client != null)
                {
                    cmd.Select("killtargets").Where("hero", Client.Entity.UID);
                    while (reader.Read())
                    {
                        QuestQuery query = new QuestQuery
                        {
                            Identifier = reader.ReadUInt32("quest"),
                            Unknown2 = reader.ReadUInt32("count")
                        };
                        Client.Send((byte[])query);
                    }
                    reader.Close();
                    reader.Dispose();
                }
            }
            else
            {
                Console.WriteLine("Unhandled QuestInfo (1134) Type "+num+"");
            }
        }
        public static bool AddQuest(Client.GameState h, HeroQuest q)
        {
            if (h.Quests.TryAdd(q.Identifier, q))
            {
                MySqlCommand cmd = new MySqlCommand(MySqlCommandType.INSERT);
                cmd.Insert("heroquests").Insert("hero", h.Entity.UID).Insert("quest", q.Identifier)
                    .Insert("npc", "0").Insert("flag", (uint)q.CompleteFlag).Insert("step", q.Step)
                    .Insert("time", "0")
                    .Insert("daily", "0").Execute();

                QuestInfoPacket info = new QuestInfoPacket(0x10)
                {
                    Type = 1,
                    QuestIdentifier = q.Identifier,
                    QuestType = QuestCompleteTypes.Accepted
                };
                h.Send((byte[])info);
            }
            return false;
        }
        public static bool Complete(Client.GameState h, uint questID, bool effect = true)
        {
            HeroQuest quest;
            if (h.Quests.TryGetValue(questID, out quest))
            {
                Quest quest2;
                if (ServerBase.Kernel.Quest.TryGetValue(questID, out quest2))
                {
                    quest.CompleteFlag = QuestCompleteTypes.Done;
                    quest.CompleteTime = DateTime.Now;
                    foreach (IConquerItem view in quest2.ItemPrizes)
                    {
                        if (h.Inventory.Count > 39)
                        {
                            Database.ConquerItemBaseInformation item;
                            string name = "reward";
                            if (PhoenixProject.Database.ConquerItemInformation.BaseInformations.TryGetValue(view.ID, out item))
                            {
                                name = item.Name;
                            }
                            string msg = string.Format("You don't have room for the " + name + ", go to the PrizeOfficer in Market to claim it.!", h.Entity.Name, h.Entity.Name);
                            h.Send(new Message(msg, System.Drawing.Color.White, Message.Talk));
                           // h.Send((byte[])new MessagePacket("You don't have room for the " + name + ", go to the PrizeOfficer in Market to claim it.", MessagePacket.Channels.Talk));
                        }
                        else
                        {
                            h.Inventory.Add(view, Game.Enums.ItemUse.CreateAndAdd);
                        }
                    }
                    h.Entity.Money += quest2.Prizes[QuestPrize.Gold];
                    h.Entity.ConquerPoints += quest2.Prizes[QuestPrize.CP];
                    h.IncreaseExperience((ulong)quest2.Prizes[QuestPrize.Exp], false);
                    QuestInfoPacket info = new QuestInfoPacket(0x10)
                    {
                        Type = 4,
                        QuestIdentifier = questID,
                        QuestType = QuestCompleteTypes.Done
                    };
                    h.Send((byte[])info);
                    if (effect)
                    {
                        Data packet = new Data(true);
                        packet.UID = h.Entity.UID;
                        packet.ID = Data.OpenCustom;
                        packet.dwParam = 0xc4b;
                        h.Send(packet);

                    }
                }
                uint times;
                DateTime time2 = new DateTime(0x7b2, 1, 1);
            TimeSpan span = (TimeSpan) (DateTime.Now - time2.ToLocalTime());
            times = (uint)span.TotalSeconds;

                MySqlCommand cmd3 = new MySqlCommand(MySqlCommandType.UPDATE);
                cmd3.Update("heroquests").Set("q", questID).Set("time", times)
                    .Set("flag", 1).Where("hero", h.Entity.UID).Execute();

                return true;
            }
            return false;
        }