Ejemplo n.º 1
0
        private void TaskDetailsPageResponses(int responseID)
        {
            var player = GetPC();
            var npc    = GetDialogTarget();
            var model  = GetDialogCustomData <Model>();
            var task   = DataService.GuildTask.GetByID(model.TaskID);

            switch (responseID)
            {
            case 1:     // Accept Task
                QuestService.AcceptQuest(player, npc, task.QuestID);
                LoadTaskDetailsPage();
                LoadTaskListPage();
                break;

            case 2:     // Give Report
                HandleGiveReport(player, task.QuestID);
                break;
            }
        }
Ejemplo n.º 2
0
        public static bool Check(params object[] args)
        {
            using (new Profiler(nameof(QuestAccept)))
            {
                int      index   = (int)args[0];
                NWPlayer player  = _.GetPCSpeaker();
                NWObject talkTo  = Object.OBJECT_SELF;
                int      questID = talkTo.GetLocalInt("QUEST_ID_" + index);
                if (questID <= 0)
                {
                    questID = talkTo.GetLocalInt("QST_ID_" + index);
                }

                if (DataService.GetAll <Data.Entity.Quest>().All(x => x.ID != questID))
                {
                    _.SpeakString("ERROR: Quest #" + index + " is improperly configured. Please notify an admin");
                    return(false);
                }
                QuestService.AcceptQuest(player, talkTo, questID);
            }
            return(true);
        }