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;
}