Exemple #1
0
        public void EndDeadLineTimer()
        {
            if (DeadLineTimer != null)
            {
                DeadLineTimer.Stop();
                DeadLineTimer = null;
            }

            if (Guardian != null && Guardian.Alive) // Failed
            {
                Guardian.Delete();

                if (Summoner != null)
                {
                    Summoner.SendLocalizedMessage(1151628); // You failed to defeat the champion in time.
                }
                NextSummon = DateTime.UtcNow;
            }
        }
Exemple #2
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);
            int version = reader.ReadInt();

            Teleporter            = reader.ReadItem() as ShameTeleporter;
            TeleporterLocation    = reader.ReadPoint3D();
            TeleporterDestination = reader.ReadPoint3D();
            SpawnLocation         = reader.ReadPoint3D();
            Guardian     = reader.ReadMobile() as ShameGuardian;
            GuardianType = ScriptCompiler.FindTypeByName(reader.ReadString());
            Active       = reader.ReadBool();
            DeadLine     = reader.ReadDateTime();
            SummonCost   = reader.ReadInt();
            Summoner     = reader.ReadMobile();

            if (DeadLine > DateTime.UtcNow)
            {
                if (Guardian != null)
                {
                    Guardian.Altar = this;
                    StartDeadlineTimer();
                }
                else
                {
                    DeadLine = DateTime.MinValue;
                }
            }
            else if (Guardian != null)
            {
                Guardian.Delete();
                Guardian = null;

                NextSummon = DateTime.UtcNow;
            }

            if (Teleporter != null)
            {
                Teleporter.Altar = this;
            }
        }