UO-Dev Arama


Yazar: Bilinmiyor
Tarih: 30-08-2009 15:52


Paylaş : Paylaş

Kod:
//GM Arthanys - GameSFoR.neT

using System;
using Server.Items;
using Server.Mobiles;
using Server.Network;
using System.Collections;
using Server.ContextMenus;

namespace Server.Items
{
   public class AutoResStone : Item
   {

      private Mobile m_Owner;

      [Constructable]
      public AutoResStone() : base( 7964 )
      {
         Movable = true;
         Name = "Auto Res Stone";
       Hue = Utility.RandomList( 2970 );
         LootType = LootType.Blessed;
      }

        public override DeathMoveResult OnInventoryDeath(Mobile parent)
        {
            if ( parent == m_Owner )
            {
                new AutoResTimer( parent ).Start();
            }
            return base.OnInventoryDeath (parent);
        }

        private class AutoResTimer : Timer
        {
            private Mobile m_Mobile;
            public AutoResTimer( Mobile mob ) : base( TimeSpan.FromSeconds( 5.0 ) )
            {
                m_Mobile = mob;
            }

            protected override void OnTick()
            {
                m_Mobile.Resurrect();


                m_Mobile.Hits = m_Mobile.HitsMax;
                m_Mobile.Stam = m_Mobile.StamMax;
                m_Mobile.Mana = m_Mobile.ManaMax;

                m_Mobile.SendMessage( "¤Res¤ you should be more careful in the future." );
               
                new BlessedTimer( m_Mobile ).Start();
                m_Mobile.SendMessage( "¤Res¤ You will be blessed for 30 seconds." );

                m_Mobile.Blessed = true;
                Stop();
            }
            }

        private class BlessedTimer : Timer
        {
            private Mobile m_Mobile;
            public int cnt;

            public BlessedTimer( Mobile mob ) : base( TimeSpan.FromSeconds( 15.0 ), TimeSpan.FromSeconds( 15.0 ) )
            {
                m_Mobile = mob;
                cnt = 30;
            }

            protected override void OnTick()
            {
                if( cnt > 0 )
                {
                    cnt -= 15;
                    m_Mobile.SendMessage( "You will be blessed for {0} more seconds.", cnt );
                }
                if( cnt == 0 )
                {
                    m_Mobile.SendMessage( "You are no longer blessed." );
                    m_Mobile.Blessed = false;
                    this.Stop();
                        }
                if( cnt < 0 )
                {
                    cnt = 0;
                    m_Mobile.SendMessage( "You are no longer blessed." );
                    m_Mobile.Blessed = false;
                    this.Stop();
                }
            }
            }

        public override void OnDoubleClick(Mobile from)
        {
            // set owner if not already set -- this is only done the first time.
            if ( m_Owner == null )
            {
                m_Owner = from;
                this.Name = m_Owner.Name.ToString() + "'s Auto Res Stone";
                from.SendMessage( "This orb has been assigned to you." );
            }
            else
            {
                if ( m_Owner != from )
                {
                    from.SendMessage( "This is not yours to use." );
                    return;
                }
            }
        }

      public AutoResStone( Serial serial ) : base( serial )
      {
      }

      public override void Serialize( GenericWriter writer )
      {
         base.Serialize( writer );

         writer.Write( (int) 0 ); // version
      }

      public override void Deserialize( GenericReader reader )
      {
         base.Deserialize( reader );

         int version = reader.ReadInt();
      }
   }
}



Yorumlar

Henüz yorum yapılmamıştır.

Oylamalar

Oylama :
Üyelerin oylama ortalaması (10 dışında) : Henüz Oylanmamış   
Oylar: 0

Benzer Sayfalar

SayfalarYorumlarGönderenTarih
Potion Stone0Roes13-10-2011
Auto LOOT [Lock]0Xearth14-07-2010
Herkesi Stone Etme0tyr1010-07-2010
Durum Stone0Strike31-03-2010
Duyuru Stone0Andrien07-03-2010


Keywords:

ultima online, RunUO, ultima online download, sphere scripting, role play, uo grafik, second age ultima, uo loop, macroman, pvp server, server kurulumu, sphere, multool, ml mulls, 56b 55r 55i, htmlgumps, client 4x, client edit, sphere release, osi, rp server, sunucular, ghost mouse, inside uo, kingdom reborn, stygian abyss, uo nasıl oynanır, mondain's legacy, age of shadows, world build, grandmaster, ultima online pvp, player dosyaları, ultima online indir, frp game, RunUO 1.0.0, razor, uo rice, hue editör, skill tools, ultima online patch, axis, world build, verdata, verdata patcher, map editör, gump editör, mul patcher, aos mulls, scriptler, anim edit, anim publish, hues mul, hosting vps, event dialog, account sistemi, skill gain, static yapımı,