Ejemplo n.º 1
0
        public bool TrySpawnCharybdis(Mobile from)
        {
            if (!m_Active)
            {
                from.SendLocalizedMessage(1150198); //The spyglass goes dark, it has failed to find what you seek.
                return(false);
            }

            else if (m_IsSummoned)
            {
                if (m_Charydbis != null && m_Charydbis.Alive)
                {
                    Point3D pnt = new Point3D(m_CurrentLocation.X + 5, m_CurrentLocation.Y + 5, -5);
                    from.SendMessage(string.Format("The location you seek is: {0} in {1}", GetSextantLocation(pnt), m_Map));
                }
                else if (m_HasSpawned && (m_Charydbis == null || !m_Charydbis.Alive))
                {
                    from.SendMessage("The creature you seek has already been slain.");
                }
                else
                {
                    from.SendLocalizedMessage(1150198); //The spyglass goes dark, it has failed to find what you seek.
                }
                return(false);
            }
            else if (DateTime.UtcNow < m_NextSpawn)
            {
                from.SendLocalizedMessage(1150198); //The spyglass goes dark, it has failed to find what you seek.
                return(false);
            }

            Map map = from.Map;

            if (map != Map.Felucca && map != Map.Trammel)
            {
                from.SendMessage("You can only summon Charydbis in Felucca or Trammel.");
                return(false);
            }

            m_Map = map;

            from.SendLocalizedMessage(1150190); //You peer into the spyglass, images swirl in your mind as the magic device searches.
            m_NextSpawn  = DateTime.UtcNow + NoSpawnDelay;
            m_IsSummoned = true;
            Point3D p = SOS.FindLocation(map);

            from.SendMessage(string.Format("The location you seek is: {0} in {1}", GetSextantLocation(p), m_Map));
            m_CurrentLocation = new Rectangle2D(p.X - 5, p.Y - 5, 10, 10);
            m_LastLocation    = m_CurrentLocation;
            m_Timer           = new InternalTimer(this, NoSpawnDelay);
            m_Timer.Start();
            m_LastAttempt = DateTime.UtcNow;
            return(true);
        }