Beispiel #1
0
		public override BaseObjectiveInstance CreateInstance( MLQuestInstance instance )
		{
			if ( instance == null || m_Destination == null )
				return null;

			return new EscortObjectiveInstance( this, instance );
		}
Beispiel #2
0
		public BaseObjectiveInstance( MLQuestInstance instance, BaseObjective obj )
		{
			m_Instance = instance;

			if ( obj.IsTimed )
				m_EndTime = DateTime.Now + obj.Duration;
		}
		public QuestLogDetailedGump( MLQuestInstance instance, bool closeGumps )
			: base( 1046026 ) // Quest Log
		{
			m_Instance = instance;
			m_CloseGumps = closeGumps;

			PlayerMobile pm = instance.Player;
			MLQuest quest = instance.Quest;

			if ( closeGumps )
			{
				CloseOtherGumps( pm );
				pm.CloseGump( typeof( QuestLogDetailedGump ) );
			}

			SetTitle( quest.Title );
			RegisterButton( ButtonPosition.Left, ButtonGraphic.Resign, 1 );
			RegisterButton( ButtonPosition.Right, ButtonGraphic.Okay, 2 );

			SetPageCount( 3 );

			BuildPage();
			AddDescription( quest );

			if ( instance.Failed ) // only displayed on the first page
				AddHtmlLocalized( 160, 80, 250, 16, 500039, 0x3C00, false, false ); // Failed!

			BuildPage();
			AddObjectivesProgress( instance );

			BuildPage();
			AddRewardsPage( quest );
		}
Beispiel #4
0
		public GainSkillObjectiveInstance( GainSkillObjective objective, MLQuestInstance instance )
			: base( instance, objective )
		{
			m_Objective = objective;
		}
		public KillObjectiveInstance( KillObjective objective, MLQuestInstance instance )
			: base( instance, objective )
		{
			m_Objective = objective;
			m_Slain = 0;
		}
Beispiel #6
0
		public virtual BaseObjectiveInstance CreateInstance( MLQuestInstance instance )
		{
			return null;
		}
Beispiel #7
0
 public virtual void OnPlayerDeath(MLQuestInstance instance)
 {
 }
		public CollectObjectiveInstance( CollectObjective objective, MLQuestInstance instance )
			: base( instance, objective )
		{
			m_Objective = objective;
		}
Beispiel #9
0
 public virtual void OnRewardClaimed(MLQuestInstance instance)
 {
 }
Beispiel #10
0
 public virtual void GetRewards(MLQuestInstance instance)
 {
     instance.SendRewardGump();
 }
Beispiel #11
0
 public virtual void OnAccepted(MLQuestInstance instance)
 {
 }
		public QuestLogDetailedGump( MLQuestInstance instance )
			: this( instance, true )
		{
		}
Beispiel #13
0
        private static bool FindQuest(IQuestGiver quester, PlayerMobile pm, MLQuestContext context, out MLQuest quest, out MLQuestInstance entry)
        {
            quest = null;
            entry = null;

            List <MLQuest> quests      = quester.MLQuests;
            Type           questerType = quester.GetType();

            // 1. Check quests in progress with this NPC (overriding deliveries is intended)
            if (context != null)
            {
                foreach (MLQuest questEntry in quests)
                {
                    MLQuestInstance instance = context.FindInstance(questEntry);

                    if (instance != null && (instance.Quester == quester || (!questEntry.IsEscort && instance.QuesterType == questerType)))
                    {
                        entry = instance;
                        quest = questEntry;
                        return(true);
                    }
                }
            }

            // 2. Check deliveries (overriding chain offers is intended)
            if ((entry = HandleDelivery(pm, quester, questerType)) != null)
            {
                quest = entry.Quest;
                return(true);
            }

            // 3. Check chain quest offers
            if (context != null)
            {
                foreach (MLQuest questEntry in quests)
                {
                    if (questEntry.IsChainTriggered && context.ChainOffers.Contains(questEntry))
                    {
                        quest = questEntry;
                        return(true);
                    }
                }
            }

            // 4. Random quest
            quest = RandomStarterQuest(quester, pm, context);

            return(quest != null);
        }
Beispiel #14
0
		public override BaseObjectiveInstance CreateInstance( MLQuestInstance instance )
		{
			return new GainSkillObjectiveInstance( this, instance );
		}
Beispiel #15
0
 public virtual void OnCancel(MLQuestInstance instance)
 {
 }
		public override BaseObjectiveInstance CreateInstance( MLQuestInstance instance )
		{
			return new CollectObjectiveInstance( this, instance );
		}
Beispiel #17
0
 public virtual void OnQuesterDeleted(MLQuestInstance instance)
 {
 }
Beispiel #18
0
		private static bool FindQuest( IQuestGiver quester, PlayerMobile pm, MLQuestContext context, out MLQuest quest, out MLQuestInstance entry )
		{
			quest = null;
			entry = null;

			List<MLQuest> quests = quester.MLQuests;
			Type questerType = quester.GetType();

			// 1. Check quests in progress with this NPC (overriding deliveries is intended)
			if ( context != null )
			{
				foreach ( MLQuest questEntry in quests )
				{
					MLQuestInstance instance = context.FindInstance( questEntry );

					if ( instance != null && ( instance.Quester == quester || ( !questEntry.IsEscort && instance.QuesterType == questerType ) ) )
					{
						entry = instance;
						quest = questEntry;
						return true;
					}
				}
			}

			// 2. Check deliveries (overriding chain offers is intended)
			if ( ( entry = HandleDelivery( pm, quester, questerType ) ) != null )
			{
				quest = entry.Quest;
				return true;
			}

			// 3. Check chain quest offers
			if ( context != null )
			{
				foreach ( MLQuest questEntry in quests )
				{
					if ( questEntry.IsChainTriggered && context.ChainOffers.Contains( questEntry ) )
					{
						quest = questEntry;
						return true;
					}
				}
			}

			// 4. Random quest
			quest = RandomStarterQuest( quester, pm, context );

			return ( quest != null );
		}
Beispiel #19
0
		public EscortObjectiveInstance( EscortObjective objective, MLQuestInstance instance )
			: base( instance, objective )
		{
			m_Objective = objective;
			m_HasCompleted = false;
			m_Timer = Timer.DelayCall( TimeSpan.FromSeconds( 5 ), TimeSpan.FromSeconds( 5 ), new TimerCallback( CheckDestination ) );
			m_LastSeenEscorter = DateTime.UtcNow;
			m_Escort = instance.Quester as BaseCreature;

			if ( MLQuestSystem.Debug && m_Escort == null && instance.Quester != null )
				Console.WriteLine( "Warning: EscortObjective is not supported for type '{0}'", instance.Quester.GetType().Name );
		}