public void OnTimer()
        {
            if (m_quizShow.Count < ServerKernel.QUIZ_MAX_QUESTION)
            {
                return;                                                    // no questions, no quiz
            }
            DateTime now = DateTime.Now;

            if (ServerKernel.QUIZ_SHOW_HOUR.Contains(now.Hour + 1))
            {
                if (now.Minute == 55 &&
                    now.Second == 0 &&
                    m_state < QuizState.STARTING)
                {
                    ServerKernel.SendMessageToAll("Quiz show will start in 5 minutes.", ChatTone.TOP_LEFT);
                }

                // Quiz starting
                if (now.Minute == 59 &&
                    now.Second <= 1 &&
                    m_state < QuizState.STARTING)
                {
                    if (now.DayOfWeek == DayOfWeek.Sunday &&
                        now.Hour + 1 == 22)
                    {
                        return;
                    }

                    ReloadQuestions();

                    // reset basic variable
                    m_nActualQuestion = 0;
                    m_quizUserInformation.Clear();
                    m_temporaryQuestions.Clear();

                    // start the quiz
                    m_state = QuizState.STARTING;
                    // and send the initial packet :)
                    var pMsg = new MsgQuiz
                    {
                        Type            = QuizShowType.START_QUIZ,
                        TimeTillStart   = (ushort)(60 - now.Second),
                        TimePerQuestion = ServerKernel.QUIZ_TIME_PER_QUESTION,
                        QuestionAmount  = ServerKernel.QUIZ_MAX_QUESTION,
                        FirstPrize      = ServerKernel.QUIZ_SHOW_AWARD[0],
                        SecondPrize     = ServerKernel.QUIZ_SHOW_AWARD[1],
                        ThirdPrize      = ServerKernel.QUIZ_SHOW_AWARD[2]
                    };
                    // send to all players
                    foreach (var plr in ServerKernel.Players.Values)
                    {
                        // create the user object that will be held by the server while it's alive
                        var plrObj = new QuizShowUserObject
                        {
                            Experience   = 0,
                            Name         = plr.Character.Name,
                            Points       = 0,
                            TimeTaken    = 0,
                            UserIdentity = plr.Identity,
                            Canceled     = false
                        };
                        m_quizUserInformation.Add(plr.Identity, plrObj); // save the info
                        plr.Send(pMsg);                                  // send packet to client
                    }

                    // quiz will only happen if there is at least 20 questions
                    if (m_quizShow.Count > ServerKernel.QUIZ_MAX_QUESTION)
                    {
                        List <KeyValuePair <uint, DbGameQuiz> > tempList = new List <KeyValuePair <uint, DbGameQuiz> >();
                        Random rand = new Random();

                        foreach (var question in m_quizShow.Values)
                        {
                            tempList.Add(new KeyValuePair <uint, DbGameQuiz>((uint)rand.Next(), question));
                        }

                        int num = 0;
                        foreach (var question in tempList.OrderBy(x => x.Key).Where(question => num++ < ServerKernel.QUIZ_MAX_QUESTION))
                        {
                            m_temporaryQuestions.Add(question.Value);
                        }
                    }
                    else
                    {
                        if (m_quizShow.Count < ServerKernel.QUIZ_MAX_QUESTION)
                        {
                            m_state = QuizState.STOPPED;
                            return;
                        }
                        // we have exactly 20 questions :) so ok
                        foreach (var question in m_quizShow.Values)
                        {
                            m_temporaryQuestions.Add(question);
                        }
                    }
                    // send message to all (supposing they didn't receive the window lol)
                    ServerKernel.SendMessageToAll(ServerString.STR_QUIZ_SHOW_START, ChatTone.TOP_LEFT);
                }
            }
            if (ServerKernel.QUIZ_SHOW_HOUR.Contains(now.Hour) &&
                now.Minute <= (ServerKernel.QUIZ_MAX_QUESTION * ServerKernel.QUIZ_TIME_PER_QUESTION) / 60)
            {
                // quiz started
                if (m_state == QuizState.STARTING &&
                    now.Minute == 0)
                {
                    m_state = QuizState.RUNNING;
                    m_pNextQuestion.Startup(ServerKernel.QUIZ_TIME_PER_QUESTION);
                    m_pEventCheck.Startup(800);

                    DbGameQuiz question = m_temporaryQuestions[m_nActualQuestion++];
                    var        pMsg     = new MsgQuiz
                    {
                        Type              = QuizShowType.QUESTION_QUIZ,
                        QuestionNumber    = (ushort)(m_nActualQuestion),
                        LastCorrectAnswer = 0,
                        ExperienceAwarded = 1,
                        TimeTakenTillNow  = 0,
                        CurrentScore      = 0
                    };
                    pMsg.AddString(question.Question, question.Answer0, question.Answer1, question.Answer2,
                                   question.Answer3);
                    foreach (var plr in ServerKernel.Players.Values)
                    {
                        plr.Send(pMsg);
                    }
                }

                // quiz running
                if (m_state == QuizState.RUNNING &&
                    m_pNextQuestion.ToNextTime() &&
                    m_nActualQuestion < ServerKernel.QUIZ_MAX_QUESTION)
                {
                    foreach (var usr in m_quizUserInformation.Values)
                    {
                        if (usr.LastQuestion < m_nActualQuestion)
                        {
                            usr.Points    += 1;
                            usr.TimeTaken += ServerKernel.QUIZ_TIME_PER_QUESTION;
                        }
                    }

                    UpdateRanking();

                    DbGameQuiz question = m_temporaryQuestions[m_nActualQuestion++];
                    var        pMsg     = new MsgQuiz
                    {
                        Type              = QuizShowType.QUESTION_QUIZ,
                        QuestionNumber    = (ushort)m_nActualQuestion,
                        LastCorrectAnswer = m_temporaryQuestions[m_nActualQuestion - 2].Correct
                    };
                    pMsg.AddString(question.Question, question.Answer0, question.Answer1, question.Answer2,
                                   question.Answer3);
                    foreach (var plr in ServerKernel.Players.Values.Where(x => !x.Character.QuizCanceled))
                    {
                        var plrObj = m_quizUserInformation.Values.FirstOrDefault(x => x.UserIdentity == plr.Identity);
                        if (plrObj == null)
                        {
                            plrObj = new QuizShowUserObject
                            {
                                Experience   = 0,
                                Name         = plr.Character.Name,
                                Points       = 0,
                                TimeTaken    = 0,
                                UserIdentity = plr.Identity,
                                LastQuestion = 0
                            };
                        }

                        if (plrObj.LastQuestion < m_nActualQuestion - 2)
                        {
                            pMsg.LastCorrectAnswer = 0;
                        }
                        pMsg.CurrentScore      = plrObj.Points;
                        pMsg.ExperienceAwarded = plrObj.Experience;
                        pMsg.TimeTakenTillNow  = plrObj.TimeTaken;
                        plrObj.LastQuestion    = m_nActualQuestion - 1;
                        plr.Send(pMsg);
                    }
                    if (m_nActualQuestion >= ServerKernel.QUIZ_MAX_QUESTION)
                    {
                        m_state = QuizState.ENDED;
                    }
                }

                if (m_state == QuizState.ENDED &&
                    m_pNextQuestion.ToNextTime())
                {
                    foreach (var usr in m_quizUserInformation.Values)
                    {
                        if (usr.LastQuestion < m_nActualQuestion)
                        {
                            usr.Points    += 1;
                            usr.TimeTaken += ServerKernel.QUIZ_TIME_PER_QUESTION;

                            Client pClient;
                            if (ServerKernel.Players.TryGetValue(usr.UserIdentity, out pClient))
                            {
                                var pMsg = new MsgQuiz
                                {
                                    Type         = QuizShowType.AFTER_REPLY,
                                    CurrentScore = usr.Points,
                                    TimeTaken    = usr.TimeTaken,
                                    Rank         = usr.Rank
                                };
                                var rank = RankingStrings();
                                pMsg.AddString(rank[0].Name, rank[0].Points, rank[0].TimeTaken);
                                pMsg.AddString(rank[1].Name, rank[1].Points, rank[1].TimeTaken);
                                pMsg.AddString(rank[2].Name, rank[2].Points, rank[2].TimeTaken);
                                pClient.Send(pMsg);
                            }
                        }

                        Client pUser = null;
                        if (ServerKernel.Players.TryGetValue(usr.UserIdentity, out pUser))
                        {
                            try
                            {
                                pUser.Character.QuizPoints += usr.Points;
                                int i = 0;
                                foreach (var tmp in m_quizUserInformation.Values.OrderByDescending(x => x.Points))
                                {
                                    if (i++ > 3)
                                    {
                                        break;
                                    }
                                    if (tmp.UserIdentity == usr.UserIdentity)
                                    {
                                        long amount =
                                            (ServerKernel.GetExpBallExperience(pUser.Character.Level) / 600) *
                                            ServerKernel.QUIZ_SHOW_AWARD[i - 1];
                                        pUser.Character.AwardExperience(amount);

                                        ushort emoney = ServerKernel.QUIZ_SHOW_EMONEY[i - 1];
                                        uint   money  = ServerKernel.QUIZ_SHOW_MONEY[i - 1];
                                        pUser.Character.AwardEmoney(emoney);
                                        pUser.Character.AwardMoney(money);
                                        pUser.Character.Send(
                                            string.Format("You awarded {0} CPs and {2} for winning on {1} place on Quiz Show.",
                                                          emoney, i, money));
                                    }
                                }

                                MsgQuiz pMsg = new MsgQuiz
                                {
                                    Type       = QuizShowType.FINISH_QUIZ,
                                    Score      = usr.Rank,
                                    Rank       = usr.TimeTaken,
                                    FirstPrize = usr.Points,
                                    FinalPrize = usr.Experience
                                };
                                QuizShowUserObject[] pList = RankingStrings();
                                pMsg.AddString(pList[0].Name, pList[0].Points, pList[0].TimeTaken);
                                pMsg.AddString(pList[1].Name, pList[1].Points, pList[1].TimeTaken);
                                pMsg.AddString(pList[2].Name, pList[2].Points, pList[2].TimeTaken);
                                pUser.Send(pMsg);
                            }
                            catch
                            {
                            }
                        }
                        else
                        {
                            try
                            {
                                // disconnected? still have prize to claim
                                DbUser dbObj = new CharacterRepository().SearchByIdentity(usr.UserIdentity);
                                if (dbObj == null)
                                {
                                    continue;
                                }

                                Character pTemp = new Character(null, dbObj, null);
                                pTemp.QuizPoints += usr.Points;

                                int i = 1;
                                foreach (var tmp in m_quizUserInformation.Values.OrderByDescending(x => x.Points))
                                {
                                    if (i++ > 3)
                                    {
                                        break;
                                    }
                                    if (tmp.UserIdentity == usr.UserIdentity)
                                    {
                                        long amount =
                                            (ServerKernel.GetExpBallExperience(pTemp.Level) / 600) *
                                            ServerKernel.QUIZ_SHOW_AWARD[i - 1];
                                        pTemp.AwardExperience(amount);
                                    }
                                }
                                pTemp.Save();
                                pTemp = null;
                            }
                            catch
                            {
                            }
                        }
                    }

                    ServerKernel.SendMessageToAll(ServerString.STR_QUIZ_SHOW_ENDED, ChatTone.TOP_LEFT);
                    m_state = QuizState.STOPPED;
                }
            }
        }
        public bool Add(Item item, bool isLogin = false)
        {
            ItemPosition pos = Calculations.GetItemPosition(item.Type);

            #region Sanity Checks

            if (!isLogin)
            {
                // Level check
                if (item.Itemtype.ReqLevel > m_pOwner.Level)
                {
                    return(false);
                }

                // Profession check
                if (m_pOwner.Metempsychosis > 0 &&
                    m_pOwner.Level >= 70 &&
                    item.Itemtype.ReqLevel <= 70)
                {
                }
                else
                {
                    if (item.Itemtype.ReqProfession > 0)
                    {
                        // item
                        int iProfession      = item.Itemtype.ReqProfession / 10;
                        int iProfessionLevel = item.Itemtype.ReqProfession % 10;

                        if (iProfession == 19)
                        {
                            iProfession = 10;
                        }

                        // user
                        int uProfession      = m_pOwner.Profession / 10;
                        int uProfessionLevel = m_pOwner.Profession % 10;

                        if (uProfession > 10 && iProfession == 10)
                        {
                            uProfession = 10;
                        }

                        if (iProfession == uProfession)
                        {
                            if (iProfessionLevel > uProfessionLevel)
                            {
                                return(false);
                            }
                        }
                        else
                        {
                            return(false);
                        }
                    }

                    // Attribute check
                    if (item.Itemtype.ReqForce != 0 &&
                        item.Itemtype.ReqForce > m_pOwner.Strength)
                    {
                        return(false);
                    }
                    if (item.Itemtype.ReqSpeed != 0 &&
                        item.Itemtype.ReqSpeed > m_pOwner.Agility)
                    {
                        return(false);
                    }
                    if (item.Itemtype.ReqHealth != 0 &&
                        item.Itemtype.ReqHealth > m_pOwner.Vitality)
                    {
                        return(false);
                    }
                    if (item.Itemtype.ReqSoul != 0 &&
                        item.Itemtype.ReqSoul > m_pOwner.Spirit)
                    {
                        return(false);
                    }

                    ushort type = (ushort)(item.Type / 1000);
                    if (pos == ItemPosition.RIGHT_HAND && !m_pOwner.WeaponSkill.Skills.ContainsKey(type) &&
                        item.Itemtype.ReqWeaponskill > 0)
                    {
                        return(false);
                    }

                    if (m_pOwner.WeaponSkill.Skills.ContainsKey(type))
                    {
                        if (pos == ItemPosition.RIGHT_HAND &&
                            m_pOwner.WeaponSkill.Skills[type].Level < item.Itemtype.ReqWeaponskill)
                        {
                            return(false);
                        }
                    }

                    if (type == 421 &&
                        item.Position < (ItemPosition)20 &&
                        Items.ContainsKey(ItemPosition.LEFT_HAND))
                    {
                        m_pOwner.Send("Please remove the equipment in your left hand first.");
                        return(false);
                    }

                    if (type == 900 &&
                        Items.ContainsKey(ItemPosition.RIGHT_HAND) &&
                        Items[ItemPosition.RIGHT_HAND].GetItemSubtype() == 421)
                    {
                        m_pOwner.Send("You cannot equip a shield while wearing a backsword.");
                        return(false);
                    }
                }

                // Gender check
                if (item.Itemtype.ReqSex != 0)
                {
                    if (item.Itemtype.ReqSex != m_pOwner.Gender)
                    {
                        return(false);
                    }
                }
            }

            ItemSort itemSort = item.GetSort();

            if ((itemSort == ItemSort.ITEMSORT_USABLE ||
                 itemSort == ItemSort.ITEMSORT_USABLE2 ||
                 itemSort == ItemSort.ITEMSORT_USABLE3) &&
                pos == ItemPosition.INVENTORY && item.Type / 1000 != 1050)
            {
                // Stores the item temporary data.
                m_pOwner.LastItemResource = 0;
                m_pOwner.LastUsedItem     = item.Identity;
                m_pOwner.LastUsedItemTime = (uint)UnixTimestamp.Timestamp();
                m_pOwner.LastUsedItemtype = item.Type;

                if ((item.Type >= 1000000 && item.Type < 1050000) || item.Type == 725065 || item.Type == 725066)
                // potion
                {
                    if (!m_pOwner.IsAlive)
                    {
                        m_pOwner.Send(ServerString.STR_NOT_ALIVE);
                        return(false);
                    }

                    if (item.Itemtype.Life > 0 && m_pOwner.QueryStatus(FlagInt.POISON_STAR) != null)
                    {
                        //m_pOwner.Send(ServerString.STR_CANT_HEAL_POISON_STAR);
                        return(false);
                    }

                    if (item.Itemtype.Life > 0 && m_pOwner.Life >= m_pOwner.MaxLife)
                    {
                        //m_pOwner.Send(ServerString.STR_YOUR_LIFE_FULL);
                        return(false); // return false so it wont spend processing recalculating the user stts
                    }

                    if (item.Itemtype.Mana > 0 && m_pOwner.Mana >= m_pOwner.MaxMana)
                    {
                        //m_pOwner.Send(ServerString.STR_YOUR_MANA_FULL);
                        return(false); // return false so it wont spend processing recalculating the user stts
                    }

                    if (m_pOwner.IsGm)
                    {
                        m_pOwner.FillLife();
                        m_pOwner.FillMana();
                        return(false);
                    }

                    if (m_pOwner.Inventory.Remove(item.Type, 1))
                    {
                        m_pOwner.AddAttribute(ClientUpdateType.HITPOINTS, item.Itemtype.Life, true);
                        m_pOwner.AddAttribute(ClientUpdateType.MANA, item.Itemtype.Mana, true);
                    }
                    return(false);
                }

                if (item.Type == SpecialItem.MEMORY_AGATE)
                {
                    item.SendCarry();
                    return(false);
                }

                if (item.Type == 723726)
                {
                    if (m_pOwner.Inventory.Remove(item.Type, 1))
                    {
                        m_pOwner.FillLife();
                        m_pOwner.FillMana();
                    }
                    return(false);
                }

                if (item.Type == 723790 && m_pOwner.Inventory.Remove(723790))
                {
                    m_pOwner.AddAttribute(ClientUpdateType.HITPOINTS, 500, true);
                    return(false);
                }

                if (item.Type == SpecialItem.TYPE_EXP_BALL || item.Type == 723834)
                {
                    if (m_pOwner.ExpBallAmount >= 10)
                    {
                        int nDayOfYear  = UnixTimestamp.ToDateTime(m_pOwner.LastUsedExpBall).DayOfYear;
                        int nDayOfYear2 = DateTime.Now.DayOfYear;
                        if (nDayOfYear == nDayOfYear2)
                        {
                            return(false);
                        }
                        m_pOwner.ExpBallAmount = 0;
                    }

                    if (m_pOwner.Inventory.Remove(item.Identity))
                    {
                        m_pOwner.ExpBallAmount   = (byte)(m_pOwner.ExpBallAmount + 1);
                        m_pOwner.LastUsedExpBall = (uint)UnixTimestamp.Timestamp();
                        m_pOwner.Save();
                        m_pOwner.AwardExperience(ServerKernel.GetExpBallExperience(m_pOwner.Level), true, true);
                    }
                    return(false);
                }

                if ((item.Type >= 1060020 && item.Type <= 1060039) || item.Type == 1060102)
                {
                    if (m_pOwner.Map.IsChgMapDisable())
                    {
                        return(false);
                    }
                    m_pOwner.Inventory.Remove(item.Identity);
                }
                else if (item.Type / 1000 == 1060)
                {
                    m_pOwner.Inventory.Remove(item.Identity);
                }

                m_pOwner.TaskItem = item;
                m_pOwner.GameAction.ProcessAction(item.Itemtype.IdAction, m_pOwner, null, item, null);
                return(false);
            }
            if (pos == ItemPosition.INVENTORY)
            {
                return(false);
            }

            if (pos == ItemPosition.LEFT_HAND &&
                itemSort == ItemSort.ITEMSORT_WEAPON_SHIELD)
            {
                if (Items.ContainsKey(ItemPosition.RIGHT_HAND) &&
                    Items[ItemPosition.RIGHT_HAND].GetSort() == ItemSort.ITEMSORT_WEAPON_DOUBLE_HAND)
                {
                    if (!m_pOwner.Magics.CheckType(10311))
                    {
                        return(false);
                    }
                }
                if (!Items.ContainsKey(ItemPosition.RIGHT_HAND))
                {
                    return(false);
                }
            }

            #endregion

            if (item.IsArrowSort())
            {
                item.Position = ItemPosition.LEFT_HAND;
            }

            switch (item.Position)
            {
            case ItemPosition.RIGHT_HAND:
                if (pos != ItemPosition.RIGHT_HAND ||
                    (itemSort != ItemSort.ITEMSORT_WEAPON_SINGLE_HAND &&
                     itemSort != ItemSort.ITEMSORT_WEAPON_DOUBLE_HAND &&
                     itemSort != ItemSort.ITEMSORT_WEAPON_SINGLE_HAND2))
                {
                    item.Position = 0;
                    return(false);
                }

                if ((itemSort == ItemSort.ITEMSORT_WEAPON_DOUBLE_HAND &&
                     Items.ContainsKey(ItemPosition.LEFT_HAND)))
                {
                    Remove(ItemPosition.LEFT_HAND);
                }

                if (Items.ContainsKey(ItemPosition.RIGHT_HAND) && item.Position == ItemPosition.RIGHT_HAND)
                {
                    Remove(ItemPosition.RIGHT_HAND, ItemRemoveMethod.REMOVE_TO_INVENTORY);
                }
                break;

            case ItemPosition.LEFT_HAND:
                if (itemSort != ItemSort.ITEMSORT_WEAPON_SINGLE_HAND &&
                    itemSort != ItemSort.ITEMSORT_WEAPON_SHIELD &&
                    itemSort != ItemSort.ITEMSORT_WEAPON_SINGLE_HAND2 &&
                    item.Type / 1000 != 1050)
                {
                    item.Position = 0;
                    return(false);
                }

                if (m_pOwner.Profession >= 100)
                {
                    if (Items.ContainsKey(ItemPosition.LEFT_HAND) && Items[ItemPosition.LEFT_HAND] == item)
                    {
                        Remove(ItemPosition.LEFT_HAND, ItemRemoveMethod.REMOVE_TO_INVENTORY);
                    }

                    item.Position = 0;
                    return(false);
                }

                if (item.IsArrowSort() &&
                    (!Items.ContainsKey(ItemPosition.RIGHT_HAND) ||
                     !Items[ItemPosition.RIGHT_HAND].IsBow()))
                {
                    item.Position = 0;
                    return(false);
                }

                if (Items.ContainsKey(ItemPosition.LEFT_HAND))
                {
                    Remove(ItemPosition.LEFT_HAND, ItemRemoveMethod.REMOVE_TO_INVENTORY);
                }
                break;

            case ItemPosition.ACCESSORY_R:
            {
                if ((itemSort != ItemSort.ITEMSORT_ACCESSORY) ||
                    item.Type / 10000 == 38)
                {
                    item.Position = 0;
                    return(false);
                }

                switch (item.Type / 10000)
                {
                case 38:
                    item.Position = 0;
                    return(false);
                }

                if (Items.ContainsKey(ItemPosition.ACCESSORY_R))
                {
                    Remove(ItemPosition.ACCESSORY_R);
                }
                break;
            }

            case ItemPosition.ACCESSORY_L:
            {
                if (itemSort != ItemSort.ITEMSORT_ACCESSORY || item.Type / 10000 == 37)
                {
                    item.Position = 0;
                    return(false);
                }

                switch (item.Type / 10000)
                {
                case 37:
                    item.Position = 0;
                    return(false);
                }

                if (Items.ContainsKey(ItemPosition.ACCESSORY_L))
                {
                    Remove(ItemPosition.ACCESSORY_L);
                }
                break;
            }

            default:
                if (pos == item.Position &&
                    Items.ContainsKey(item.Position))
                {
                    Remove(item.Position);
                }
                else if (pos != item.Position)
                {
                    if (item.Position < ItemPosition.ALT_HEAD && pos != item.Position)
                    {
                        item.Position = 0;
                        return(false);
                    }
                    if (item.Position >= ItemPosition.ALT_HEAD && item.Position <= ItemPosition.ALT_STEED)
                    {
                        switch (item.Position)
                        {
                        case ItemPosition.ALT_HEAD:
                        {
                            if (pos != ItemPosition.HEADWEAR)
                            {
                                return(false);
                            }
                            break;
                        }

                        case ItemPosition.ALT_NECKLACE:
                        {
                            if (pos != ItemPosition.NECKLACE)
                            {
                                return(false);
                            }
                            break;
                        }

                        case ItemPosition.ALT_RING:
                        {
                            if (pos != ItemPosition.RING)
                            {
                                return(false);
                            }
                            break;
                        }

                        case ItemPosition.ALT_WEAPON_R:
                        {
                            if (pos != ItemPosition.RIGHT_HAND)
                            {
                                return(false);
                            }
                            break;
                        }

                        case ItemPosition.ALT_WEAPON_L:
                        {
                            if (pos != ItemPosition.LEFT_HAND && pos != ItemPosition.RIGHT_HAND)
                            {
                                return(false);
                            }
                            break;
                        }

                        case ItemPosition.ALT_ARMOR:
                        {
                            if (pos != ItemPosition.ARMOR)
                            {
                                return(false);
                            }
                            break;
                        }

                        case ItemPosition.ALT_BOOTS:
                        {
                            if (pos != ItemPosition.BOOTS)
                            {
                                return(false);
                            }
                            break;
                        }

                        case ItemPosition.ALT_BOTTLE:
                        {
                            if (pos != ItemPosition.BOTTLE)
                            {
                                return(false);
                            }
                            break;
                        }

                        case ItemPosition.ALT_GARMENT:
                        {
                            if (pos != ItemPosition.GARMENT)
                            {
                                return(false);
                            }
                            break;
                        }

                        default:
                            item.Position = 0;
                            return(false);
                        }

                        if (Items.ContainsKey(item.Position) && Items.Count >= 40)
                        {
                            item.Position = 0;
                            return(false);
                        }
                        if (Items.ContainsKey(item.Position))
                        {
                            Remove(item.Position);
                        }
                    }
                    else
                    {
                        item.Position = 0;
                        return(false);
                    }
                }
                break;
            }

            var itemEquip = new MsgItem
            {
                Identity = item.Identity,
                Action   = ItemAction.EQUIP,
                Param1   = (uint)item.Position
            };

            // We build the item information packet
            MsgItemInformation itemInfo = item.InformationPacket(!isLogin);

            // If we are logging in, we set this as default, because the item hasnt been
            // created yet, otherwise, we send this as an update.
            if (isLogin)
            {
                itemInfo.ItemMode = ItemMode.DEFAULT;
                m_pOwner.Send(itemInfo);
            }
            else
            {
                //itemInfo.ItemMode = ItemMode.Update;
                if (!m_pOwner.Inventory.Contains(item.Identity))
                {
                    return(false);
                }
                Item trash;
                m_pOwner.Inventory.Items.TryRemove(item.Identity, out trash);
                item.Save();
                m_pOwner.RecalculateAttributes();
            }

            m_pOwner.Send(itemEquip);
            Items.TryAdd(item.Position, item);
            SendEquipedItems();
            item.SendPurification();
            item.TryUnlockItem();
            item.SendItemLockTime();

            switch (item.Position)
            {
            case ItemPosition.HEADWEAR:
                m_pOwner.Helmet      = item.Type;
                m_pOwner.HelmetColor = (ushort)item.Color;
                break;

            case ItemPosition.ARMOR:
                m_pOwner.Armor      = item.Type;
                m_pOwner.ArmorColor = (ushort)item.Color;
                break;

            case ItemPosition.LEFT_HAND:
                m_pOwner.LeftHand    = item.Type;
                m_pOwner.ShieldColor = (ushort)item.Color;
                break;

            case ItemPosition.RIGHT_HAND:
                m_pOwner.RightHand = item.Type;
                break;

            case ItemPosition.GARMENT:
                m_pOwner.Garment = item.Type;
                break;

            case ItemPosition.ACCESSORY_R:
                m_pOwner.RightAccessory = item.Type;
                break;

            case ItemPosition.ACCESSORY_L:
                m_pOwner.LeftAccessory = item.Type;
                break;

            case ItemPosition.STEED:
                m_pOwner.MountType  = item.Type;
                m_pOwner.MountColor = item.SocketProgress;
                m_pOwner.MountPlus  = item.Plus;
                break;

            case ItemPosition.STEED_ARMOR:
                m_pOwner.MountArmor = item.Type;
                break;
            }

            return(true);
        }
        /// <summary>
        /// On this method the user will award it's prize every question.
        /// </summary>
        public bool UserAnswer(Character pRole, ushort nQuestion, ushort nReply)
        {
            try
            {
                if (m_state <= QuizState.STOPPED || m_state >= QuizState.ENDED)
                {
                    return(false);
                }

                QuizShowUserObject plrObj = null;

                if (!m_quizUserInformation.ContainsKey(pRole.Identity))
                {
                    plrObj = new QuizShowUserObject
                    {
                        Experience   = 0,
                        Name         = pRole.Name,
                        Points       = 0,
                        TimeTaken    = 0,
                        UserIdentity = pRole.Identity,
                        LastQuestion = nQuestion
                    };
                    m_quizUserInformation.Add(pRole.Identity, plrObj);
                }

                plrObj = m_quizUserInformation[pRole.Identity];

                if (plrObj.LastQuestion == nQuestion)
                {
                    return(false); // player already answered
                }
                int expBallAmount = 0;
                var pQuestion     = m_temporaryQuestions[nQuestion - 1];
                if (pQuestion.Correct == nReply)
                {
                    expBallAmount = (ServerKernel.QUIZ_MAX_EXPERIENCE / ServerKernel.QUIZ_MAX_QUESTION);
                    pRole.AwardExperience(
                        (ServerKernel.GetExpBallExperience(pRole.Level) / 600)
                        // gets the exp and divides by 600
                        * expBallAmount);
                    // multiply by the correct answer tax
                    plrObj.Points += (ushort)(m_pNextQuestion.GetRemain());
                }
                else
                {
                    expBallAmount = (ServerKernel.QUIZ_MAX_EXPERIENCE / (ServerKernel.QUIZ_MAX_QUESTION * 4));
                    pRole.AwardExperience(
                        (ServerKernel.GetExpBallExperience(pRole.Level) / 600)
                        // gets the exp and divides by 600
                        * expBallAmount);
                    // multiply by the correct answer tax
                    plrObj.Points += 1;
                }

                plrObj.TimeTaken   += (ushort)((m_pNextQuestion.GetRemain() - ServerKernel.QUIZ_TIME_PER_QUESTION) * -1);
                plrObj.Experience  += (ushort)expBallAmount;
                plrObj.LastQuestion = nQuestion - 1;

                var pMsg = new MsgQuiz
                {
                    Type         = QuizShowType.AFTER_REPLY,
                    CurrentScore = plrObj.Points,
                    TimeTaken    = plrObj.TimeTaken,
                    Rank         = plrObj.Rank
                };
                var rank = RankingStrings();
                pMsg.AddString(rank[0].Name, rank[0].Points, rank[0].TimeTaken);
                pMsg.AddString(rank[1].Name, rank[1].Points, rank[1].TimeTaken);
                pMsg.AddString(rank[2].Name, rank[2].Points, rank[2].TimeTaken);
                pRole.Send(pMsg);
                return(true);
            }
            catch
            {
                // should not happen
                ServerKernel.Log.SaveLog("Could not add reward to user on Quiz Show", true, "quiz", LogType.ERROR);
            }
            return(false);
        }