コード例 #1
0
        public override void OnTalk(PlayerMobile player, bool contextMenu)
        {
            Direction = GetDirectionTo(player);

            if (player.Quest is AmbitiousQueenQuest qs && qs.RedSolen == RedSolen)
            {
                if (qs.IsObjectiveInProgress(typeof(KillQueensObjective)))
                {
                    qs.AddConversation(new DuringKillQueensConversation());
                }
                else
                {
                    QuestObjective obj = qs.FindObjective <ReturnAfterKillsObjective>();

                    if (obj?.Completed == false)
                    {
                        obj.Complete();
                    }
                    else if (qs.IsObjectiveInProgress(typeof(GatherFungiObjective)))
                    {
                        qs.AddConversation(new DuringFungiGatheringConversation());
                    }
                    else
                    {
                        var lastObj = qs.FindObjective <GetRewardObjective>();

                        if (lastObj?.Completed == false)
                        {
                            var bagOfSending          = lastObj.BagOfSending;
                            var powderOfTranslocation = lastObj.PowderOfTranslocation;
                            var gold = lastObj.Gold;

                            AmbitiousQueenQuest.GiveRewardTo(player, ref bagOfSending, ref powderOfTranslocation, ref gold);

                            lastObj.BagOfSending          = bagOfSending;
                            lastObj.PowderOfTranslocation = powderOfTranslocation;
                            lastObj.Gold = gold;

                            if (!bagOfSending && !powderOfTranslocation && !gold)
                            {
                                lastObj.Complete();
                            }
                            else
                            {
                                qs.AddConversation(
                                    new FullBackpackConversation(
                                        false,
                                        lastObj.BagOfSending,
                                        lastObj.PowderOfTranslocation,
                                        lastObj.Gold
                                        )
                                    );
                            }
                        }
                    }
                }
            }
コード例 #2
0
ファイル: AmbitiousSolenQueen.cs プロジェクト: jaedan/runuo
        public override bool OnDragDrop(Mobile from, Item dropped)
        {
            this.Direction = GetDirectionTo(from);

            PlayerMobile player = from as PlayerMobile;

            if (player != null)
            {
                AmbitiousQueenQuest qs = player.Quest as AmbitiousQueenQuest;

                if (qs != null && qs.RedSolen == this.RedSolen)
                {
                    QuestObjective obj = qs.FindObjective(typeof(GatherFungiObjective));

                    if (obj != null && !obj.Completed)
                    {
                        if (dropped is ZoogiFungus)
                        {
                            ZoogiFungus fungi = (ZoogiFungus)dropped;

                            if (fungi.Amount >= 50)
                            {
                                obj.Complete();

                                fungi.Amount -= 50;

                                if (fungi.Amount == 0)
                                {
                                    fungi.Delete();
                                    return(true);
                                }
                                else
                                {
                                    return(false);
                                }
                            }
                            else
                            {
                                SayTo(player, 1054072); // Our arrangement was for 50 of the zoogi fungus. Please return to me when you have that amount.
                                return(false);
                            }
                        }
                    }
                }
            }

            return(base.OnDragDrop(from, dropped));
        }
コード例 #3
0
        public override void OnRead()
        {
            bool bagOfSending          = true;
            bool powderOfTranslocation = true;
            bool gold = true;

            AmbitiousQueenQuest.GiveRewardTo(this.System.From, ref bagOfSending, ref powderOfTranslocation, ref gold);

            if (!bagOfSending && !powderOfTranslocation && !gold)
            {
                this.System.Complete();
            }
            else
            {
                this.System.AddConversation(new FullBackpackConversation(true, bagOfSending, powderOfTranslocation, gold));
            }
        }
コード例 #4
0
ファイル: AmbitiousSolenQueen.cs プロジェクト: jaedan/runuo
        public override void OnTalk(PlayerMobile player, bool contextMenu)
        {
            this.Direction = GetDirectionTo(player);

            AmbitiousQueenQuest qs = player.Quest as AmbitiousQueenQuest;

            if (qs != null && qs.RedSolen == this.RedSolen)
            {
                if (qs.IsObjectiveInProgress(typeof(KillQueensObjective)))
                {
                    qs.AddConversation(new DuringKillQueensConversation());
                }
                else
                {
                    QuestObjective obj = qs.FindObjective(typeof(ReturnAfterKillsObjective));

                    if (obj != null && !obj.Completed)
                    {
                        obj.Complete();
                    }
                    else if (qs.IsObjectiveInProgress(typeof(GatherFungiObjective)))
                    {
                        qs.AddConversation(new DuringFungiGatheringConversation());
                    }
                    else
                    {
                        GetRewardObjective lastObj = qs.FindObjective(typeof(GetRewardObjective)) as GetRewardObjective;

                        if (lastObj != null && !lastObj.Completed)
                        {
                            bool bagOfSending          = lastObj.BagOfSending;
                            bool powderOfTranslocation = lastObj.PowderOfTranslocation;
                            bool gold = lastObj.Gold;

                            AmbitiousQueenQuest.GiveRewardTo(player, ref bagOfSending, ref powderOfTranslocation, ref gold);

                            lastObj.BagOfSending          = bagOfSending;
                            lastObj.PowderOfTranslocation = powderOfTranslocation;
                            lastObj.Gold = gold;

                            if (!bagOfSending && !powderOfTranslocation && !gold)
                            {
                                lastObj.Complete();
                            }
                            else
                            {
                                qs.AddConversation(new FullBackpackConversation(false, lastObj.BagOfSending, lastObj.PowderOfTranslocation, lastObj.Gold));
                            }
                        }
                    }
                }
            }
            else
            {
                QuestSystem newQuest = new AmbitiousQueenQuest(player, this.RedSolen);

                if (player.Quest == null && QuestSystem.CanOfferQuest(player, typeof(AmbitiousQueenQuest)))
                {
                    newQuest.SendOffer();
                }
                else
                {
                    newQuest.AddConversation(new DontOfferConversation());
                }
            }
        }
コード例 #5
0
		public override void OnTalk( PlayerMobile player, bool contextMenu )
		{
			Direction = GetDirectionTo( player );

			AmbitiousQueenQuest qs = player.Quest as AmbitiousQueenQuest;

			if ( qs != null && qs.RedSolen == RedSolen )
			{
				if ( qs.IsObjectiveInProgress( typeof( KillQueensObjective ) ) )
				{
					qs.AddConversation( new DuringKillQueensConversation() );
				}
				else
				{
					QuestObjective obj = qs.FindObjective( typeof( ReturnAfterKillsObjective ) );

					if ( obj != null && !obj.Completed )
					{
						obj.Complete();
					}
					else if ( qs.IsObjectiveInProgress( typeof( GatherFungiObjective ) ) )
					{
						qs.AddConversation( new DuringFungiGatheringConversation() );
					}
					else
					{
						GetRewardObjective lastObj = qs.FindObjective( typeof( GetRewardObjective ) ) as GetRewardObjective;

						if ( lastObj != null && !lastObj.Completed )
						{
							bool bagOfSending = lastObj.BagOfSending;
							bool powderOfTranslocation = lastObj.PowderOfTranslocation;
							bool gold = lastObj.Gold;

							AmbitiousQueenQuest.GiveRewardTo( player, ref bagOfSending, ref powderOfTranslocation, ref gold );

							lastObj.BagOfSending = bagOfSending;
							lastObj.PowderOfTranslocation = powderOfTranslocation;
							lastObj.Gold = gold;

							if ( !bagOfSending && !powderOfTranslocation && !gold )
							{
								lastObj.Complete();
							}
							else
							{
								qs.AddConversation( new FullBackpackConversation( false, lastObj.BagOfSending, lastObj.PowderOfTranslocation, lastObj.Gold ) );
							}
						}
					}
				}
			}
			else
			{
				QuestSystem newQuest = new AmbitiousQueenQuest( player, RedSolen );

				if ( player.Quest == null && QuestSystem.CanOfferQuest( player, typeof( AmbitiousQueenQuest ) ) )
				{
					newQuest.SendOffer();
				}
				else
				{
					newQuest.AddConversation( new DontOfferConversation() );
				}
			}
		}