Aura.Channel.Scripting.Scripts.NpcScript.GiftAsync C# (CSharp) Метод

GiftAsync() публичный Метод

Called from packet handler when a player starts the conversation with a gift.
public GiftAsync ( Item gift ) : void
gift Item
Результат void
		public virtual async void GiftAsync(Item gift)
		{
			this.ConversationState = ConversationState.Ongoing;
			try
			{
				var score = this.GetGiftReaction(gift);

				// Debug output
				if (this.Player.IsDev)
					this.Msg(string.Format("-Debug-<br/>Reaction: {0}<br/>Score: {1}", this.NPC.GiftWeights.CalculateScore(gift), score));

				await Hook("before_gift", gift, score);

				await this.Gift(gift, score);
			}
			catch (OperationCanceledException)
			{
				// Thrown to get out of the async chain
			}
			catch (Exception ex)
			{
				Log.Exception(ex, "NpcScript.GiftAsync");
				this.Close2("(Error)");
			}
			this.ConversationState = ConversationState.Ended;
		}