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


C# GamePlayer.HasFinishedQuest方法代码示例

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


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

示例1: CanShowOneQuest

		/// <summary>
		/// Check if the npc can show a quest indicator to a player
		/// Checks both scripted and data quests
		/// </summary>
		/// <param name="player">The player to check</param>
		/// <returns>true if yes, false if the npc can give any quest</returns>
		public bool CanShowOneQuest(GamePlayer player)
		{
			// Scripted quests
			lock (m_questListToGive.SyncRoot)
			{
				foreach (AbstractQuest q in m_questListToGive)
				{
					Type questType = q.GetType();
					int doingQuest = (player.IsDoingQuest(questType) != null ? 1 : 0);
					if (q.CheckQuestQualification(player) && player.HasFinishedQuest(questType) + doingQuest < q.MaxQuestCount)
						return true;
				}
			}

			// Data driven quests
			lock (m_dataQuests)
			{
				foreach (DataQuest quest in DataQuestList)
				{
					if (quest.ShowIndicator &&
                        quest.CheckQuestQualification(player))
					{
						return true;
					}
				}
			}

			return false;
		}
开发者ID:dudemanvox,项目名称:Dawn-of-Light-Server,代码行数:35,代码来源:GameNPC.cs

示例2: GrantArtifactCredit

		/// <summary>
		/// Grant credit for an artifact.
		/// </summary>
		/// <param name="player"></param>
		/// <param name="artifactID"></param>
		/// <returns></returns>
		public static bool GrantArtifactCredit(GamePlayer player, String artifactID)
		{
			if (player == null || artifactID == null)
				return false;

			if (!player.CanReceiveArtifact(artifactID))
				return false;

			Artifact artifact;
			lock (m_artifacts)
			{
				if (!m_artifacts.ContainsKey(artifactID))
					return false;
				artifact = m_artifacts[artifactID];
			}

			if (artifact == null)
				return false;

			Type encounterType = GetQuestType(artifact.EncounterID);
			if (encounterType == null)
				return false;

			Type artifactQuestType = GetQuestType(artifact.QuestID);
			if (artifactQuestType == null)
				return false;

			if (player.HasFinishedQuest(encounterType) > 0 ||
			    player.HasFinishedQuest(artifactQuestType) > 0)
				return false;

			AbstractQuest quest = (AbstractQuest)(System.Activator.CreateInstance(encounterType,
			                                                                      new object[] { player }));

			if (quest == null)
				return false;

			quest.FinishQuest();
			return true;
		}
开发者ID:mynew4,项目名称:DAoC,代码行数:46,代码来源:ArtifactMgr.cs

示例3: CanGiveQuest

		/// <summary>
		/// Check if the npc can give the specified quest to a player
		/// Used for scripted quests
		/// </summary>
		/// <param name="questType">The type of the quest</param>
		/// <param name="player">The player who search a quest</param>
		/// <returns>the number of time the quest can be done again</returns>
		public int CanGiveQuest(Type questType, GamePlayer player)
		{
			lock (m_questListToGive.SyncRoot)
			{
				foreach (AbstractQuest q in m_questListToGive)
				{
					if (q.GetType().Equals(questType) && q.CheckQuestQualification(player) && player.HasFinishedQuest(questType) < q.MaxQuestCount)
					{
						return q.MaxQuestCount - player.HasFinishedQuest(questType);
					}
				}
			}
			return 0;
		}
开发者ID:dudemanvox,项目名称:Dawn-of-Light-Server,代码行数:21,代码来源:GameNPC.cs

示例4: SetQuestIndicator

		/// <summary>
		/// Return the proper indicator for quest
		/// TODO: check when finish indicator is set
		/// * when you have done the NPC quest
		/// * when you are at the last step
		/// </summary>
		/// <param name="questType">Type of quest</param>
		/// <param name="player">player requesting the quest</param>
		/// <returns></returns>
		public eQuestIndicator SetQuestIndicator(Type questType, GamePlayer player)
		{
			if (CanShowOneQuest(player)) return eQuestIndicator.Available;
			if (player.HasFinishedQuest(questType)>0) return eQuestIndicator.Finish;
			return eQuestIndicator.None;
		}
开发者ID:dudemanvox,项目名称:Dawn-of-Light-Server,代码行数:15,代码来源:GameNPC.cs

示例5: CheckQuestQualification

        /// <summary>
        /// This method checks if a player qualifies for this quest
        /// </summary>
        /// <returns>true if qualified, false if not</returns>
        public override bool CheckQuestQualification(GamePlayer player)
        {
            // We're not going to offer this quest if the player is already on it...

            if (player.IsDoingQuest(this.GetType()) != null)
                return false;

            // ...nor will we let him do it again.

            if (player.HasFinishedQuest(this.GetType()) > 0)
                return false;

            // Also, he needs to finish another quest first.

            if (player.HasFinishedQuest(typeof(NoHopeForTheHopeful)) <= 0)
                return false;

            // This checks below are only performed is player isn't doing quest already

            if (player.Level < minimumLevel || player.Level > maximumLevel)
                return false;

            return true;
        }
开发者ID:mynew4,项目名称:DOLSharp,代码行数:28,代码来源:DredgeUpAPledge.cs

示例6: CheckQuestQualification

        /// <summary>
        /// This method checks if a player qualifies for this quest
        /// </summary>
        /// <returns>true if qualified, false if not</returns>
        public override bool CheckQuestQualification(GamePlayer player)
        {
            // if the player is already doing the quest his level is no longer of relevance
            if (player.IsDoingQuest(typeof (Collection)) != null)
                return true;

            // This checks below are only performed is player isn't doing quest already
            if (player.HasFinishedQuest(typeof (Frontiers)) == 0)
                return false;

            if (!CheckPartAccessible(player, typeof (Collection)))
                return false;

            if (player.Level < minimumLevel || player.Level > maximumLevel)
                return false;

            return true;
        }
开发者ID:mynew4,项目名称:DAoC,代码行数:22,代码来源:Collection.cs

示例7: OnDestinationPicked

		/// <summary>
		/// Player has picked a destination.
		/// </summary>
		/// <param name="player"></param>
		/// <param name="destination"></param>
		protected override void OnDestinationPicked(GamePlayer player, Teleport destination)
		{
			switch (destination.TeleportID.ToLower())
			{
				case "battlegrounds":
					if (!ServerProperties.Properties.BG_ZONES_OPENED && player.Client.Account.PrivLevel == (uint)ePrivLevel.Player)
					{
						SayTo(player, ServerProperties.Properties.BG_ZONES_CLOSED_MESSAGE);
						return;
					}
					SayTo(player, "I will teleport you to the appropriate battleground for your level and Realm Rank. If you exceed the Realm Rank for a battleground, you will not teleport. Please gain more experience to go to the next battleground.");
					break;
				case "bjarken":
					break;	// No text?
				case "city of aegirhamn":
					SayTo(player, "The Shrouded Isles await you.");
					break;
				case "entrance":
					break;	// No text?
				case "gotar":
					SayTo(player, "You shall soon arrive in the Gotar.");
					break;
				case "hagall":
					break;	// No text?
				case "jordheim":
					SayTo(player, "The great city awaits!");
					break;
				case "knarr":
					break;	// No text?
				case "kobold undercity":
					if (player.HasFinishedQuest(typeof(KoboldUndercity)) <= 0)
					{
						SayTo(player, String.Format("I may only send those who know the way to this {0} {1}",
						                            "city. Seek out the path to the city and in future times I will aid you in",
						                            "this journey."));
						return;
					}
					break;
				case "oceanus":
					if (player.Client.Account.PrivLevel < ServerProperties.Properties.ATLANTIS_TELEPORT_PLVL)
					{
						SayTo(player, "I'm sorry, but you are not authorized to enter Atlantis at this time.");
						return;
					}
					SayTo(player, "You will soon arrive in the Haven of Oceanus.");
					break;
				case "personal":
					break;
				case "hearth":
					break;
				case "svasud faste":
					SayTo(player, "Svasud Faste is what you seek, and Svasud Faste is what you shall find.");
					break;
				case "uppland":
					SayTo(player, "Now to the Frontiers for the glory of the realm!");
					break;
				case "vindsaul faste":
					SayTo(player, "Vindsaul Faste is what you seek, and Vindsaul Faste is what you shall find.");
					break;
				case "hafheim":
					if (ServerProperties.Properties.DISABLE_TUTORIAL)
					{
						SayTo(player,"Sorry, this place is not available for now !");
						return;
					}
					if (player.Level > 15)
					{
						SayTo(player,"Sorry, you are far too experienced to enjoy this place !");
						return;
					}
					break;
				default:
					SayTo(player, "This destination is not yet supported.");
					return;
			}
			base.OnDestinationPicked(player, destination);
		}
开发者ID:boscorillium,项目名称:dol,代码行数:82,代码来源:MidgardTeleporter.cs

示例8: OnDestinationPicked

		/// <summary>
		/// Player has picked a destination.
		/// </summary>
		/// <param name="player"></param>
		/// <param name="destination"></param>
		protected override void OnDestinationPicked(GamePlayer player, Teleport destination)
		{
			switch (destination.TeleportID.ToLower())
			{
				case "avalon marsh":
					SayTo(player, "You shall soon arrive in the Avalon Marsh.");
					break;
				case "battlegrounds":
					if (!ServerProperties.Properties.BG_ZONES_OPENED && player.Client.Account.PrivLevel == (uint)ePrivLevel.Player)
					{
						SayTo(player, ServerProperties.Properties.BG_ZONES_CLOSED_MESSAGE);
						return;
					}

					SayTo(player, "I will teleport you to the appropriate battleground for your level and Realm Rank. If you exceed the Realm Rank for a battleground, you will not teleport. Please gain more experience to go to the next battleground.");
					break;
				case "camelot":
					SayTo(player, "The great city awaits!");
					break;
				case "castle sauvage":
					SayTo(player, "Castle Sauvage is what you seek, and Castle Sauvage is what you shall find.");
					break;
				case "diogel":
					break;	// No text?
				case "entrance":
					break;	// No text?
				case "forest sauvage":
					SayTo(player, "Now to the Frontiers for the glory of the realm!");
					break;
				case "gothwaite":
					SayTo(player, "The Shrouded Isles await you.");
					break;
				case "gwyntell":
					break;	// No text?
				case "inconnu crypt":
					if (player.HasFinishedQuest(typeof(InconnuCrypt)) <= 0)
					{
						SayTo(player, String.Format("I may only send those who know the way to this {0} {1}",
						                            "city. Seek out the path to the city and in future times I will aid you in",
						                            "this journey."));
						return;
					}
					break;
				case "oceanus":
					if (player.Client.Account.PrivLevel < ServerProperties.Properties.ATLANTIS_TELEPORT_PLVL)
					{
						SayTo(player, "I'm sorry, but you are not authorized to enter Atlantis at this time.");
						return;
					}
					SayTo(player, "You will soon arrive in the Haven of Oceanus.");
					break;
				case "personal":
					break;
				case "hearth":
					break;
				case "snowdonia fortress":
					SayTo(player, "Snowdonia Fortress is what you seek, and Snowdonia Fortress is what you shall find.");
					break;
					// text for the following ?
				case "wearyall":
					break;
				case "holtham":
					if (ServerProperties.Properties.DISABLE_TUTORIAL)
					{
						SayTo(player,"Sorry, this place is not available for now !");
						return;
					}
					if (player.Level > 15)
					{
						SayTo(player,"Sorry, you are far too experienced to enjoy this place !");
						return;
					}
					break;
				default:
					SayTo(player, "This destination is not yet supported.");
					return;
			}
			base.OnDestinationPicked(player, destination);
		}
开发者ID:boscorillium,项目名称:dol,代码行数:84,代码来源:AlbionTeleporter.cs

示例9: CheckQuestQualification

        /// <summary>
        /// This method checks if a player qualifies for this quest
        /// </summary>
        /// <returns>true if qualified, false if not</returns>
        public override bool CheckQuestQualification(GamePlayer player)
        {
            // We're not going to offer this quest if the player is already on it...

            if (player.IsDoingQuest(this.GetType()) != null)
                return false;

            // ...nor will we let him do it again.

            if (player.HasFinishedQuest(this.GetType()) > 0)
                return false;

            // This checks below are only performed is player isn't doing quest already

            if (player.Level < minimumLevel || player.Level > maximumLevel)
                return false;

            if (player.CharacterClass.ID != (byte)eCharacterClass.Armsman)
                return false;

            return true;
        }
开发者ID:mynew4,项目名称:DAoC,代码行数:26,代码来源:GreetingsArmsman.cs

示例10: CheckQuestQualification

        /// <summary>
        /// Check if player is eligible for this quest.
        /// </summary>
        /// <param name="player"></param>
        /// <returns></returns>
        public override bool CheckQuestQualification(GamePlayer player)
        {
            // Must have the encounter, must have the book; must not be on the quest
            // and must not have the quest finished either.

            Type encounterType = ArtifactMgr.GetEncounterType(ArtifactID);

            if (encounterType == null)
            {
                m_reasonFailQualification = "It does not appear this encounter type is set up correctly.";
                log.Warn("ArtifactQuest: EncounterType is null for ArtifactID " + ArtifactID);
                return false;
            }

            if (player == null)
            {
                m_reasonFailQualification = "Player is null for quest, serious error!";
                log.Warn("ArtifactQuest: Player is null for ArtifactID " + ArtifactID + " encounterType " + encounterType.FullName);
                return false;
            }

            if (player.CanReceiveArtifact(ArtifactID) == false)
            {
                m_reasonFailQualification = "Your class is not eligible for this artifact.";
                return false;
            }

            if (player.Level < Level)
            {
                m_reasonFailQualification = "You must be at least level " + Level + " in order to complete this quest.";
                return false;
            }

            if (player.HasFinishedQuest(this.GetType()) != 0)
            {
                m_reasonFailQualification = "You've already completed the quest for this artifact.";
                return false;
            }

            if (player.HasFinishedQuest(encounterType) <= 0)
            {
                m_reasonFailQualification = "You must first get the encounter credit for this artifact.";
                return false;
            }

            if (!ArtifactMgr.HasBook(player, ArtifactID))
            {
                m_reasonFailQualification = "You are missing the correct book for this artifact.";
                return false;
            }

            if (player.IsDoingQuest(this.GetType()) != null)
            {
                m_reasonFailQualification = "You've already started the quest for this artifact.";
                return false;
            }

            return true;
        }
开发者ID:uvbs,项目名称:Dawn-of-Light-core,代码行数:64,代码来源:ArtifactQuest.cs

示例11: OnDestinationPicked

		/// <summary>
		/// Player has picked a destination.
		/// </summary>
		/// <param name="player"></param>
		/// <param name="destination"></param>
		protected override void OnDestinationPicked(GamePlayer player, Teleport destination)
		{
			switch (destination.TeleportID.ToLower())
			{
				case "aalid feie":
					break;	// No text?
				case "battlegrounds":
					if (!ServerProperties.Properties.BG_ZONES_OPENED && player.Client.Account.PrivLevel == (uint)ePrivLevel.Player)
					{
						SayTo(player, ServerProperties.Properties.BG_ZONES_CLOSED_MESSAGE);
						return;
					}
					SayTo(player, "I will teleport you to the appropriate battleground for your level and Realm Rank. If you exceed the Realm Rank for a battleground, you will not teleport. Please gain more experience to go to the next battleground.");
					break;
				case "cruachan gorge":
					SayTo(player, "Now to the Frontiers for the glory of the realm!");
					break;
				case "domnann":
					SayTo(player, "The Shrouded Isles await you.");
					break;
				case "droighaid":
					break;	// No text?
				case "druim cain":
					SayTo(player, "Druim Cain is what you seek, and Druim Cain is what you shall find.");
					break;
				case "druim ligen":
					SayTo(player, "Druim Ligen is what you seek, and Druim Ligen is what you shall find.");
					break;
				case "entrance":
					break;	// No text?
				case "necht":
					break;	// No text?
				case "oceanus":
					if (player.Client.Account.PrivLevel < ServerProperties.Properties.ATLANTIS_TELEPORT_PLVL)
					{
						SayTo(player, "I'm sorry, but you are not authorized to enter Atlantis at this time.");
						return;
					}
					SayTo(player, "You will soon arrive in the Haven of Oceanus.");
					break;
				case "personal":
					break;
				case "hearth":
					break;
				case "shannon estuary":
					SayTo(player, "You shall soon arrive in the Shannon Estuary.");
					break;
				case "shar labyrinth":
					if (player.HasFinishedQuest(typeof(SharLabyrinth)) <= 0)
					{
						SayTo(player, String.Format("I may only send those who know the way to this {0} {1}",
						                            "city. Seek out the path to the city and in future times I will aid you in",
						                            "this journey."));
						return;
					}
					break;
				case "tir na nog":
					SayTo(player, "The great city awaits!");
					break;
				case "fintain":
					if (ServerProperties.Properties.DISABLE_TUTORIAL)
					{
						SayTo(player,"Sorry, this place is not available for now !");
						return;
					}
					if (player.Level > 15)
					{
						SayTo(player,"Sorry, you are far too experienced to enjoy this place !");
						return;
					}
					break;
				default:
					SayTo(player, "This destination is not yet supported.");
					return;
			}
			base.OnDestinationPicked(player, destination);
		}
开发者ID:Refizul,项目名称:DOL-Kheldron,代码行数:82,代码来源:HiberniaTeleporter.cs


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