当前位置: 首页>>代码示例>>C#>>正文


C# Quest.GetResult方法代码示例

本文整理汇总了C#中Aura.Channel.World.Quests.Quest.GetResult方法的典型用法代码示例。如果您正苦于以下问题:C# Quest.GetResult方法的具体用法?C# Quest.GetResult怎么用?C# Quest.GetResult使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Aura.Channel.World.Quests.Quest的用法示例。


在下文中一共展示了Quest.GetResult方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: EndQuest

		/// <summary>
		/// Completes and removes quest, if it exists, giving the rewards
		/// in the process, if warranted.
		/// </summary>
		/// <param name="quest"></param>
		/// <param name="rewardGroup">Reward group to use, set to -1 for no rewards.</param>
		/// <param name="owl">Show owl delivering the rewards?</param>
		/// <returns></returns>
		private bool EndQuest(Quest quest, int rewardGroup, bool owl)
		{
			var result = quest.GetResult();

			// Increase PTJ done/success
			if (quest.Data.Type == QuestType.Deliver)
				this.ModifyPtjTrackRecord(quest.Data.PtjType, +1, (result == QuestResult.Perfect ? +1 : 0));

			// Rewards
			if (rewardGroup != -1)
			{
				var rewards = quest.Data.GetRewards(rewardGroup, result);
				if (rewards.Count == 0)
					Log.Warning("CreatureQuests.EndQuest: No rewards for group '{0}' at result '{1}' in quest '{2}'.", rewardGroup, result, quest.Id);
				else
					this.GiveRewards(quest, rewards, owl);
			}

			// Remove from quest log.
			Send.QuestClear(_creature, quest.UniqueId);

			// Update PTJ stuff and stop clock
			if (quest.Data.Type == QuestType.Deliver)
			{
				var record = this.GetPtjTrackRecord(quest.Data.PtjType);

				Send.QuestUpdatePtj(_creature, quest.Data.PtjType, record.Done, record.Success);
				Send.QuestEndPtj(_creature);
			}

			return true;
		}
开发者ID:tkiapril,项目名称:aura,代码行数:40,代码来源:CreatureQuests.cs


注:本文中的Aura.Channel.World.Quests.Quest.GetResult方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。