Contains() 공개 메소드

public Contains ( Point3D p ) : bool
p Point3D
리턴 bool
예제 #1
0
        public virtual bool CheckAtDestination()
        {
            EDI dest = GetDestination();

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

            if (dest.Contains(Location))
            {
                Say("Ah! Thank the heavens! I am safe and sound! Here is thy pay as promised!");

                Timer.DelayCall(TimeSpan.FromSeconds(5), delegate
                {
                    if (this != null)
                    {
                        Delete();
                    }
                });

                return(true);
            }

            return(false);
        }
예제 #2
0
        public virtual string PickRandomDestination()
        {
            if (Map.Felucca.Regions.Count == 0 || this.Map == null || this.Map == Map.Internal || this.Location == Point3D.Zero)
            {
                return(null); // Not yet fully initialized
            }
            string[] possible = this.GetPossibleDestinations();
            string   picked   = null;

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

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

            return(picked);
        }
예제 #3
0
        public virtual string PickRandomDestination()
        {
            if (Map.Felucca.Regions.Count == 0 || Map == null || Map == Map.Internal || Location == Point3D.Zero)
            {
                return(null);
            }

            string[] possible = destinations;
            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);
        }
예제 #4
0
        public virtual bool CheckAtDestination()
        {
            EDI dest = this.GetDestination();

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

            Mobile escorter = this.GetEscorter();

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

            if (dest.Contains(this.Location))
            {
                this.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
                this.m_Destination       = null;
                this.m_DestinationString = null;

                Container cont = escorter.Backpack;

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

                //Gold gold = new Gold(500, 1000);

                #region BBS Quests

                Gold gold;

                if (this.IsPrisoner)
                {
                    gold = new Gold(1000, 1500);
                }
                else
                {
                    gold = new Gold(500, 750);
                }

                #endregion

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

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

                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 times 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, this.IsPrisoner ? 400 : 200, 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;
                    //} UOSI
                    else
                    {
                        pm.SendLocalizedMessage(1053003);     // You have achieved the highest path of compassion and can no longer gain any further.
                    }
                }

                return(true);
            }

            return(false);
        }
        public virtual bool CheckAtDestination()
        {
            EscortDestinationInfo 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);
                }

                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.
                    }
                }

                XmlQuest.RegisterEscort(this, escorter);

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

                return(true);
            }

            return(false);
        }