Esempio n. 1
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);
        }
Esempio n. 2
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))
                {
                    if (escorter.Map != null && escorter.Map != Map.Internal)
                    {
                        gold.MoveToWorld(escorter.Location, escorter.Map);
                    }
                    else
                    {
                        gold.Delete();
                    }
                }

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

                bool gainedPath = false;

                PlayerMobile pm = escorter as PlayerMobile;

                if (pm != null)
                {
                    if (pm.CompassionGains > 0 && DateTime.UtcNow > 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.UtcNow + 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.
                    }
                }

                XmlQuest.RegisterEscort(this, escorter);

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

                return(true);
            }

            return(false);
        }