Пример #1
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);
            int version = reader.ReadInt();

            switch (version)
            {
            case 1:
            {
                m_DeadLine  = reader.ReadDateTime();
                m_Boss      = reader.ReadMobile();
                m_Activated = reader.ReadBool();
                m_Active    = reader.ReadBool();
                m_WarpPoint = reader.ReadPoint3D();

                int count = reader.ReadInt();
                for (int i = 0; i < count; i++)
                {
                    Item map = reader.ReadItem();

                    if (map != null && !map.Deleted && map is CorgulIslandMap)
                    {
                        m_IslandMaps.Add(map);
                    }
                }

                break;
            }

            case 0:
            {
                m_DeadLine  = reader.ReadDateTime();
                m_Boss      = reader.ReadMobile();
                m_Activated = reader.ReadBool();
                m_Active    = reader.ReadBool();
                m_WarpPoint = reader.ReadPoint3D();
                //m_IslandMap = reader.ReadItem() as CorgulIslandMap;
                Item item = reader.ReadItem();
                break;
            }
            }

            InitializeBossRegion();

            if (m_Active && m_Activated && m_WarpPoint != Point3D.Zero)
            {
                if (m_DeadLine < DateTime.UtcNow || m_Boss == null || m_Boss.Deleted)
                {
                    Reset();
                }
                else
                {
                    Rectangle2D bounds = GetRectangle(m_WarpPoint);
                    m_WarpRegion = new CorgulWarpRegion(this, bounds);
                    m_WarpRegion.Register();
                    TimeSpan ts = m_DeadLine - DateTime.UtcNow;
                    m_DeadLineTimer = Timer.DelayCall(ts, new TimerCallback(OnDeadLine));
                }
            }
        }
Пример #2
0
 public void UnregisterWarpRegion()
 {
     if (m_WarpRegion != null)
     {
         m_WarpRegion.Unregister();
         m_WarpRegion = null;
     }
 }
Пример #3
0
        public CorgulAltar()
            : base(13807)
        {
            Movable      = false;
            Hue          = 2075;
            m_Activated  = false;
            m_Active     = true;
            m_WarpRegion = null;
            m_WarpPoint  = Point3D.Zero;
            m_KeyStage   = 0;

            Timer.DelayCall(TimeSpan.FromSeconds(1.0), InitializeBossRegion);
        }
Пример #4
0
        public void SpawnBoss(Mobile from)
        {
            //Spawn boss
            CorgulTheSoulBinder boss = new CorgulTheSoulBinder(this);

            boss.MoveToWorld(m_SpawnLoc, this.Map);
            boss.SpawnHelpers();
            m_Boss = boss;

            //create dummy spawn point and bounds for warp region
            m_WarpPoint = GetRandomWarpPoint();
            Rectangle2D bounds = GetRectangle(m_WarpPoint);

            //create region based on dummy spot and bounds
            m_WarpRegion = new CorgulWarpRegion(this, bounds);
            m_WarpRegion.Register();
            m_Activated = true;
        }
Пример #5
0
        public override void Delete()
        {
            Active = false;
            Reset();

            if (m_BossRegion != null)
            {
                m_BossRegion.Unregister();
                m_BossRegion = null;
            }

            if (m_WarpRegion != null)
            {
                m_WarpRegion.Unregister();
                m_WarpRegion = null;
            }

            base.Delete();
        }