private void LoadTaskDetailsPage() { var player = GetPC(); var model = GetDialogCustomData <Model>(); var task = DataService.GuildTask.GetByID(model.TaskID); var quest = QuestService.GetQuestByID(task.QuestID); var status = DataService.PCQuestStatus.GetByPlayerAndQuestIDOrDefault(player.GlobalID, task.QuestID); bool showQuestAccept = status == null || status.CompletionDate != null; // Never accepted, or has already been completed once. bool showGiveReport = status != null && status.CompletionDate == null; // Accepted, but not completed. var gpRewards = quest.GetRewards().Where(x => x.GetType() == typeof(QuestGPReward)).Cast <QuestGPReward>(); var goldRewards = quest.GetRewards().Where(x => x.GetType() == typeof(QuestGoldReward)).Cast <QuestGoldReward>(); int gpAmount = 0; int goldAmount = 0; foreach (var gpReward in gpRewards) { gpAmount += GuildService.CalculateGPReward(player, gpReward.Guild, gpReward.Amount); } foreach (var goldReward in goldRewards) { goldAmount += goldReward.Amount; } string header = ColorTokenService.Green("Task: ") + quest.Name + "\n\n"; header += "Rewards:\n\n"; header += ColorTokenService.Green("Credits: ") + goldAmount + "\n"; header += ColorTokenService.Green("Guild Points: ") + gpAmount; SetPageHeader("TaskDetailsPage", header); SetResponseVisible("TaskDetailsPage", 1, showQuestAccept); SetResponseVisible("TaskDetailsPage", 2, showGiveReport); }