コード例 #1
0
ファイル: DataQuest.cs プロジェクト: boscorillium/dol
		/// <summary>
		/// Get or create the CharacterXDataQuest for this player
		/// </summary>
		/// <param name="player"></param>
		/// <returns></returns>
		public static CharacterXDataQuest GetCharacterQuest(GamePlayer player, int ID, bool create)
		{
			CharacterXDataQuest charQuest = GameServer.Database.SelectObject<CharacterXDataQuest>("Character_ID ='" + GameServer.Database.Escape(player.QuestPlayerID) + "' AND DataQuestID = " + ID);

			if (charQuest == null && create)
			{
				charQuest = new CharacterXDataQuest(player.QuestPlayerID, ID);
				charQuest.Count = 0;
				charQuest.Step = 0;
				GameServer.Database.AddObject(charQuest);
			}

			return charQuest;
		}
コード例 #2
0
ファイル: DataQuest.cs プロジェクト: boscorillium/dol
		/// <summary>
		/// Dataquest that belongs to a player
		/// </summary>
		/// <param name="questingPlayer"></param>
		/// <param name="dataQuest"></param>
		/// <param name="charQuest"></param>
		public DataQuest(GamePlayer questingPlayer, DBDataQuest dataQuest, CharacterXDataQuest charQuest)
			: this(questingPlayer, null, dataQuest, charQuest)
		{
		}
コード例 #3
0
ファイル: DataQuest.cs プロジェクト: boscorillium/dol
		/// <summary>
		/// This is a dataquest that belongs to a player
		/// </summary>
		/// <param name="questingPlayer"></param>
		/// <param name="dbQuest"></param>
		/// <param name="charQuest"></param>
		public DataQuest(GamePlayer questingPlayer, GameObject sourceObject, DBDataQuest dataQuest, CharacterXDataQuest charQuest)
		{
			m_questPlayer = questingPlayer;
			m_step = 1;
			m_dataQuest = dataQuest;
			m_charQuest = charQuest;

			if (sourceObject != null)
			{
				if (sourceObject is GameNPC)
				{
					m_startNPC = sourceObject as GameNPC;
				}

				m_startObject = sourceObject;
			}

			ParseQuestData();
		}
コード例 #4
0
ファイル: DataQuest.cs プロジェクト: dol-leodagan/DOLSharp
		/// <summary>
		/// Get or create the CharacterXDataQuest for this player
		/// </summary>
		/// <param name="player"></param>
		/// <returns></returns>
		public static CharacterXDataQuest GetCharacterQuest(GamePlayer player, int ID, bool create)
		{
			CharacterXDataQuest charQuest = GameServer.Database.SelectObjects<CharacterXDataQuest>("`Character_ID` = @Character_ID AND `DataQuestID` = @DataQuestID", new[] { new QueryParameter("@Character_ID", player.QuestPlayerID), new QueryParameter("@DataQuestID", ID) }).FirstOrDefault();

			if (charQuest == null && create)
			{
				charQuest = new CharacterXDataQuest(player.QuestPlayerID, ID);
				charQuest.Count = 0;
				charQuest.Step = 0;
				GameServer.Database.AddObject(charQuest);
			}

			return charQuest;
		}