Exemplo n.º 1
0
        public CharydbisSpawner()
        {
            m_Charydbis  = null;
            m_NextSpawn  = DateTime.UtcNow;
            m_IsSummoned = false;
            m_HasSpawned = false;

            Active = true;
        }
Exemplo n.º 2
0
        public void SpawnCharydbis(Mobile from, Point3D pnt, Map map, BaseBoat boat)
        {
            Effects.PlaySound(pnt, map, 0x668);

            m_Charydbis = new Charydbis(from);
            from.SendMessage("It seems as though you've snagged your hook.");

            Timer.DelayCall(TimeSpan.FromSeconds(11), new TimerStateCallback(DoTeleportEffect), new object[] { pnt, map });
            Timer.DelayCall(TimeSpan.FromSeconds(12), new TimerStateCallback(DoDelayedSpawn), new object[] { from, pnt, map, boat });
        }
Exemplo n.º 3
0
 public EffectsTimer(Charydbis mobile, Point3DList path, Direction dir, int imax)
     : base(TimeSpan.FromSeconds(0.25), TimeSpan.FromSeconds(0.25))
 {
     m_Dir    = dir;
     m_I      = 1;
     m_IMax   = imax;
     m_Path   = path;
     m_Mobile = mobile;
     Priority = TimerPriority.FiftyMS;
     this.Start();
 }
Exemplo n.º 4
0
        public void OnCharybdisKilled()
        {
            DateTime timeout = m_LastAttempt + KillDelay;

            if (m_LastAttempt + KillDelay < DateTime.UtcNow)
            {
                m_Charydbis = null;
                Reset();
            }
            else
            {
                TimeSpan ts = timeout - DateTime.UtcNow;
                m_NextSpawn = DateTime.UtcNow + ts;
                m_Timer     = new InternalTimer(this, ts);
                m_Timer.Start();
            }
        }
Exemplo n.º 5
0
        public void Reset()
        {
            if (m_Charydbis != null && m_Charydbis.Alive)
            {
                IPooledEnumerable eable = m_Charydbis.GetMobilesInRange(12);
                foreach (Mobile mob in eable)
                {
                    if (mob is PlayerMobile)
                    {
                        mob.SendMessage("Charydbis sinks to the depths of the ocean from which it came from...You have taken too long!");
                    }
                }
                eable.Free();

                for (int x = m_Charydbis.X - 1; x <= m_Charydbis.X + 1; x++)
                {
                    for (int y = m_Charydbis.Y - 1; y <= m_Charydbis.Y + 1; y++)
                    {
                        int splash = Utility.RandomList(0x352D, 0x5675);

                        Effects.SendLocationEffect(new Point3D(x, y, m_Charydbis.Z), m_Charydbis.Map, splash, 16, 4);
                        Effects.PlaySound(new Point3D(x, y, m_Charydbis.Z), m_Charydbis.Map, 0x364);
                    }
                }

                m_Charydbis.Delete();
            }

            m_Charydbis       = null;
            m_IsSummoned      = false;
            m_HasSpawned      = false;
            m_CurrentLocation = new Rectangle2D(0, 0, 0, 0);
            m_NextSpawn       = DateTime.UtcNow;

            if (m_Timer != null)
            {
                m_Timer.Stop();
            }
        }
Exemplo n.º 6
0
        public void Deserialize(GenericReader reader)
        {
            int version = reader.ReadInt();

            m_HasSpawned  = reader.ReadBool();
            m_LastAttempt = reader.ReadDateTime();
            m_Active      = reader.ReadBool();

            m_Charydbis       = reader.ReadMobile() as Charydbis;
            m_NextSpawn       = reader.ReadDateTime();
            m_IsSummoned      = reader.ReadBool();
            m_Map             = reader.ReadMap();
            m_CurrentLocation = reader.ReadRect2D();
            m_LastLocation    = reader.ReadRect2D();

            if (m_NextSpawn > DateTime.UtcNow)
            {
                m_Timer = new InternalTimer(this, m_NextSpawn - DateTime.UtcNow);
            }
            else
            {
                Reset();
            }
        }
Exemplo n.º 7
0
        public CharydbisSpawner()
        {
            m_Charydbis = null;
            m_NextSpawn = DateTime.UtcNow;
            m_IsSummoned = false;
            m_HasSpawned = false;

            Active = true;
        }
Exemplo n.º 8
0
        public void Deserialize(GenericReader reader)
        {
            int version = reader.ReadInt();

            m_HasSpawned = reader.ReadBool();
            m_LastAttempt = reader.ReadDateTime();
            m_Active = reader.ReadBool();

            m_Charydbis = reader.ReadMobile() as Charydbis;
            m_NextSpawn = reader.ReadDateTime();
            m_IsSummoned = reader.ReadBool();
            m_Map = reader.ReadMap();
            m_CurrentLocation = reader.ReadRect2D();
            m_LastLocation = reader.ReadRect2D();

            if (m_NextSpawn > DateTime.UtcNow)
                m_Timer = new InternalTimer(this, m_NextSpawn - DateTime.UtcNow);
            else
                Reset();
        }
Exemplo n.º 9
0
        public void Reset()
        {
            if (m_Charydbis != null && m_Charydbis.Alive)
            {
                IPooledEnumerable eable = m_Charydbis.GetMobilesInRange(12);
                foreach (Mobile mob in eable)
                {
                    if (mob is PlayerMobile)
                        mob.SendMessage("Charydbis sinks to the depths of the ocean from which it came from...You have taken too long!");
                }
                eable.Free();

                for (int x = m_Charydbis.X - 1; x <= m_Charydbis.X + 1; x++)
                {
                    for (int y = m_Charydbis.Y - 1; y <= m_Charydbis.Y + 1; y++)
                    {
                        int splash = Utility.RandomList(0x352D, 0x5675);

                        Effects.SendLocationEffect(new Point3D(x, y, m_Charydbis.Z), m_Charydbis.Map, splash, 16, 4);
                        Effects.PlaySound(new Point3D(x, y, m_Charydbis.Z), m_Charydbis.Map, 0x364);
                    }
                }

                m_Charydbis.Delete();
            }

            m_Charydbis = null;
            m_IsSummoned = false;
            m_HasSpawned = false;
            m_CurrentLocation = new Rectangle2D(0, 0, 0, 0);
            m_NextSpawn = DateTime.UtcNow;

            if (m_Timer != null)
                m_Timer.Stop();
        }
Exemplo n.º 10
0
        public void OnCharybdisKilled()
        {
            DateTime timeout = m_LastAttempt + KillDelay;

            if (m_LastAttempt + KillDelay < DateTime.UtcNow)
            {
                m_Charydbis = null;
                Reset();
            }
            else
            {
                TimeSpan ts = timeout - DateTime.UtcNow;
                m_NextSpawn = DateTime.UtcNow + ts;
                m_Timer = new InternalTimer(this, ts);
                m_Timer.Start();
            }
        }
Exemplo n.º 11
0
        public void SpawnCharydbis(Mobile from, Point3D pnt, Map map, BaseBoat boat)
        {
            Effects.PlaySound(pnt, map, 0x668);

            m_Charydbis = new Charydbis(from);
            from.SendMessage("It seems as though you've snagged your hook.");

            Timer.DelayCall(TimeSpan.FromSeconds(11), new TimerStateCallback(DoTeleportEffect), new object[] { pnt, map });
            Timer.DelayCall(TimeSpan.FromSeconds(12), new TimerStateCallback(DoDelayedSpawn), new object[] { from, pnt, map, boat });
        }
Exemplo n.º 12
0
 public EffectsTimer(Charydbis mobile, Point3DList path, Direction dir, int imax)
     : base(TimeSpan.FromSeconds(0.25), TimeSpan.FromSeconds(0.25))
 {
     m_Dir = dir;
     m_I = 1;
     m_IMax = imax;
     m_Path = path;
     m_Mobile = mobile;
     Priority = TimerPriority.FiftyMS;
     this.Start();
 }