public override void OnDoubleClick(Mobile from) { if (!this.IsChildOf(from.Backpack) && this.Movable) { from.SendLocalizedMessage(1060640); // The item must be in your backpack to use it. return; } if (!(from is PlayerMobile)) { return; } PlayerMobile player = (PlayerMobile)from; if (QuestHelper.InProgress(player, this.Quests)) { return; } if (QuestHelper.QuestLimitReached(player)) { return; } // check if this quester can offer quest chain (already started) foreach (KeyValuePair <QuestChain, BaseChain> pair in player.Chains) { BaseChain chain = pair.Value; if (chain != null && chain.Quester != null && chain.Quester.IsAssignableFrom(this.GetType())) { BaseQuest quest = QuestHelper.RandomQuest(player, new Type[] { chain.CurrentQuest }, this); if (quest != null) { player.CloseGump(typeof(NewQuestGump)); player.SendGump(new NewQuestGump(quest)); return; } } } BaseQuest questt = QuestHelper.RandomQuest(player, this.Quests, this); if (questt != null) { player.CloseGump(typeof(NewQuestGump)); player.SendGump(new NewQuestGump(questt)); } else { player.SendLocalizedMessage(1075141); // You are too busy with other tasks at this time. } }
public virtual void OnTalk(PlayerMobile player) { if (player.Quests.Count >= 10) { SayTo(player, 1156899, 0x3B2); // You are too busy with your other quests, perhaps I will have something for you after you finish one of your current quests. return; } if (QuestHelper.DeliveryArrived(player, this)) { return; } if (QuestHelper.InProgress(player, this)) { return; } if (QuestHelper.QuestLimitReached(player)) { return; } // check if this quester can offer any quest chain (already started) foreach (KeyValuePair <QuestChain, BaseChain> pair in player.Chains) { BaseChain chain = pair.Value; if (chain != null && chain.Quester != null && chain.Quester == GetType()) { BaseQuest quest = QuestHelper.RandomQuest(player, new[] { chain.CurrentQuest }, this); if (quest != null) { player.CloseGump(typeof(MondainQuestGump)); player.SendGump(new MondainQuestGump(quest)); return; } } } BaseQuest questt = QuestHelper.RandomQuest(player, Quests, this); if (questt != null) { player.CloseGump(typeof(MondainQuestGump)); player.SendGump(new MondainQuestGump(questt)); } }
public virtual void OnTalk(PlayerMobile player) { if (QuestHelper.DeliveryArrived(player, this)) { return; } if (QuestHelper.InProgress(player, this)) { return; } if (QuestHelper.QuestLimitReached(player)) { return; } Direction = this.GetDirectionTo(player); // check if this quester can offer any quest chain (already started) foreach (KeyValuePair <QuestChain, BaseChain> pair in player.Chains) { BaseChain chain = pair.Value; if (chain != null && chain.Quester != null && chain.Quester == GetType()) { BaseQuest quest = QuestHelper.RandomQuest(player, new Type[] { chain.CurrentQuest }, this); if (quest != null) { player.CloseGump(typeof(BaseQuestGump)); player.SendGump(new MLQuestOfferGump(quest)); return; } } } BaseQuest questt = QuestHelper.RandomQuest(player, Quests, this); if (questt != null) { player.CloseGump(typeof(BaseQuestGump)); player.SendGump(new MLQuestOfferGump(questt)); } }
public override void OnTalk(PlayerMobile player) { if (QuestHelper.DeliveryArrived(player, this)) { return; } else if (QuestHelper.InProgress(player, this)) { return; } else if (QuestHelper.QuestLimitReached(player)) { return; } BlueSpellInfo.UpdateTitle(player); BaseQuest quest = null; if (player.Skills[SkillName.Forensics].Base < 51.0) { quest = QuestHelper.RandomQuest(player, new Type[] { typeof(BlueMageTrainingQuest) }, this); } else if (!BlueMageControl.IsBlueMage(player)) { if (!QuestHelper.InProgress(player, this)) { player.CloseGump(typeof(BlueMageQuestionsGump)); player.SendGump(new BlueMageQuestionsGump(player, this)); } else { Say("You need to seek your mark."); } } else { List <Type> types = new List <Type>(); types.Add(typeof(BlueMageTierOneSlayerQuest)); types.Add(typeof(BlueMageTierTwoSlayerQuest)); types.Add(typeof(BlueMageTierThreeSlayerQuest)); //types.Add( typeof( FindingQuinaQuest ) ); //if ( BlueSpellInfo.KnowsAllMoves( player ) ) //{ //types.Add( typeof( BattleKaysaQuest ) ); //types.Add( typeof( BattleRakdosQuest ) ); //if ( BlueSpellInfo.KnowsAllSpells( player ) ) //{ // types.Add( typeof( BattleTalimQuest ) ); //} //} //if ( BlueSpellInfo.KnowsAllSpells( player ) ) //{ //types.Add( typeof( BattleMatoQuest ) ); //types.Add( typeof( BattleMarkovQuest ) ); //} quest = QuestHelper.RandomQuest(player, types.ToArray(), this); } if (quest != null) { player.CloseGump(typeof(MondainQuestGump)); player.SendGump(new MondainQuestGump(quest)); } }