示例#1
0
        public QAndAGump(Mobile owner, BaseQuest quest) : base(0, 0)
        {
            m_From     = owner;
            m_Quest    = quest;
            Closable   = false;
            Disposable = false;

            foreach (BaseObjective objective in quest.Objectives)
            {
                if (objective is QuestionAndAnswerObjective)
                {
                    m_Objective = (QuestionAndAnswerObjective)objective;
                    break;
                }
            }

            if (m_Objective == null)
            {
                return;
            }

            QuestionAndAnswerEntry entry = m_Objective.GetRandomQandA();

            if (entry == null)
            {
                return;
            }

            AddPage(0);
            AddImage(0, 0, 1228);
            AddImage(40, 78, 95);
            AddImageTiled(49, 87, 301, 3, 96);
            AddImage(350, 78, 97);

            object answer = entry.Answers[Utility.Random(entry.Answers.Length)];

            List <object> selections = new List <object>(entry.WrongAnswers);

            m_Index = Utility.Random(selections.Count);             //Gets correct answer
            selections.Insert(m_Index, answer);

            //AddHtmlLocalized(40, 40, 320, 40, entry.Question, FontColor, false, false); //question
            AddLabel(40, 40, FontColor, entry.Question);

            for (int i = 0; i < selections.Count; i++)
            {
                object selection = selections[i];

                AddButton(49, 104 + (i * 40), 2224, 2224, selection == answer ? 1 : 0, GumpButtonType.Reply, 0);

                if (selection is int)
                {
                    AddHtmlLocalized(80, 102 + (i * 40), 200, 18, (int)selection, 0x0, false, false);
                }
                else
                {
                    AddHtml(80, 102 + (i * 40), 200, 18, String.Format("<BASEFONT COLOR=#{0:X6}>{1}</BASEFONT>", FontColor, selection), false, false);
                }
            }
        }
示例#2
0
 public static void Configure()
 {
     m_EntryTable[0]  = new QuestionAndAnswerEntry(1151329, new object[] { 1151330 }, new object[] { 1151331, 1151332 });          //At what age does an oak tree begin to produce acorns?
     m_EntryTable[1]  = new QuestionAndAnswerEntry(1151333, new object[] { 1151337 }, new object[] { 1151334, 1151335, 1151336 }); //What is the process called in which a tree evaporates water through its leaves?
     m_EntryTable[2]  = new QuestionAndAnswerEntry(1151338, new object[] { 1151341 }, new object[] { 1151339, 1151340, 1151342 }); //What is the average lifespan of an oak tree?
     m_EntryTable[3]  = new QuestionAndAnswerEntry(1151343, new object[] { 1151347 }, new object[] { 1151344, 1151345, 1151346 }); //Of which family of trees is an oak?
     m_EntryTable[4]  = new QuestionAndAnswerEntry(1151348, new object[] { 1151349 }, new object[] { 1151350, 1151351, 1151352 }); //What is unique about pine trees?
     m_EntryTable[5]  = new QuestionAndAnswerEntry(1151353, new object[] { 1151356 }, new object[] { 1151354, 1151357, 1151358 }); //What is a pomaceous fruit?
     m_EntryTable[6]  = new QuestionAndAnswerEntry(1151359, new object[] { 1151362 }, new object[] { 1151360, 1151361, 1151363 }); //This plant is known as ‘deadly nightshade:’
     m_EntryTable[7]  = new QuestionAndAnswerEntry(1151364, new object[] { 1151360 }, new object[] { 1151361, 1151363, 1151365 }); //Which of the following plants possesses a fruit that is extremely poisonous and shaped like a spiked ball?
     m_EntryTable[8]  = new QuestionAndAnswerEntry(1151366, new object[] { 1151369 }, new object[] { 1151367, 1151368, 1151370 }); //Which is the species of flower that produces vanilla?
     m_EntryTable[9]  = new QuestionAndAnswerEntry(1151371, new object[] { 1151372 }, new object[] { 1151373 });                   //A notch in the trunk of a tree will stay the same distance from the ground as the tree grows in height; true or false?
     m_EntryTable[10] = new QuestionAndAnswerEntry(1151374, new object[] { 1151375 }, new object[] { 1151376, 1151377, 1151378 }); //Which tree type is called the ‘axe breaker?’
     m_EntryTable[11] = new QuestionAndAnswerEntry(1151379, new object[] { 1151382 }, new object[] { 1151380, 1151381, 1151383 }); //Which commonly consumed vegetable can also to be used medicinally to treat burns, bee stings, and infections?
 }
示例#3
0
        public QAndAGump(Mobile owner, BaseQuest quest)
            : base(160, 100)
        {
            m_From     = owner;
            m_Quest    = quest;
            Closable   = false;
            Disposable = false;

            foreach (BaseObjective objective in quest.Objectives)
            {
                if (objective is QuestionAndAnswerObjective answerObjective)
                {
                    m_Objective = answerObjective;
                    break;
                }
            }

            if (m_Objective == null)
            {
                return;
            }

            QuestionAndAnswerEntry entry = m_Objective.GetRandomQandA();

            if (entry == null)
            {
                return;
            }

            AddImage(0, 0, 0x4CC);
            AddImage(40, 78, 0x5F);
            AddImageTiled(49, 87, 301, 3, 0x60);
            AddImage(350, 78, 0x61);

            object answer = entry.Answers[Utility.Random(entry.Answers.Length)];

            List <object> selections = new List <object>(entry.WrongAnswers);

            m_Index = Utility.Random(selections.Count); //Gets correct answer
            selections.Insert(m_Index, answer);

            AddHtmlLocalized(30, 40, 340, 36, entry.Question, 0x0, false, false); //question

            for (int i = 0; i < selections.Count; i++)
            {
                object selection = selections[i];

                AddImage(50, 112 + (i * 32), 0x8B0);

                AddButton(49, 111 + (i * 32), 2224, 2224, selection == answer ? 1 : 0, GumpButtonType.Reply, 0);

                if (selection is int iSelection)
                {
                    AddHtmlLocalized(80, 109 + (i * 32), 275, 36, iSelection, 0x0, false, false);
                }
                else
                {
                    AddHtml(80, 109 + (i * 32), 275, 36, string.Format("<BASEFONT COLOR=#{0:X6}>{1}</BASEFONT>", 0x0, selection), false, false);
                }
            }
        }
示例#4
0
        public QAndAGump(Mobile owner, BaseQuest quest) : base(50, 50)
        {
            m_From        = owner;
            m_Quest       = quest;
            this.Closable = false;

            foreach (BaseObjective objective in quest.Objectives)
            {
                if (objective is QuestionAndAnswerObjective)
                {
                    m_Objective = (QuestionAndAnswerObjective)objective;
                    break;
                }
            }

            if (m_Objective == null)
            {
                return;
            }

            QuestionAndAnswerEntry entry = m_Objective.GetRandomQandA();

            if (entry == null)
            {
                return;
            }

            AddPage(0);

            int    question = entry.Question;
            object answer   = entry.Answers[Utility.Random(entry.Answers.Length)];

            List <object> selections = new List <object>(entry.WrongAnswers);

            m_Index = Utility.Random(selections.Count); //Gets correct answer
            selections.Insert(m_Index, answer);

            AddBackground(0, 0, 305, 145 + (selections.Count * 35), 9270);
            AddHtmlLocalized(104, 25, 200, 26, (int)m_Quest.Title, FontColor, false, false); //La Insep Om
            AddHtmlLocalized(20, 55, 250, 36, question, FontColor, false, false);            //question

            int y = 105;

            for (int i = 0; i < selections.Count; i++)
            {
                //AddButton(82, y, 2152, 2153, i + 1, GumpButtonType.Reply, 0);
                AddRadio(20, y, 2152, 2153, false, i + 1);

                object selection = selections[i];

                if (selection is int)
                {
                    AddHtmlLocalized(70, y - 2, 200, 18, (int)selection, FontColor, false, false);
                }
                else
                {
                    AddHtml(70, y - 2, 200, 18, String.Format("<BASEFONT COLOR=#{0:X6}>{1}</BASEFONT>", FontColor, selections[i]), false, false);
                }

                y += 35;
            }

            AddButton(129, y, 2074, 2076, 1, GumpButtonType.Reply, 0);
        }