Exemplo n.º 1
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);
            }

            TalkingBaseEscortable escortable = (TalkingBaseEscortable)m_EscortTable[m];

            if (escortable != null && !escortable.Deleted && escortable.GetEscorter() == m)
            {
                Say("I see you already have an escort.");
                return(false);
            }
            else if (m is PlayerMobile && (((PlayerMobile)m).LastEscortTime + m_EscortDelay) >= DateTime.UtcNow)
            {
                int 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");
                return(false);
            }
            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);
        }
Exemplo n.º 2
0
        public static new void Initialize()
        {
            foreach (Mobile m in World.Mobiles.Values)
            {
                if (m is TalkingBaseEscortable)
                {
                    // reestablish the DialogAttachment assignment
                    XmlDialog xa = (XmlDialog)XmlAttach.FindAttachment(m, typeof(XmlDialog));
                    ((TalkingBaseCreature)m).DialogAttachment = xa;

                    // initialize Destination after world load (now, regions are loaded)
                    TalkingBaseEscortable t = ((TalkingBaseEscortable)m);
                    t.Destination = t.m_DestinationString;
                }
            }
        }
Exemplo n.º 3
0
 public AbandonTalkingEscortEntry(TalkingBaseEscortable m, Mobile from) : base(6102, 3)
 {
     m_Mobile = m;
     m_From   = from;
 }
Exemplo n.º 4
0
 public AcceptTalkingEscortEntry(TalkingBaseEscortable m, Mobile from) : base(6101, 3)
 {
     m_Mobile = m;
     m_From   = from;
 }
Exemplo n.º 5
0
 public AskTalkingDestinationEntry(TalkingBaseEscortable m, Mobile from) : base(6100, 3)
 {
     m_Mobile = m;
     m_From   = from;
 }
Exemplo n.º 6
0
 public AbandonTalkingEscortEntry(TalkingBaseEscortable m, Mobile from)
     : base(6102, 3)
 {
     this.m_Mobile = m;
     this.m_From = from;
 }
Exemplo n.º 7
0
 public AcceptTalkingEscortEntry(TalkingBaseEscortable m, Mobile from)
     : base(6101, 3)
 {
     this.m_Mobile = m;
     this.m_From = from;
 }
Exemplo n.º 8
0
 public AskTalkingDestinationEntry(TalkingBaseEscortable m, Mobile from)
     : base(6100, 3)
 {
     this.m_Mobile = m;
     this.m_From = from;
 }