/// <summary> /// Checks the trigger, this method is called whenever a event associated with this questparts quest /// or a manualy associated eventhandler is notified. /// </summary> /// <param name="e"></param> /// <param name="sender"></param> /// <param name="args"></param> /// <returns></returns> public override bool Check(DOLEvent e, object sender, EventArgs args) { bool result = false; if (e == GamePlayerEvent.AbortQuest) { GamePlayer player = BehaviourUtils.GuessGamePlayerFromNotify(e, sender, args); QuestEventArgs qArgs = (QuestEventArgs)args; result = (qArgs.Player.ObjectID == player.ObjectID && QuestMgr.GetQuestTypeForID(qArgs.QuestID).Equals(I)); } return(result); }
/// <summary> /// Checks the trigger, this method is called whenever a event associated with this questparts quest /// or a manualy associated eventhandler is notified. /// </summary> /// <param name="e"></param> /// <param name="sender"></param> /// <param name="args"></param> /// <returns></returns> public override bool Check(DOLEvent e, object sender, EventArgs args) { bool result = false; if (e == GamePlayerEvent.AcceptQuest) { GamePlayer player = BehaviourUtils.GuessGamePlayerFromNotify(e, sender, args); QuestEventArgs qArgs = (QuestEventArgs)args; Type type = QuestMgr.GetQuestTypeForID(qArgs.QuestID); if (type != null) { result = qArgs.Player.ObjectID == player.ObjectID && type == I; } } return(result); }