Geri git   GaMeSFoR.NeT ™ > Diğer Online Oyunlar (Rpg) > Ultima Online > RunUO 1.0 Script

Etiketler: ,

  Yeni Konu aç Cevapla
Alt 03-23-2008   #1 (permalink)
wWw.GameSFoR.neT
  Wipau - ait Kullanıcı Resmi (Avatar)
 
Activity Longevity
2/20 20/20
Today Mesajlar
0/0 sssss1879

Bulunduğu yer: Gayseri'den
Favori Oyunu: Knight Online, Battlefield 2, Generals ve Ultima Online
REP Gücü: 200000
REP Puanı: 7807
Wipau has a reputation beyond reputeWipau has a reputation beyond reputeWipau has a reputation beyond reputeWipau has a reputation beyond reputeWipau has a reputation beyond reputeWipau has a reputation beyond reputeWipau has a reputation beyond reputeWipau has a reputation beyond reputeWipau has a reputation beyond reputeWipau has a reputation beyond reputeWipau has a reputation beyond repute
Wipau - MSN üzeri Mesaj gönder Wipau - YAHOO üzeri Mesaj gönder
Standart Stable Stone (Stable taşı)


Kod:
using System; 
using System.Collections; 
using Server.Items; 
using Server.Misc; 
using Server.Network; 
using Server.Mobiles; 
using Server.Multis; 
using Server.Gumps;
using Server.Targeting;
using Server.ContextMenus;
namespace Server.Items 
{ 
public class StableStone : Item
    { 

              [Constructable] 
              public StableStone() : base( 0x1F1C ) 
              { 
                 Name = "The Stable Stone"; 
                 Movable = true;
              LootType = LootType.Blessed; 
                  Hue = 1153;

                  } 

              public StableStone( Serial serial ) : base( serial ) 
              { 
              } 
        private class StableEntry : ContextMenuEntry
        {
            private StableStone m_Trainer;
            private Mobile m_From;

            public StableEntry( StableStone trainer, Mobile from ) : base( 6126, 12 )
            {
                m_Trainer = trainer;
                m_From = from;
            }

            public override void OnClick()
            {
                m_Trainer.BeginStable( m_From );
            }
        }

        public override void GetContextMenuEntries( Mobile from, ArrayList list )
        {
            base.GetContextMenuEntries( from, list );
            if ( from.Alive )
            {
                list.Add( new StableEntry( this, from ) );

                if ( from.Stabled.Count > 0 )
                    list.Add( new ClaimListEntry( this, from ) );
            }
        }
        public static int GetMaxStabled( Mobile from )
        {
            double taming = from.Skills[SkillName.AnimalTaming].Value;
            double anlore = from.Skills[SkillName.AnimalLore].Value;
            double vetern = from.Skills[SkillName.Veterinary].Value;
            double sklsum = taming + anlore + vetern;

            int max;

            if ( sklsum >= 240.0 )
                max = 5;
            else if ( sklsum >= 200.0 )
                max = 4;
            else if ( sklsum >= 160.0 )
                max = 3;
            else
                max = 2;

            if ( taming >= 100.0 )
                max += (int)((taming - 90.0) / 10);

            if ( anlore >= 100.0 )
                max += (int)((anlore - 90.0) / 10);

            if ( vetern >= 100.0 )
                max += (int)((vetern - 90.0) / 10);

            return max;
        }
        private class StableTarget : Target
        {
            private StableStone m_Trainer;

            public StableTarget( StableStone trainer ) : base( 12, false, TargetFlags.None )
            {
                m_Trainer = trainer;
            }

            protected override void OnTarget( Mobile from, object targeted )
            {
                if ( targeted is BaseCreature )
                    m_Trainer.EndStable( from, (BaseCreature)targeted );
                else if ( targeted == from )
                        from.SendMessage ("HA HA HA! Sorry, the stable stone isnt an inn!");
                else
                        from.SendMessage ("You can't stable that!");
            }
        }
        public void BeginStable( Mobile from )
        {
            if ( Deleted || !from.CheckAlive() )
                return;

            if ( from.Stabled.Count >= GetMaxStabled( from ) )
            {
                        from.SendMessage ("You can't stable that! You Have too many ets stabled, you have reached your max amount");
            }
            else
            {
                        from.SendMessage ("The Stable Stone Charges 30 Gold, per pet for each Real World week!");
                        from.SendMessage ("the gold is automaticly withdrawn form your bank account");
                        from.SendMessage ("Target the Animal you Wish to stable!");
                from.Target = new StableTarget( this );
            }
        }

        public void EndStable( Mobile from, BaseCreature pet )
        {
            if ( Deleted || !from.CheckAlive() )
                return;

            if ( !pet.Controled || pet.ControlMaster != from )
            {
                        from.SendMessage ("You do not own that pet!");
            }
            else if ( pet.IsDeadPet )
            {
                        from.SendMessage ("Living pets only, please!");
            }
            else if ( pet.Summoned )
            {
                        from.SendMessage ("You can not stable summoned creatures");
            }
            else if ( pet.Body.IsHuman )
            {
                        from.SendMessage ("You do not own that pet!");
            }
            else if ( (pet is PackLlama || pet is PackHorse || pet is Beetle) && (pet.Backpack != null && pet.Backpack.Items.Count > 0) )
            {
                        from.SendMessage ("You need to unload the Pack Animal Befor You Can Stable It!");
            }
            else if ( pet.Combatant != null && pet.InRange( pet.Combatant, 12 ) && pet.Map == pet.Combatant.Map )
            {
                        from.SendMessage (" Your pet seems to be busy at the moment, try agen when its not!");
            }
            else if ( from.Stabled.Count >= GetMaxStabled( from ) )
            {
                        from.SendMessage (" You have too many pets in the stables!");
            }
            else
            {
                Container bank = from.BankBox;

                if ( bank != null && bank.ConsumeTotal( typeof( Gold ), 30 ) )
                {
                    pet.ControlTarget = null;
                    pet.ControlOrder = OrderType.Stay;
                    pet.Internalize();

                    pet.SetControlMaster( null );
                    pet.SummonMaster = null;

                    pet.IsStabled = true;
                    from.Stabled.Add( pet );
                        from.SendMessage ("thy pet is stabled. Thou mayst recover it by saying 'claim' to me. In one real world week,");
                        from.SendMessage ("if your pet is not claimed by then, I shall sell it off if it is not claimed!");
                }
                else
                {
                        from.SendMessage ("You Lack The nessasary bank funds to do this");
                }
            }
        }
        private class ClaimListGump : Gump
        {
            private StableStone m_Trainer;
            private Mobile m_From;
            private ArrayList m_List;

            public ClaimListGump( StableStone trainer, Mobile from, ArrayList list ) : base( 50, 50 )
            {
                m_Trainer = trainer;
                m_From = from;
                m_List = list;

                from.CloseGump( typeof( ClaimListGump ) );

                AddPage( 0 );

                AddBackground( 0, 0, 325, 120 + (list.Count * 20), 9250 );
                AddAlphaRegion( 5, 5, 325, 120 + (list.Count * 20) );

                AddHtml( 15, 15, 275, 20, "<BASEFONT COLOR=#FFFFFF>Select a pet to retrieve from the stables:</BASEFONT>", false, false );

                for ( int i = 0; i < list.Count; ++i )
                {
                    BaseCreature pet = list[i] as BaseCreature;

                    if ( pet == null || pet.Deleted )
                        continue;
            AddLabel(32, 35, 160, "Pet Name");AddLabel(175, 35, 160, "Pet Bonded?");
            AddLabel(32, 65 + (i * 20), 55,  pet.Name);
            AddLabel(175, 65 + (i * 20), 55,  pet.IsBonded.ToString());
                    AddButton( 15, 69 + (i * 20), 10006, 10006, i + 1, GumpButtonType.Reply, 0 );
            //        AddHtml( 32, 35 + (i * 20), 275, 18,  pet.Name, pet.Title , "Bonded? " , pet.IsBonded , false, false );
                }
            }

            public override void OnResponse( NetState sender, RelayInfo info )
            {
                int index = info.ButtonID - 1;

                if ( index >= 0 && index < m_List.Count )
                    m_Trainer.EndClaimList( m_From, m_List[index] as BaseCreature );
            }
        }

        private class ClaimAllEntry : ContextMenuEntry
        {
            private StableStone m_Trainer;
            private Mobile m_From;

            public ClaimAllEntry( StableStone trainer, Mobile from ) : base( 6127, 12 )
            {
                m_Trainer = trainer;
                m_From = from;
            }

            public override void OnClick()
            {
                m_Trainer.Claim( m_From );
            }
        }
        
        public void BeginClaimList( Mobile from )
        {
            if ( Deleted || !from.CheckAlive() )
                return;

            ArrayList list = new ArrayList();

            for ( int i = 0; i < from.Stabled.Count; ++i )
            {
                BaseCreature pet = from.Stabled[i] as BaseCreature;

                if ( pet == null || pet.Deleted )
                {
                    pet.IsStabled = false;
                    from.Stabled.RemoveAt( i );
                    --i;
                    continue;
                }

                list.Add( pet );
            }

            if ( list.Count > 0 )
                from.SendGump( new ClaimListGump( this, from, list ) );
            else
                        from.SendMessage ("But I have no animals stabled with me at the moment!");
        }

        public void EndClaimList( Mobile from, BaseCreature pet )
        {
            if ( pet == null || pet.Deleted || from.Map != this.Map || !from.Stabled.Contains( pet ) || !from.CheckAlive() )
                return;

            if ( (from.Followers + pet.ControlSlots) <= from.FollowersMax )
            {
                pet.SetControlMaster( from );

                if ( pet.Summoned )
                    pet.SummonMaster = from;

                pet.ControlTarget = from;
                pet.ControlOrder = OrderType.Follow;

                pet.MoveToWorld( from.Location, from.Map );

                pet.IsStabled = false;
                from.Stabled.Remove( pet );
                        from.SendMessage ("Here you go...");
            }
            else
            {
                        from.SendMessage ( "That Pet remained in the stables because you have too many followers");
            }
        }
        public void Claim( Mobile from )
        {
            if ( Deleted || !from.CheckAlive() )
                return;

            bool claimed = false;
            int stabled = 0;

            for ( int i = 0; i < from.Stabled.Count; ++i )
            {
                BaseCreature pet = from.Stabled[i] as BaseCreature;

                if ( pet == null || pet.Deleted )
                {
                    pet.IsStabled = false;
                    from.Stabled.RemoveAt( i );
                    --i;
                    continue;
                }

                ++stabled;

                if ( (from.Followers + pet.ControlSlots) <= from.FollowersMax )
                {
                    pet.SetControlMaster( from );

                    if ( pet.Summoned )
                        pet.SummonMaster = from;

                    pet.ControlTarget = from;
                    pet.ControlOrder = OrderType.Follow;
            pet.Location = new Point3D( pet.X, pet.Y, 0 );
                    World.AddMobile( pet );
                    pet.IsStabled = false;
                    from.Stabled.RemoveAt( i );
                    --i;

                    claimed = true;
                    
                }
                else
                {
                        from.SendMessage ("That Pet remained in the stables because you have too many followers");
                }
            }

            if ( claimed )
                        from.SendMessage (" Here you go...");

            if ( stabled == 0 )
                        from.SendMessage ("But I have no animals stabled with me at the moment!");
        }
              public override bool HandlesOnSpeech{ get{ return true; } } 
        public override void OnSpeech( SpeechEventArgs e )
        {
            if ( !e.Handled && e.HasKeyword( 0x0008 ) )
            {
                e.Handled = true;
                BeginStable( e.Mobile );
            }
            else if ( !e.Handled && e.HasKeyword( 0x0009 ) )
            {
                e.Handled = true;

                if ( !Insensitive.Equals( e.Speech, "Claim" ) )
                    BeginClaimList( e.Mobile );
                else
                    BeginClaimList( e.Mobile );
            }
            else
            {
                base.OnSpeech( e );
            }
        }
        private class ClaimListEntry : ContextMenuEntry
        {
            private StableStone m_Trainer;
            private Mobile m_From;

            public ClaimListEntry( StableStone trainer, Mobile from ) : base( 6146, 12 )
            {
                m_Trainer = trainer;
                m_From = from;
            }

            public override void OnClick()
            {
                m_Trainer.BeginClaimList( m_From );
                       m_From.PlaySound( 1050 );
            }
        }
              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(); 
              } 
       } 
}
__________________
Lütfen Paylaşımlara REP Veriniz..
Paylaşımlarda Şifre Çıkarsa
:
[Sadece Kayıtlı Kullanıcılar Linkleri Görebilir. Üye OL...] veya gamesfor.net




Wipau isimli Üye şimdilik offline konumundadır   Alıntı ile Cevapla
Sponsor Reklamlar..
  Yeni Konu aç Cevapla

Seçenekler
Stil

Yetkileriniz
Yeni Mesaj yazma yetkiniz Aktif değil dir.
Mesajlara Cevap verme yetkiniz aktif değil dir.
Eklenti ekleme yetkiniz Aktif değil dir.
Kendi Mesajınızı değiştirme yetkiniz Aktif değildir dir.

BB code is Açık
Smileler Açık
[IMG] Kodları Açık
HTML-KodlarıKapalı
Trackbacks are Açık
Pingbacks are Açık
Refbacks are Açık


Bütün Zaman Ayarları WEZ +2 olarak düzenlenmiştir. Şu Anki Saat: 15:05 .
Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.

GameSFoR.NeT Kendi Sunucusunda Dosya Barındırmaz. Çeşitli Dosya Paylaşım Sitelerinin Linkleri Yayınlanır. Dosya İçeriklerinin Sorumluluğu, İndiren Kişiye ve Dosyayı Barındıran Sunucuya Aittir. Sitedeki materyallerin(kategori, resim, logo vs.) kopyalanması için izin alınmalıdır.. Report Abuse, Harassment, Scamming, Hacking, Warez, Crack, Divx, Mp3 or any Illegal Activity to wipau@gamesfor.net
Oyun merkezi | Full oyun indir | Rip oyun indir | Rip games download | Torrent oyun yükle | No-cd, serial, keygen indir | Oyun hileleri, ipuçları ve trainerları | Knight Online | 1299 Private Serverlar - Pw | Oyun motorları | Counter strike | World of Warcraft | Oyun yama & eklentileri | Türkçe dil yamaları | Oyun videoları | Oyun incelemeleri | Oyun görüntüleri | RIP Oyunlar | Demo oyunlar | Oyun incelemeleri | Popüler oyunlar | Oyun konsolları | Flash oyunlar | Cep telefonu | Oyun download | Kayıtlı oyunlar (Save Game) | Online oyunlar | Web oyunları | Futbol | Nfs indir | Gta indir | Türk Oyunları | Silkroad, Isro Bot, AgBot | WarrocK | Cep Telefon Oyunları | Webmaster | sXe Injected
Dost Siteler
Sitemap
1, 7, 2, 6, 8, 9, 141, 11, 12, 13, 14, 15, 16, 18, 19, 142, 22, 144, 24, 25, 27, 28, 140, 32, 33, 35, 36, 37, 38, 39, 40, 42, 41, 43, 45, 46, 47, 48, 50, 51, 52, 53, 54, 55, 56, 57, 143, 59, 60, 61, 62, 63, 64, 65, 66, 74, 68, 69, 70, 71, 72, 73, 75, 76, 77, 78, 79, 80, 81, 82, 87, 84, 85, 86, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 131, 132, 202, 133, 134, 135, 136, 137, 138, 139, 145, 146, 147, 148, 149, 150, 151, 152, 153, 155, 154, 156, 157, 159, 158, 160, 161, 162, 163, 164, 167, 165, 166, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 180, 181, 182, 183, 184, 185, 186, 201, 187, 188, 200, 189, 190, 191, 192, 193, 194, 195, 199, 196, 197, 198, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 224, 221, 222, 223, 225, 226, 231, 227, 229, 232, 228, 230, 233, 234, 235, 236, 238, 237, 239, 240, 241, 249, 244, 247, 242, 243, 245, 246, 255, 248, 250, 251, 252, 253, 254, 257, 256, 258, 259,