protected override void OnTarget(Mobile from, object targ)
 {
     if (targ is BaseCreature)
     {
         BaseCreature bc = (BaseCreature)targ;
         if (from.InRange(bc, 1))
         {
             if (bc.ControlMaster != from)
             {
                 from.SendMessage("You can only put a bridle on your own animal!");
             }
             else
             {
                 if (targ is WildHorse)
                 {
                     Horse h = new Horse();
                     h.Body = bc.Body;
                     ConvertAnimal(bc, h);
                     br.Consume();
                 }
                 else if (targ is Llama)
                 {
                     RidableLlama rl = new RidableLlama();
                     ConvertAnimal(bc, rl);
                     br.Consume();
                 }
                 else if (targ is WildDesertOstard)
                 {
                     DesertOstard dost = new DesertOstard();
                     ConvertAnimal(bc, dost);
                     br.Consume();
                 }
                 else if (targ is WildFireSteed)
                 {
                     FireSteed fs = new FireSteed();
                     ConvertAnimal(bc, fs);
                     br.Consume();
                 }
                 else if (targ is WildForestOstard)
                 {
                     ForestOstard fost = new ForestOstard();
                     ConvertAnimal(bc, fost);
                     br.Consume();
                 }
                 else if (targ is WildFrenziedOstard)
                 {
                     FrenziedOstard fzost = new FrenziedOstard();
                     ConvertAnimal(bc, fzost);
                     br.Consume();
                 }
                 else if (targ is WildHiryu)
                 {
                     Hiryu hi = new Hiryu();
                     ConvertAnimal(bc, hi);
                     br.Consume();
                 }
                 else if (targ is WildLesserHiryu)
                 {
                     LesserHiryu lh = new LesserHiryu();
                     ConvertAnimal(bc, lh);
                     br.Consume();
                 }
                 else if (targ is WildNightmare)
                 {
                     Nightmare nm = new Nightmare();
                     ConvertAnimal(bc, nm);
                     br.Consume();
                 }
                 else if (targ is WildRidgeback)
                 {
                     Ridgeback rb = new Ridgeback();
                     ConvertAnimal(bc, rb);
                     br.Consume();
                 }
                 else if (targ is WildSavageRidgeback)
                 {
                     SavageRidgeback sr = new SavageRidgeback();
                     ConvertAnimal(bc, sr);
                     br.Consume();
                 }
                 else if (targ is WildSilverSteed)
                 {
                     SilverSteed ss = new SilverSteed();
                     ConvertAnimal(bc, ss);
                     br.Consume();
                 }
                 else if (targ is WildSwampDragon)
                 {
                     SwampDragon sd = new SwampDragon();
                     ConvertAnimal(bc, sd);
                     br.Consume();
                 }
                 else
                 {
                     from.SendMessage("You can't put a bridle on that.");
                 }
             }
         }
         else
         {
             from.SendMessage("That's too far away");
         }
     }
     else
     {
         from.SendMessage("You can't put a bridle on that.");
     }
 }
        public override void Damage(Mobile m)
        {
            base.Damage(m);

            if (m.Alive)
            {
                Item item = m.FindItemOnLayer(Layer.OuterTorso);

                if (item is GMRobe)
                {
                    AOS.Damage(m, 0, 0, 0, 0, 0, 0);
                }
                else
                {
                    // Jungle noises
                    if (Utility.RandomDouble() < 0.008)
                    {
                        m.PlaySound(Utility.RandomList(0x003, 0x004, 0x005));
                        AOS.Damage(m, 0, 0, 0, 0, 0, 0);
                    }

                    // Bird chirps
                    if (Utility.RandomDouble() < 0.002)
                    {
                        m.PlaySound(Utility.RandomList(0x094, 0x095, 0x096, 0x097, 0x0D1, 0x0D2));
                        AOS.Damage(m, 0, 0, 0, 0, 0, 0);
                    }

                    // Cricket noises
                    if (Utility.RandomDouble() < 0.003)
                    {
                        m.PlaySound(Utility.RandomList(0x00A, 0x00B));
                        AOS.Damage(m, 0, 0, 0, 0, 0, 0);
                    }

                    // Random Encounter 1
                    if (Utility.RandomDouble() < 0.0001)
                    {
                        if (m.Map == Map.Malas)
                        {
                            int x1 = m.X + 8;
                            int y1 = m.Y + 8;
                            int z1 = Map.Malas.GetAverageZ(x1, y1);

                            if (Map.Malas.CanSpawnMobile(x1, y1, z1))
                            {
                                BaseCreature encountera;
                                switch (Utility.Random(10))
                                {
                                default:
                                case 0: encountera = new AntLion(); break;

                                case 1: encountera = new ForestOstard(); break;

                                case 2: encountera = new Gryphon(); break;

                                case 3: encountera = new IbongAdarna(); break;

                                case 4: encountera = new Parrot(); break;

                                case 5: encountera = new Qingniao(); break;

                                case 6: encountera = new Ridgeback(); break;

                                case 7: encountera = new SavageRidgeback(); break;

                                case 8: encountera = new Shangyang(); break;

                                case 9: encountera = new Qingniao(); break;
                                }
                                encountera.MoveToWorld(new Point3D(x1, y1, z1), Map.Malas);

                                AOS.Damage(m, 0, 0, 0, 0, 0, 0);
                                Timer.DelayCall(TimeSpan.FromMinutes(10.0), new TimerStateCallback(DeleteEncounterA), encountera);
                            }
                        }
                    }

                    // Random Encounter 2
                    if (Utility.RandomDouble() < 0.0001)
                    {
                        if (m.Map == Map.Malas)
                        {
                            int x2 = m.X - 8;
                            int y2 = m.Y - 8;
                            int z2 = Map.Malas.GetAverageZ(x2, y2);

                            if (Map.Malas.CanSpawnMobile(x2, y2, z2))
                            {
                                BaseCreature encountera;
                                switch (Utility.Random(10))
                                {
                                default:
                                case 0: encountera = new AntLion(); break;

                                case 1: encountera = new ForestOstard(); break;

                                case 2: encountera = new Gryphon(); break;

                                case 3: encountera = new IbongAdarna(); break;

                                case 4: encountera = new Parrot(); break;

                                case 5: encountera = new Qingniao(); break;

                                case 6: encountera = new Ridgeback(); break;

                                case 7: encountera = new SavageRidgeback(); break;

                                case 8: encountera = new Shangyang(); break;

                                case 9: encountera = new Qingniao(); break;
                                }
                                encountera.MoveToWorld(new Point3D(x2, y2, z2), Map.Malas);

                                AOS.Damage(m, 0, 0, 0, 0, 0, 0);
                                Timer.DelayCall(TimeSpan.FromMinutes(10.0), new TimerStateCallback(DeleteEncounterA), encountera);
                            }
                        }
                    }

                    // Random Treasure Chest 1
                    if (Utility.RandomDouble() < 0.0005)
                    {
                        if (m.Map == Map.Malas)
                        {
                            int x1 = m.X + 12;
                            int y1 = m.Y + 12;
                            int z1 = Map.Malas.GetAverageZ(x1, y1);

                            if (Map.Malas.CanSpawnMobile(x1, y1, z1))
                            {
                                BaseContainer treasurechest;

                                if (m.Skills.Tracking.Base > 24.9)
                                {
                                    switch (Utility.Random(2))
                                    {
                                    default:
                                    case 0: treasurechest = new GlimmerwoodTreasureChest1(); break;

                                    case 1: treasurechest = new GlimmerwoodTreasureChest1(); break;
                                    }
                                    treasurechest.MoveToWorld(new Point3D(x1, y1, z1), Map.Malas);

                                    AOS.Damage(m, 0, 0, 0, 0, 0, 0);
                                    Timer.DelayCall(TimeSpan.FromMinutes(5.0), new TimerStateCallback(DeleteTreasureChest), treasurechest);
                                }
                            }
                        }
                    }

                    // Random Treasure Chest 2
                    if (Utility.RandomDouble() < 0.0005)
                    {
                        if (m.Map == Map.Malas)
                        {
                            int x2 = m.X - 12;
                            int y2 = m.Y - 12;
                            int z2 = Map.Malas.GetAverageZ(x2, y2);

                            if (Map.Malas.CanSpawnMobile(x2, y2, z2))
                            {
                                BaseContainer treasurechest;

                                if (m.Skills.Tracking.Base > 24.9)
                                {
                                    switch (Utility.Random(2))
                                    {
                                    default:
                                    case 0: treasurechest = new GlimmerwoodTreasureChest1(); break;

                                    case 1: treasurechest = new GlimmerwoodTreasureChest1(); break;
                                    }
                                    treasurechest.MoveToWorld(new Point3D(x2, y2, z2), Map.Malas);

                                    AOS.Damage(m, 0, 0, 0, 0, 0, 0);
                                    Timer.DelayCall(TimeSpan.FromMinutes(5.0), new TimerStateCallback(DeleteTreasureChest), treasurechest);
                                }
                            }
                        }
                    }
                }
            }
        }