Esempio n. 1
0
            protected override void OnTick()
            {
                TimeSpan delay = m_Res - DateTime.Now;

                if (DateTime.Now - m_LastSecond > TimeSpan.FromSeconds(1))
                {
                    m_GumpItem.Message = delay.Hours + ":" + delay.Minutes + ":" + delay.Seconds;
                    m_LastSecond       = DateTime.Now;
                }
                if (DateTime.Now > m_Res)
                {
                    if (m_Mob.Corpse != null && !m_Mob.Corpse.Deleted)
                    {
                        m_Mob.Corpse.Delete();
                    }

                    if (!m_Mob.Alive)
                    {
                        m_Mob.Location = m_Team.Home;
                        m_Mob.Map      = m_Team.HomeMap;
                        m_Mob.Resurrect();
                        m_Mob.Hits = m_Mob.HitsMax;
                        m_Mob.Mana = m_Mob.ManaMax;
                    }
                    GameInfoGump.RemoveCustomMessage((PlayerMobile)m_Mob, m_GumpItem);
                    Stop();
                }
            }
Esempio n. 2
0
            public DeathTimer(Mobile m, CTFTeam t, CTFGame g, TimeSpan DeathDelay) : base(TimeSpan.Zero, TimeSpan.FromMilliseconds(250))
            {
                m_Mob  = m;
                m_Team = t;
                m_Game = g;
                m_Res  = DateTime.Now + DeathDelay;

                if (m is PlayerMobile)
                {
                    m_GumpItem = new CustomGumpItem("Resurrect in", DeathDelay.Hours + ":" + DeathDelay.Minutes + ":" + DeathDelay.Seconds, m_Game, (PlayerMobile)m);
                    GameInfoGump.AddCustomMessage((PlayerMobile)m, m_GumpItem);
                }
                Priority = TimerPriority.TwoFiftyMS;
            }