コード例 #1
0
ファイル: BaseEscortable.cs プロジェクト: proxeeus/UORebirth
        public virtual bool AcceptEscorter(Mobile m)
        {
            EDI dest = GetDestination();

            if (dest == null)
            {
                return(false);
            }

            Mobile escorter = GetEscorter();

            if (escorter != null || !m.Alive || m_DestinationString == null)
            {
                return(false);
            }

            if (SetControlMaster(m))
            {
                m_LastSeenEscorter = DateTime.Now;

                if (m is PlayerMobile)
                {
                    ((PlayerMobile)m).LastEscortTime = DateTime.Now;
                }

                Say("Lead on! Payment will be made when we arrive in {0}.", m_DestinationString);
                StartFollow();
                return(true);
            }

            return(false);
        }
コード例 #2
0
        public override void AddCustomContextEntries(Mobile from, List <ContextMenuEntry> list)
        {
            EDI dest = GetDestination();

            if (dest != null && from.Alive)
            {
                Mobile escorter = GetEscorter();

                if (escorter == null || escorter == from)
                {
                    list.Add(new AskTalkingDestinationEntry(this, from));
                }

                if (escorter == null)
                {
                    list.Add(new AcceptTalkingEscortEntry(this, from));
                }
                else if (escorter == from)
                {
                    list.Add(new AbandonTalkingEscortEntry(this, from));
                }
            }

            base.AddCustomContextEntries(from, list);
        }
コード例 #3
0
        public virtual bool SayDestinationTo(Mobile m)
        {
            EDI dest = GetDestination();

            if (dest == null || !m.Alive)
            {
                return(false);
            }

            Mobile escorter = GetEscorter();

            if (escorter == null)
            {
                Say(
                    "I am looking to go to {0}, will you take me?",
                    (dest.Name == "Ocllo" && m.Map == Map.Trammel) ? "Haven" : dest.Name);
                return(true);
            }
            else if (escorter == m)
            {
                Say(
                    "Lead on! Payment will be made when we arrive in {0}.",
                    (dest.Name == "Ocllo" && m.Map == Map.Trammel) ? "Haven" : dest.Name);
                return(true);
            }

            return(false);
        }
コード例 #4
0
        public virtual bool AcceptEscorter(Mobile m)
        {
            EDI dest = GetDestination();

            if (dest == null)
            {
                return(false);
            }

            Mobile escorter = GetEscorter();

            if (escorter != null || !m.Alive)
            {
                return(false);
            }

            BaseEscortable escortable = (BaseEscortable)m_EscortTable[m];

            /*if ( escortable != null && !escortable.Deleted && escortable.GetEscorter() == m )
             * {
             *      Say( true, "I see you already have an escort." );
             *      return false;
             * }
             * else*/if (m is PlayerMobile && (((PlayerMobile)m).LastEscortTime + m_EscortDelay) >= DateTime.Now)
            {
                int minutes = (int)Math.Ceiling(((((PlayerMobile)m).LastEscortTime + m_EscortDelay) - DateTime.Now).TotalMinutes);

                Say(true, String.Format("You must rest {0} minute{1} before we set out on this journey.", minutes, minutes == 1 ? "" : "s"));
                return(false);
            }
            else if (SetControlMaster(m))
            {
                m_LastSeenEscorter = DateTime.Now;

                if (m is PlayerMobile)
                {
                    ((PlayerMobile)m).LastEscortTime = DateTime.Now;
                }

                Say(true, String.Format("Lead on! Payment will be made when we arrive in {0}.", (dest.Name == "Ocllo" && m.Map == Map.Trammel) ? "Haven" : dest.Name));
                m_EscortTable[m] = this;
                StartFollow();

                // We have an escort, Remove bulletin board post
                if (m_Message != null)
                {
                    m_Message.Delete();
                }

                return(true);
            }

            return(false);
        }
コード例 #5
0
        public virtual bool AcceptEscorter(Mobile m)
        {
            EDI dest = GetDestination();

            if (dest == null)
            {
                return(false);
            }

            Mobile escorter = GetEscorter();

            if (escorter != null)
            {
                return(false);
            }

            if (!m.Alive)
            {
                Say(500894);
                return(false);
            }

            var escortable = (BaseEscortable)m_EscortTable[m];

            if (escortable != null && !escortable.Deleted && escortable.GetEscorter() == m)
            {
                Say("I see you already have an escort.");
            }
            else if (m is PlayerMobile && (((PlayerMobile)m).LastEscortTime + m_EscortDelay) >= DateTime.UtcNow)
            {
                var minutes = (int)Math.Ceiling(((((PlayerMobile)m).LastEscortTime + m_EscortDelay) - DateTime.UtcNow).TotalMinutes);

                Say("You must rest {0} minute{1} before we set out on this journey.", minutes, minutes == 1 ? "" : "s");
            }
            else if (SetControlMaster(m))
            {
                m_LastSeenEscorter = DateTime.UtcNow;

                if (m is PlayerMobile)
                {
                    ((PlayerMobile)m).LastEscortTime = DateTime.UtcNow;
                }

                Say(
                    "Lead on! Payment will be made when we arrive in {0}.",
                    (dest.Name == "Ocllo" && m.Map == Map.Trammel) ? "Haven" : dest.Name);
                m_EscortTable[m] = this;
                StartFollow();
                return(true);
            }

            return(false);
        }
コード例 #6
0
        public virtual bool CheckAtDestination()
        {
            EDI dest = GetDestination();

            if (dest == null)
            {
                return(false);
            }

            Mobile escorter = GetEscorter();

            if (escorter == null)
            {
                return(false);
            }

            if (dest.Contains(Location))
            {
                Say(1042809, escorter.Name); // We have arrived! I thank thee, ~1_PLAYER_NAME~! I have no further need of thy services. Here is thy pay.

                // not going anywhere
                m_Destination       = null;
                m_DestinationString = null;

                Container cont = escorter.Backpack;

                if (cont == null)
                {
                    cont = escorter.BankBox;
                }

                Gold gold = new Gold(165, 333);

                if (cont == null || !cont.TryDropItem(escorter, gold, false))
                {
                    gold.MoveToWorld(escorter.Location, escorter.Map);
                }

                Misc.FameKarmaTitles.AwardFame(escorter, 10, true);

                XmlQuest.RegisterEscort(this, escorter);

                StopFollow();
                SetControlMaster(null);
                m_EscortTable.Remove(escorter);
                BeginDelete();

                return(true);
            }

            return(false);
        }
コード例 #7
0
ファイル: BaseEscortable.cs プロジェクト: proxeeus/UORebirth
        public virtual bool IsAtDest()
        {
            EDI dest = GetDestination();

            if (dest == null)
            {
                return(false);
            }
            else
            {
                return(dest.Contains(Location));
            }
        }
コード例 #8
0
ファイル: BaseEscortable.cs プロジェクト: zerodowned/vivre-uo
        public virtual bool AcceptEscorter(Mobile m)
        {
            EDI dest = GetDestination();

            if (dest == null)
            {
                return(false);
            }

            Mobile escorter = GetEscorter();

            if (escorter != null || !m.Alive)
            {
                return(false);
            }

            BaseEscortable escortable = (BaseEscortable)m_EscortTable[m];

            if (escortable != null && !escortable.Deleted && escortable.GetEscorter() == m)
            {
                Say("Hélas, vous êtes déjà accompagnés.");
                return(false);
            }
            else if (m is PlayerMobile && (((PlayerMobile)m).LastEscortTime + EscortDelay) >= DateTime.Now)
            {
                int minutes = (int)Math.Ceiling(((((PlayerMobile)m).LastEscortTime + EscortDelay) - DateTime.Now).TotalMinutes);

                Say("Vous devez vous reposer {0} minute{1} avant que nous partions.", minutes, minutes == 1 ? "" : "s");
                return(false);
            }
            else if (SetControlMaster(m))
            {
                m_LastSeenEscorter = DateTime.Now;

                if (m is PlayerMobile)
                {
                    ((PlayerMobile)m).LastEscortTime = DateTime.Now;
                }

                Say("Allons! l'or sera vôtre une fois arrivés à {0}.", (dest.Name == "Ocllo" && m.Map == Map.Trammel) ? "Haven" : dest.Name);
                m_EscortTable[m] = this;
                StartFollow();
                return(true);
            }

            return(false);
        }
コード例 #9
0
        public override bool AcceptEscorter(Mobile m)
        {
            EDI dest = GetDestination();

            if (dest == null)
            {
                return(false);
            }

            Mobile escorter = GetEscorter();

            if (escorter != null || !m.Alive)
            {
                return(false);
            }

            BaseEscortable escortable = (BaseEscortable)EscortTable[m];

            if (escortable != null && !escortable.Deleted && escortable.GetEscorter() == m)
            {
                Say("I see you are already guiding a fellow spirit.");
                return(false);
            }
            else if (m is PlayerMobile && (((PlayerMobile)m).LastEscortTime + EscortDelay) >= DateTime.Now)
            {
                int minutes = (int)Math.Ceiling(((((PlayerMobile)m).LastEscortTime + EscortDelay) - DateTime.Now).TotalMinutes);

                Say("You must rest {0} minute{1} before can you guide me.", minutes, minutes == 1 ? "" : "s");
                return(false);
            }
            else if (SetControlMaster(m))
            {
                LastSeenEscorter = DateTime.Now;

                if (m is PlayerMobile)
                {
                    ((PlayerMobile)m).LastEscortTime = DateTime.Now;
                }

                Say("Thank you mortal, I shall reward you when we reach {0}.", (dest.Name == "Ocllo" && m.Map == Map.Trammel) ? "Haven" : dest.Name);
                EscortTable[m] = this;
                StartFollow();
                return(true);
            }

            return(false);
        }
コード例 #10
0
        public override void OnSpeech(SpeechEventArgs e)
        {
            base.OnSpeech(e);

            EDI dest = GetDestination();

            if (dest != null && !e.Handled && e.Mobile.InRange(this.Location, 3))
            {
                if (e.HasKeyword(0x1D))                     // *destination*
                {
                    e.Handled = SayDestinationTo(e.Mobile);
                }
                else if (e.HasKeyword(0x1E))                     // *i will take thee*
                {
                    e.Handled = AcceptEscorter(e.Mobile);
                }
            }
        }
コード例 #11
0
        public EDI GetDestination()
        {
            if (m_DestinationString == null && m_DeleteTimer == null)
            {
                m_DestinationString = PickRandomDestination();
            }

            if (m_Destination != null && m_Destination.Name == m_DestinationString)
            {
                return(m_Destination);
            }

            if (Map.Felucca.Regions.Count > 0)
            {
                return(m_Destination = EDI.Find(m_DestinationString));
            }

            return(m_Destination = null);
        }
コード例 #12
0
ファイル: BaseEscortable.cs プロジェクト: proxeeus/UORebirth
        public virtual bool CheckAtDestination()
        {
            Mobile escorter = GetEscorter();

            if (escorter == null)
            {
                return(false);
            }

            if (IsAtDest())
            {
                Say(1042809, escorter.Name);                   // We have arrived! I thank thee, ~1_PLAYER_NAME~! I have no further need of thy services. Here is thy pay.

                // not going anywhere
                m_Destination       = null;
                m_DestinationString = null;

                Container cont = escorter.Backpack;

                if (cont == null)
                {
                    cont = escorter.BankBox;
                }

                Gold gold = new Gold(GetGoldAmount());

                if (cont == null || !cont.TryDropItem(escorter, gold, false))
                {
                    gold.MoveToWorld(escorter.Location, escorter.Map);
                }

                StopFollow();
                SetControlMaster(null);
                BeginDelete();

                Misc.Titles.AlterNotoriety(escorter, 1, NotoCap.Honorable);
                return(true);
            }

            return(false);
        }
コード例 #13
0
        protected override void OnLocationChange(Point3D oldLocation)
        {
            base.OnLocationChange(oldLocation);

            if (oldLocation == Point3D.Zero)
            {
                EDI dest = GetDestination();

                if (dest != null && m_Message == null)
                {
                    if (m_Camp != null)
                    {
                        m_Message = new PrisonerMessage(m_Camp, this);
                    }
                    else
                    {
                        m_Message = new EscortMessage(this);
                    }
                }
            }
        }
コード例 #14
0
        public override void Serialize(GenericWriter writer)
        {
            base.Serialize(writer);

            writer.Write((int)0);                // version

            EDI dest = GetDestination();

            writer.Write(dest != null);

            if (dest != null)
            {
                writer.Write(dest.Name);
            }

            writer.Write(m_DeleteTimer != null);

            if (m_DeleteTimer != null)
            {
                writer.WriteDeltaTime(m_DeleteTime);
            }
        }
コード例 #15
0
        public virtual string PickRandomDestination()
        {
            if (Map.Felucca.Regions.Count == 0 || Map == null || Map == Map.Internal || Location == Point3D.Zero)
            {
                return(null);                // Not yet fully initialized
            }
            string[] possible = GetPossibleDestinations();
            string   picked   = null;

            while (picked == null)
            {
                picked = possible[Utility.Random(possible.Length)];
                EDI test = EDI.Find(picked);

                if (test != null && test.Contains(Location))
                {
                    picked = null;
                }
            }

            return(picked);
        }
コード例 #16
0
        public virtual bool SayDestinationTo(Mobile m)
        {
            EDI dest = GetDestination();

            if (dest == null || !m.Alive)
            {
                return(false);
            }

            Mobile escorter = GetEscorter();

            if (escorter == null)
            {
                Say(true, String.Format("I am waiting for my escort to {0}. If thou art interested, check the local bulletin board for details, or just say 'I will take thee.'", (dest.Name == "Ocllo" && m.Map == Map.Trammel) ? "Haven" : dest.Name));
                return(true);
            }
            else if (escorter == m)
            {
                Say(true, String.Format("Lead on! Payment will be made when we arrive in {0}.", (dest.Name == "Ocllo" && m.Map == Map.Trammel) ? "Haven" : dest.Name));
                return(true);
            }

            return(false);
        }
コード例 #17
0
        public override void Serialize(GenericWriter writer)
        {
            base.Serialize(writer);

            writer.Write((int)1); // version

            EDI dest = GetDestination();

            writer.Write(dest != null);

            if (dest != null)
            {
                writer.Write(dest.Name);
            }

            writer.Write(m_DeleteTimer != null);

            if (m_DeleteTimer != null)
            {
                writer.WriteDeltaTime(m_DeleteTime);
            }

            MLQuestSystem.WriteQuestRef(writer, StaticMLQuester ? null : m_MLQuest);
        }
コード例 #18
0
ファイル: BaseEscortable.cs プロジェクト: proxeeus/UORebirth
        public virtual bool SayDestinationTo(Mobile m)
        {
            EDI dest = GetDestination();

            if (dest == null || !m.Alive || m_DestinationString == null)
            {
                return(false);
            }

            Mobile escorter = GetEscorter();

            if (escorter == null)
            {
                Say("I am looking to go to {0}, will you take me?", m_DestinationString);
                return(true);
            }
            else if (escorter == m)
            {
                Say("Lead on! Payment will be made when we arrive in {0}.", m_DestinationString);
                return(true);
            }

            return(false);
        }
コード例 #19
0
        public EDI GetDestination()
        {
            if (MLQuestSystem.Enabled)
            {
                return(null);
            }

            if (m_DestinationString == null && m_DeleteTimer == null)
            {
                m_DestinationString = PickRandomDestination();
            }

            if (m_Destination != null && m_Destination.Name == m_DestinationString)
            {
                return(m_Destination);
            }

            if (Map.Malas.Regions.Count > 0)
            {
                return(m_Destination = EDI.Find(m_DestinationString));
            }

            return(m_Destination = null);
        }
コード例 #20
0
        public override bool SayDestinationTo(Mobile m)
        {
            EDI dest = GetDestination();

            if (dest == null || !m.Alive)
            {
                return(false);
            }

            Mobile escorter = GetEscorter();

            if (escorter == null)
            {
                Say("I wish to return to {0}, please kind mortal will you take me there?", (dest.Name == "Ocllo" && m.Map == Map.Trammel) ? "Haven" : dest.Name);
                return(true);
            }
            else if (escorter == m)
            {
                Say("Thank you mortal, I shall reward you when we reach {0}.", (dest.Name == "Ocllo" && m.Map == Map.Trammel) ? "Haven" : dest.Name);
                return(true);
            }

            return(false);
        }
コード例 #21
0
ファイル: BaseEscortable.cs プロジェクト: zerodowned/vivre-uo
        public virtual bool SayDestinationTo(Mobile m)
        {
            EDI dest = GetDestination();

            if (dest == null || !m.Alive)
            {
                return(false);
            }

            Mobile escorter = GetEscorter();

            if (escorter == null)
            {
                Say("Je cherche à me rendre à {0},m'y amènerez-vous?", (dest.Name == "Ocllo" && m.Map == Map.Trammel) ? "Haven" : dest.Name);
                return(true);
            }
            else if (escorter == m)
            {
                Say("Allons! l'or sera vôtre une fois arrivés à {0}.", (dest.Name == "Ocllo" && m.Map == Map.Trammel) ? "Haven" : dest.Name);
                return(true);
            }

            return(false);
        }
コード例 #22
0
        public virtual bool CheckAtDestination()
        {
            EDI dest = GetDestination();

            if (dest == null)
            {
                return(false);
            }

            Mobile escorter = GetEscorter();

            if (escorter == null)
            {
                return(false);
            }

            if (dest.Contains(Location))
            {
                Say(1042809, escorter.Name);                   // We have arrived! I thank thee, ~1_PLAYER_NAME~! I have no further need of thy services. Here is thy pay.

                // not going anywhere
                m_Destination       = null;
                m_DestinationString = null;

                Container cont = escorter.Backpack;

                if (cont == null)
                {
                    cont = escorter.BankBox;
                }

                Gold gold = new Gold(500, 1000);

                if (cont == null || !cont.TryDropItem(escorter, gold, false))
                {
                    gold.MoveToWorld(escorter.Location, escorter.Map);
                }

                StopFollow();
                SetControlMaster(null);
                m_EscortTable.Remove(escorter);
                BeginDelete();

                Misc.Titles.AwardFame(escorter, 10, true);

                bool gainedPath = false;

                PlayerMobile pm = escorter as PlayerMobile;

                if (pm != null)
                {
                    if (pm.CompassionGains > 0 && Core.Now > pm.NextCompassionDay)
                    {
                        pm.NextCompassionDay = DateTime.MinValue;
                        pm.CompassionGains   = 0;
                    }

                    if (pm.CompassionGains >= 5)                       // have already gained 5 points in one day, can gain no more
                    {
                        pm.SendLocalizedMessage(1053004);              // You must wait about a day before you can gain in compassion again.
                    }
                    else if (VirtueHelper.Award(pm, VirtueName.Compassion, 1, ref gainedPath))
                    {
                        if (gainedPath)
                        {
                            pm.SendLocalizedMessage(1053005);                               // You have achieved a path in compassion!
                        }
                        else
                        {
                            pm.SendLocalizedMessage(1053002);                               // You have gained in compassion.
                        }
                        pm.NextCompassionDay = Core.Now + TimeSpan.FromDays(1.0);           // in one day CompassionGains gets reset to 0
                        ++pm.CompassionGains;
                    }
                    else
                    {
                        pm.SendLocalizedMessage(1053003);                           // You have achieved the highest path of compassion and can no longer gain any further.
                    }
                }

                return(true);
            }

            return(false);
        }
コード例 #23
0
        public EDI GetDestination()
        {
            if ( m_DestinationString == null && m_DeleteTimer == null )
                m_DestinationString = PickRandomDestination();

            if ( m_Destination != null && m_Destination.Name == m_DestinationString )
                return m_Destination;

            if ( Map.Felucca.Regions.Count > 0 )
                return ( m_Destination = EDI.Find( m_DestinationString ) );

            return ( m_Destination = null );
        }
コード例 #24
0
        public virtual bool CheckAtDestination()
        {
            EDI dest = GetDestination();

            if ( dest == null )
                return false;

            Mobile escorter = GetEscorter();

            if ( escorter == null )
                return false;

            if ( dest.Contains( Location ) )
            {
                Say( 1042809, escorter.Name ); // We have arrived! I thank thee, ~1_PLAYER_NAME~! I have no further need of thy services. Here is thy pay.

                // not going anywhere
                m_Destination = null;
                m_DestinationString = null;

                Container cont = escorter.Backpack;

                if ( cont == null )
                    cont = escorter.BankBox;

                Gold gold = new Gold( 500, 1000 );

                if ( cont == null || !cont.TryDropItem( escorter, gold, false ) )
                    gold.MoveToWorld( escorter.Location, escorter.Map );

                StopFollow();
                SetControlMaster( null );
                m_EscortTable.Remove( escorter );
                BeginDelete();

                Misc.Titles.AwardFame( escorter, 10, true );

                bool gainedPath = false;

                PlayerMobile pm = escorter as PlayerMobile;

                if ( pm != null )
                {
                    if ( pm.CompassionGains > 0 && DateTime.Now > pm.NextCompassionDay )
                    {
                        pm.NextCompassionDay = DateTime.MinValue;
                        pm.CompassionGains = 0;
                    }

                    if ( pm.CompassionGains >= 5 ) // have already gained 5 points in one day, can gain no more
                    {
                        pm.SendLocalizedMessage( 1053004 ); // You must wait about a day before you can gain in compassion again.
                    }
                    else if ( VirtueHelper.Award( pm, VirtueName.Compassion, 1, ref gainedPath ) )
                    {
                        if ( gainedPath )
                            pm.SendLocalizedMessage( 1053005 ); // You have achieved a path in compassion!
                        else
                            pm.SendLocalizedMessage( 1053002 ); // You have gained in compassion.

                        pm.NextCompassionDay = DateTime.Now + TimeSpan.FromDays( 1.0 ); // in one day CompassionGains gets reset to 0
                        ++pm.CompassionGains;
                    }
                    else
                    {
                        pm.SendLocalizedMessage( 1053003 ); // You have achieved the highest path of compassion and can no longer gain any further.
                    }
                }

                return true;
            }

            return false;
        }
コード例 #25
0
ファイル: BaseEscortable.cs プロジェクト: Godkong/RunUO
        public virtual bool CheckAtDestination()
        {
            EDI dest = GetDestination();

            if ( dest == null )
                return false;

            Mobile escorter = GetEscorter();

            if ( escorter == null )
                return false;

            if ( dest.Contains( Location ) )
            {
                Say( true, String.Format("We have arrived! I thank thee, {0} I have no further need of thy services. Here is thy pay.", escorter.Name ) ); // We have arrived! I thank thee, ~1_PLAYER_NAME~! I have no further need of thy services. Here is thy pay.

                // not going anywhere
                m_Destination = null;
                m_DestinationString = null;

                Container cont = escorter.Backpack;

                if ( cont == null )
                    cont = escorter.BankBox;

                Gold gold = new Gold( 500, 750 );

                if ( !cont.TryDropItem( escorter, gold, false ) )
                    gold.MoveToWorld( escorter.Location, escorter.Map );

                StopFollow();
                SetControlMaster( null );
                m_EscortTable.Remove( escorter );
                BeginDelete();

                Misc.Titles.AwardKarma( escorter, 10, true );

                return true;
            }

            return false;
        }
コード例 #26
0
        public EDI GetDestination()
        {
            if (this.m_DestinationString == null && this.m_DeleteTimer == null)
                this.m_DestinationString = this.PickRandomDestination();

            if (this.m_Destination != null && this.m_Destination.Name == this.m_DestinationString)
                return this.m_Destination;

            if (Map.Felucca.Regions.Count > 0)
                return (this.m_Destination = EDI.Find(this.m_DestinationString));

            return (this.m_Destination = null);
        }
コード例 #27
0
        public override bool CheckAtDestination()
        {
            EDI dest = GetDestination();

            if (dest == null)
            {
                return(false);
            }

            Mobile escorter = GetEscorter();

            if (escorter == null)
            {
                return(false);
            }

            if (dest.Contains(Location))
            {
                Say("You have brought me home, I thank thee mortal and I hope this token of my appreciation helps you, now farewell!", escorter.Name);

                // not going anywhere
                Destination = null;
                //DestinationString = null;

                escorter.AddToBackpack(new SpiritGem());

                StopFollow();
                SetControlMaster(null);
                EscortTable.Remove(escorter);
                BeginDelete();

                Misc.Titles.AwardFame(escorter, 10, true);

                bool gainedPath = false;

                PlayerMobile pm = escorter as PlayerMobile;

                if (pm != null)
                {
                    if (pm.CompassionGains > 0 && DateTime.Now > pm.NextCompassionDay)
                    {
                        pm.NextCompassionDay = DateTime.MinValue;
                        pm.CompassionGains   = 0;
                    }

                    if (pm.CompassionGains >= 5)                     // have already gained 5 points in one day, can gain no more
                    {
                        pm.SendLocalizedMessage(1053004);            // You must wait about a day before you can gain in compassion again.
                    }
                    else if (VirtueHelper.Award(pm, VirtueName.Compassion, 1, ref gainedPath))
                    {
                        if (gainedPath)
                        {
                            pm.SendLocalizedMessage(1053005);                             // You have achieved a path in compassion!
                        }
                        else
                        {
                            pm.SendLocalizedMessage(1053002);                             // You have gained in compassion.
                        }
                        pm.NextCompassionDay = DateTime.Now + TimeSpan.FromDays(1.0);     // in one day CompassionGains gets reset to 0
                        ++pm.CompassionGains;
                    }
                    else
                    {
                        pm.SendLocalizedMessage(1053003);                         // You have achieved the highest path of compassion and can no longer gain any further.
                    }
                }

                return(true);
            }

            return(false);
        }
コード例 #28
0
        public virtual bool CheckAtDestination()
        {
            Mobile escorter = GetEscorter();

            if ( escorter == null )
                return false;

            if ( IsAtDest() )
            {
                Say( 1042809, escorter.Name ); // We have arrived! I thank thee, ~1_PLAYER_NAME~! I have no further need of thy services. Here is thy pay.

                // not going anywhere
                m_Destination = null;
                m_DestinationString = null;

                Container cont = escorter.Backpack;

                if ( cont == null )
                    cont = escorter.BankBox;

                Gold gold = new Gold( GetGoldAmount() );

                if ( cont == null || !cont.TryDropItem( escorter, gold, false ) )
                    gold.MoveToWorld( escorter.Location, escorter.Map );

                StopFollow();
                SetControlMaster( null );
                BeginDelete();

                Misc.Titles.AlterNotoriety( escorter, 1, NotoCap.Honorable );
                return true;
            }

            return false;
        }