コード例 #1
0
        public override bool CanTalkTo(PlayerMobile to)
        {
            if (SolenMatriarchQuest.IsFriend(to, RedSolen))
            {
                return(true);
            }

            return(to.Quest is SolenMatriarchQuest qs && qs.RedSolen == RedSolen);
        }
コード例 #2
0
 public override void OnComplete()
 {
     if (SolenMatriarchQuest.GiveRewardTo(System.From))
     {
         System.Complete();
     }
     else
     {
         System.AddConversation(new FullBackpackConversation(true));
     }
 }
コード例 #3
0
        public override bool CanTalkTo(PlayerMobile to)
        {
            if (SolenMatriarchQuest.IsFriend(to, this.RedSolen))
            {
                return(true);
            }

            SolenMatriarchQuest qs = to.Quest as SolenMatriarchQuest;

            return(qs != null && qs.RedSolen == this.RedSolen);
        }
コード例 #4
0
        public override void OnTalk(PlayerMobile player, bool contextMenu)
        {
            Direction = GetDirectionTo(player);

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

                    if (obj?.Completed == false)
                    {
                        obj.Complete();
                    }
                    else if (qs.IsObjectiveInProgress(typeof(GatherWaterObjective)))
                    {
                        qs.AddConversation(new DuringWaterGatheringConversation());
                    }
                    else
                    {
                        obj = qs.FindObjective <ReturnAfterWaterObjective>();

                        if (obj?.Completed == false)
                        {
                            obj.Complete();
                        }
                        else if (qs.IsObjectiveInProgress(typeof(ProcessFungiObjective)))
                        {
                            qs.AddConversation(new DuringFungiProcessConversation());
                        }
                        else
                        {
                            obj = qs.FindObjective <GetRewardObjective>();

                            if (obj?.Completed == false)
                            {
                                if (SolenMatriarchQuest.GiveRewardTo(player))
                                {
                                    obj.Complete();
                                }
                                else
                                {
                                    qs.AddConversation(new FullBackpackConversation(false));
                                }
                            }
                        }
                    }
                }
            }
コード例 #5
0
ファイル: Objectives.cs プロジェクト: tflynt91/TrueUO
        public override void OnComplete()
        {
            PlayerMobile player = System.From;
            bool redSolen = ((SolenMatriarchQuest)System).RedSolen;

            bool friend = SolenMatriarchQuest.IsFriend(player, redSolen);

            System.AddConversation(new ProcessFungiConversation(friend));

            if (redSolen)
                player.SolenFriendship = SolenFriendship.Red;
            else
                player.SolenFriendship = SolenFriendship.Black;
        }
コード例 #6
0
        public override void OnComplete()
        {
            var player   = System.From;
            var redSolen = ((SolenMatriarchQuest)System).RedSolen;

            var friend = SolenMatriarchQuest.IsFriend(player, redSolen);

            System.AddConversation(new ProcessFungiConversation(friend));

            if (redSolen)
            {
                player.SolenFriendship = SolenFriendship.Red;
            }
            else
            {
                player.SolenFriendship = SolenFriendship.Black;
            }
        }
コード例 #7
0
ファイル: SolenMatriarch.cs プロジェクト: adverserath/TrueUO
        public override bool OnDragDrop(Mobile from, Item dropped)
        {
            PlayerMobile player = from as PlayerMobile;

            if (player != null)
            {
                if (dropped is Seed)
                {
                    SolenMatriarchQuest qs = player.Quest as SolenMatriarchQuest;

                    if (qs != null && qs.RedSolen == RedSolen)
                    {
                        SayTo(player, 1054080); // Thank you for that plant seed. Those have such wonderful flavor.
                    }
                    else
                    {
                        QuestSystem newQuest = new SolenMatriarchQuest(player, RedSolen);

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

                    dropped.Delete();
                    return(true);
                }

                if (dropped is ZoogiFungus fungus)
                {
                    OnGivenFungi(player, fungus);

                    return(fungus.Deleted);
                }
            }

            return(base.OnDragDrop(from, dropped));
        }
コード例 #8
0
        public void OnGivenFungi(PlayerMobile player, ZoogiFungus fungi)
        {
            this.Direction = GetDirectionTo(player);

            SolenMatriarchQuest qs = player.Quest as SolenMatriarchQuest;

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

                if (obj != null && !obj.Completed)
                {
                    int amount = fungi.Amount / 2;

                    if (amount > 100)
                    {
                        amount = 100;
                    }

                    if (amount > 0)
                    {
                        if (amount * 2 >= fungi.Amount)
                        {
                            fungi.Delete();
                        }
                        else
                        {
                            fungi.Amount -= amount * 2;
                        }

                        PowderOfTranslocation powder = new PowderOfTranslocation(amount);
                        player.AddToBackpack(powder);

                        player.SendLocalizedMessage(1054100);                           // You receive some powder of translocation.

                        obj.Complete();
                    }
                }
            }
        }
コード例 #9
0
        public override void GetContextMenuEntries(Mobile from, ArrayList list)
        {
            base.GetContextMenuEntries(from, list);

            if (from.Alive)
            {
                PlayerMobile pm = from as PlayerMobile;

                if (pm != null)
                {
                    SolenMatriarchQuest qs = pm.Quest as SolenMatriarchQuest;

                    if (qs != null && qs.RedSolen == this.RedSolen)
                    {
                        if (qs.IsObjectiveInProgress(typeof(ProcessFungiObjective)))
                        {
                            list.Add(new ProcessZoogiFungusEntry(this, pm));
                        }
                    }
                }
            }
        }
コード例 #10
0
        public override void OnTalk(PlayerMobile player, bool contextMenu)
        {
            this.Direction = GetDirectionTo(player);

            SolenMatriarchQuest qs = player.Quest as SolenMatriarchQuest;

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

                    if (obj != null && !obj.Completed)
                    {
                        obj.Complete();
                    }
                    else if (qs.IsObjectiveInProgress(typeof(GatherWaterObjective)))
                    {
                        qs.AddConversation(new DuringWaterGatheringConversation());
                    }
                    else
                    {
                        obj = qs.FindObjective(typeof(ReturnAfterWaterObjective));

                        if (obj != null && !obj.Completed)
                        {
                            obj.Complete();
                        }
                        else if (qs.IsObjectiveInProgress(typeof(ProcessFungiObjective)))
                        {
                            qs.AddConversation(new DuringFungiProcessConversation());
                        }
                        else
                        {
                            obj = qs.FindObjective(typeof(GetRewardObjective));

                            if (obj != null && !obj.Completed)
                            {
                                if (SolenMatriarchQuest.GiveRewardTo(player))
                                {
                                    obj.Complete();
                                }
                                else
                                {
                                    qs.AddConversation(new FullBackpackConversation(false));
                                }
                            }
                        }
                    }
                }
            }
            else if (SolenMatriarchQuest.IsFriend(player, this.RedSolen))
            {
                QuestSystem newQuest = new SolenMatriarchQuest(player, this.RedSolen);

                if (player.Quest == null && QuestSystem.CanOfferQuest(player, typeof(SolenMatriarchQuest)))
                {
                    newQuest.SendOffer();
                }
                else
                {
                    newQuest.AddConversation(new DontOfferConversation(true));
                }
            }
        }
コード例 #11
0
ファイル: SolenMatriarch.cs プロジェクト: Ravenwolfe/xrunuo
        public override void OnTalk( PlayerMobile player, bool contextMenu )
        {
            this.Direction = this.GetDirectionTo( player );

            SolenMatriarchQuest qs = player.Quest as SolenMatriarchQuest;

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

                    if ( obj != null && !obj.Completed )
                    {
                        obj.Complete();
                    }
                    else if ( qs.IsObjectiveInProgress( typeof( GatherWaterObjective ) ) )
                    {
                        qs.AddConversation( new DuringWaterGatheringConversation() );
                    }
                    else
                    {
                        obj = qs.FindObjective( typeof( ReturnAfterWaterObjective ) );

                        if ( obj != null && !obj.Completed )
                        {
                            obj.Complete();
                        }
                        else if ( qs.IsObjectiveInProgress( typeof( ProcessFungiObjective ) ) )
                        {
                            qs.AddConversation( new DuringFungiProcessConversation() );
                        }
                        else
                        {
                            obj = qs.FindObjective( typeof( GetRewardObjective ) );

                            if ( obj != null && !obj.Completed )
                            {
                                if ( SolenMatriarchQuest.GiveRewardTo( player ) )
                                {
                                    obj.Complete();
                                }
                                else
                                {
                                    qs.AddConversation( new FullBackpackConversation( false ) );
                                }
                            }
                        }
                    }
                }
            }
            else if ( SolenMatriarchQuest.IsFriend( player, this.RedSolen ) )
            {
                QuestSystem newQuest = new SolenMatriarchQuest( player, this.RedSolen );

                if ( player.Quest == null && QuestSystem.CanOfferQuest( player, typeof( SolenMatriarchQuest ) ) )
                {
                    newQuest.SendOffer();
                }
                else
                {
                    newQuest.AddConversation( new DontOfferConversation( true ) );
                }
            }
        }
コード例 #12
0
ファイル: SolenMatriarch.cs プロジェクト: Ravenwolfe/xrunuo
        public override bool OnDragDrop( Mobile from, Item dropped )
        {
            PlayerMobile player = from as PlayerMobile;

            if ( player != null )
            {
                if ( dropped is Seed )
                {
                    SolenMatriarchQuest qs = player.Quest as SolenMatriarchQuest;

                    if ( qs != null && qs.RedSolen == this.RedSolen )
                    {
                        SayTo( player, 1054080 ); // Thank you for that plant seed. Those have such wonderful flavor.
                    }
                    else
                    {
                        QuestSystem newQuest = new SolenMatriarchQuest( player, this.RedSolen );

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

                    dropped.Delete();
                    return true;
                }
                else if ( dropped is ZoogiFungus )
                {
                    OnGivenFungi( player, (ZoogiFungus) dropped );

                    return dropped.Deleted;
                }
            }

            return base.OnDragDrop( from, dropped );
        }