context: using System;
  using Server.Items;
  using Server.Network;
  
  namespace Server.Mobiles
  {
      [CorpseName("a boura corpse")]
      public class HighPlainsBoura : BaseCreature, ICarvable
      {
          public static Type[] VArtifacts =
          {
              typeof (BouraTailShield)
          };
  
          private bool GatheredFur { get; set; }
          private bool m_Stunning;
  
          [Constructable]
          public HighPlainsBoura()
              : base(AIType.AI_Animal, FightMode.Aggressor, 10, 1, 0.2, 0.4)
          {
              Name = "a high plains boura";
              Body = 715;
  
              SetStr(400, 435);
              SetDex(90, 96);
              SetInt(25, 30);
  
              SetHits(555, 618);
  
              SetDamage(20, 25);
  
              SetDamageType(ResistanceType.Physical, 100);
  
              SetResistance(ResistanceType.Physical, 50, 60);
              SetResistance(ResistanceType.Fire, 35, 40);
              SetResistance(ResistanceType.Cold, 10, 20);
              SetResistance(ResistanceType.Poison, 30, 40);
              SetResistance(ResistanceType.Energy, 30, 40);
  
              SetSkill(SkillName.Anatomy, 95.2, 105.4);
              SetSkill(SkillName.MagicResist, 60.7, 70.0);
              SetSkill(SkillName.Tactics, 95.4, 105.7);
              SetSkill(SkillName.Wrestling, 105.1, 115.3);
  
              Tamable = true;
              ControlSlots = 3;
              MinTameSkill = 47.1;
  
              Fame = 5000;
              Karma = 5000; //Lose Karma for killing
  
              VirtualArmor = 16;
          }
  
          public HighPlainsBoura(Serial serial) : base(serial)
          {
          }
  
          public override int Meat
          {
              get { return 10; }
          }
  
          public override int Hides
          {
              get { return 22; }
          }
  
          public override int DragonBlood { get { return 8; } }
  
          public override HideType HideType
          {
              get { return HideType.Horned; }
          }
  
          public override FoodType FavoriteFood
          {
              get { return FoodType.FruitsAndVegies | FoodType.GrainsAndHay; }
          }
  
          public bool Carve(Mobile from, Item item)
          {
              if (!GatheredFur)
              {
                  var fur = new BouraFur(30);
  
                  if (from.Backpack == null || !from.Backpack.TryDropItem(from, fur, false))
                  {
                      from.SendLocalizedMessage(1112352); // You would not be able to place the gathered boura fur in your backpack!
                      fur.Delete();
                  }
                  else
                  {
                      from.SendLocalizedMessage(1112353); // You place the gathered boura fur into your backpack.
                      GatheredFur = true;
  
                      return true;
                  }
              }
              else
                  from.SendLocalizedMessage(1112354); // The boura glares at you and will not let you shear its fur.
  
              return false;
          }
  
          public override void OnCarve(Mobile from, Corpse corpse, Item with)
          {
              base.OnCarve(from, corpse, with);
  
              if (!GatheredFur)
              {
                  from.SendLocalizedMessage(1112765); // You shear it, and the fur is now on the corpse.
                  corpse.AddCarvedItem(new BouraFur(15), from);
                  GatheredFur = true;
              }
          }
  
          public override int GetIdleSound()
          {
              return 1507;
          }
  
          public override int GetAngerSound()
          {
              return 1504;
          }
  
          public override int GetHurtSound()
          {
              return 1506;
          }
  
          public override int GetDeathSound()
          {
              return 1505;
          }
  
          public override void OnDeath(Container c)
          {
              base.OnDeath(c);
  
              c.DropItem(new BouraPelt());
              c.DropItem(new BouraSkin());
  
              if (c != null && !c.Deleted && c is Corpse)
              {
                  var corpse = (Corpse) c;
                  if (Utility.RandomDouble() < 0.01 && corpse.Killer != null && !corpse.Killer.Deleted)
                  {
                      GiveVArtifactTo(corpse.Killer);
                  }
              }
          }
  
          public static void GiveVArtifactTo(Mobile m)
          {
              var item = (Item) Activator.CreateInstance(VArtifacts[Utility.Random(VArtifacts.Length)]);
  			m.PlaySound(0x5B4);
  
              if (m.AddToBackpack(item))
                  m.SendLocalizedMessage(1062317);
                      // For your valor in combating the fallen beast, a special artifact has been bestowed on you.
              else
                  m.SendMessage("As your backpack is full, your reward has been placed at your feet.");
              {
              }
          }
  
          public override void OnGaveMeleeAttack(Mobile defender)
          {
              base.OnGaveMeleeAttack(defender);
  
              if (!m_Stunning && 0.3 > Utility.RandomDouble())
              {
                  m_Stunning = true;
  
                  defender.Animate(21, 6, 1, true, false, 0);
                  PlaySound(0xEE);
                  defender.LocalOverheadMessage(MessageType.Regular, 0x3B2, false,
                      "You have been stunned by a colossal blow!");
  
                  var weapon = Weapon as BaseWeapon;
                  if (weapon != null)
                      weapon.OnHit(this, defender);
  
                  if (defender.Alive)
                  {
                      defender.Frozen = true;
                      Timer.DelayCall(TimeSpan.FromSeconds(5.0), new TimerStateCallback(Recover_Callback), defender);
                  }
              }
          }
  
          private void Recover_Callback(object state)
          {
              var defender = state as Mobile;
  
              if (defender != null)
              {
                  defender.Frozen = false;
                  defender.Combatant = null;
                  defender.LocalOverheadMessage(MessageType.Regular, 0x3B2, false, "You recover your senses.");
              }
  
              m_Stunning = false;
          }
  
          public override void Serialize(GenericWriter writer)
          {
              base.Serialize(writer);
              writer.Write(2);
              writer.Write(GatheredFur);
          }
  
          public override void Deserialize(GenericReader reader)
          {
              base.Deserialize(reader);
              var version = reader.ReadInt();
  
  
gt:             if (version == 1)