/// <summary> /// Tries to hand out the rewards, archives this quest and sends details about the next quest in the chain (if any). /// </summary> /// <param name="qHolder"></param> /// <param name="rewardSlot"></param> public bool TryFinish(IQuestHolder qHolder, uint rewardSlot) { Character owner = m_Log.Owner; owner.OnInteract(qHolder as WorldObject); if (qHolder is WorldObject && !owner.IsInRadius((WorldObject)qHolder, NPCMgr.DefaultInteractionDistance)) { NPCHandler.SendNPCError(owner, qHolder, VendorInventoryError.TooFarAway); return(false); } if (!Template.TryGiveRewards(m_Log.Owner, qHolder, rewardSlot)) { return(false); } ArchiveQuest(); QuestHandler.SendComplete(Template, owner); if (Template.FollowupQuestId != 0U) { QuestTemplate template = QuestMgr.GetTemplate(Template.FollowupQuestId); if (template != null && qHolder.QuestHolderInfo.QuestStarts.Contains(template)) { QuestHandler.SendDetails(qHolder, template, owner, true); if (template.Flags.HasFlag(QuestFlags.AutoAccept)) { owner.QuestLog.TryAddQuest(template, qHolder); } } } if (!Template.Repeatable) { owner.Achievements.CheckPossibleAchievementUpdates(AchievementCriteriaType.CompleteQuestCount, 1U, 0U, null); owner.Achievements.CheckPossibleAchievementUpdates(AchievementCriteriaType.CompleteQuest, Entry, 0U, null); if (Template.ZoneTemplate != null) { owner.Achievements.CheckPossibleAchievementUpdates(AchievementCriteriaType.CompleteQuestsInZone, (uint)Template.ZoneTemplate.Id, 0U, null); } } if (Template.IsDaily) { owner.Achievements.CheckPossibleAchievementUpdates(AchievementCriteriaType.CompleteDailyQuest, 1U, 0U, null); } return(true); }
/// <summary> /// Tries to hand out the rewards, archives this quest and sends details about the next quest in the chain (if any). /// </summary> /// <param name="qHolder"></param> /// <param name="rewardSlot"></param> public bool TryFinish(IQuestHolder qHolder, uint rewardSlot) { var chr = m_Log.Owner; chr.OnInteract(qHolder as WorldObject); if (qHolder is WorldObject && !chr.IsInRadius((WorldObject)qHolder, NPCMgr.DefaultInteractionDistance)) { NPCHandler.SendNPCError(chr, qHolder, VendorInventoryError.TooFarAway); return(false); } if (Template.TryGiveRewards(m_Log.Owner, qHolder, rewardSlot)) { ArchiveQuest(); QuestHandler.SendComplete(Template, chr); if (Template.FollowupQuestId != 0) { var nq = QuestMgr.GetTemplate(Template.FollowupQuestId); if (nq != null && qHolder.QuestHolderInfo.QuestStarts.Contains(nq)) { // Offer the next Quest if its also offered by the same QuestGiver QuestHandler.SendDetails(qHolder, nq, chr, true); if (nq.Flags.HasFlag(QuestFlags.AutoAccept)) { chr.QuestLog.TryAddQuest(nq, qHolder); } } } if (!Template.Repeatable) { chr.Achievements.CheckPossibleAchievementUpdates(AchievementCriteriaType.CompleteQuestCount, 1); chr.Achievements.CheckPossibleAchievementUpdates(AchievementCriteriaType.CompleteQuest, Entry); if (Template.ZoneTemplate != null) { chr.Achievements.CheckPossibleAchievementUpdates(AchievementCriteriaType.CompleteQuestsInZone, (uint)Template.ZoneTemplate.Id); } } if (Template.IsDaily) { chr.Achievements.CheckPossibleAchievementUpdates(AchievementCriteriaType.CompleteDailyQuest, 1); } return(true); } return(false); }
public override void Process(CmdTrigger <RealmServerCmdArgs> trigger) { var qt = QuestMgr.GetTemplate(trigger.Text.NextUInt()); if (qt != null) { var questReceiver = trigger.Args.Character.Target as Character; if (questReceiver != null) { QuestHandler.SendComplete(qt, questReceiver); } } trigger.Reply("Done."); }
public override void Process(CmdTrigger <RealmServerCmdArgs> trigger) { QuestTemplate template = QuestMgr.GetTemplate(trigger.Text.NextUInt()); if (template != null) { Character target = trigger.Args.Character.Target as Character; if (target != null) { QuestHandler.SendComplete(template, target); } } trigger.Reply("Done."); }
private static void AutoComplete(Quest quest, Character chr) { quest.CompleteStatus = QuestCompleteStatus.Completed; QuestHandler.SendComplete(quest.Template, chr); QuestHandler.SendQuestGiverOfferReward(chr, quest.Template, chr); }