示例#1
0
        public override void OnStart()
        {
            // This reports problems, and stops BT processing if there was a problem with attributes...
            // We had to defer this action, as the 'profile line number' is not available during the element's
            // constructor call.
            OnStart_HandleAttributeProblem();

            // If the quest is complete, this behavior is already done...
            // So we don't want to falsely inform the user of things that will be skipped.
            if (!IsDone)
            {
                this.UpdateGoalText(QuestId);

                QuestTurnIn = new ForcedQuestTurnIn(null, (uint)QuestId, QuestName, (uint)TurnInId, TurnInName,
                                                    TurnInLocation);

                if (QuestTurnIn == null)
                {
                    QBCLog.Fatal("Unable to complete {0}", this.GetType().Name);
                }

                Targeting.Instance.RemoveTargetsFilter += Instance_RemoveTargetsFilter;
                QuestTurnIn.OnStart();
            }
        }
 public override void OnFinished()
 {
     Targeting.Instance.RemoveTargetsFilter -= Instance_RemoveTargetsFilter;
     if (QuestTurnIn != null)
     {
         QuestTurnIn.OnFinished();
         QuestTurnIn = null;
     }
     TreeRoot.GoalText   = string.Empty;
     TreeRoot.StatusText = string.Empty;
     base.OnFinished();
 }
示例#3
0
        public override void OnStart()
        {
            // This reports problems, and stops BT processing if there was a problem with attributes...
            // We had to defer this action, as the 'profile line number' is not available during the element's
            // constructor call.
            OnStart_HandleAttributeProblem();

            // If the quest is complete, this behavior is already done...
            // So we don't want to falsely inform the user of things that will be skipped.
            if (!IsDone)
            {
                QuestTurnIn = new ForcedQuestTurnIn((uint)QuestId, QuestName, (uint)TurnInId, TurnInLocation);

                if (QuestTurnIn == null)
                { LogMessage("fatal", "Unable to complete {0}", this.GetType().Name); }

                Targeting.Instance.RemoveTargetsFilter += Instance_RemoveTargetsFilter;
                QuestTurnIn.OnStart();
            }
        }
示例#4
0
        public void Dispose(bool isExplicitlyInitiatedDispose)
        {
            if (!_isDisposed)
            {
                // NOTE: we should call any Dispose() method for any managed or unmanaged
                // resource, if that resource provides a Dispose() method.

                // Clean up managed resources, if explicit disposal...
                if (isExplicitlyInitiatedDispose)
                {
                    // empty, for now
                }

                // Clean up unmanaged resources (if any) here...
                Targeting.Instance.RemoveTargetsFilter -= Instance_RemoveTargetsFilter;
                if (QuestTurnIn != null)
                {
                    QuestTurnIn.Dispose();
                    QuestTurnIn = null;
                }

                TreeRoot.GoalText = string.Empty;
                TreeRoot.StatusText = string.Empty;

                // Call parent Dispose() (if it exists) here ...
                base.Dispose();
            }

            _isDisposed = true;
        }