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