Advertisement
sibble

Search script

Sep 15th, 2015
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.27 KB | None | 0 0
  1.             //empty list for adding items we want to loot
  2.             List<Loot> _toLootList = new List<Loot>();
  3.  
  4.             //open the corpse and sleep for half a second
  5.             Corpse.Use();
  6.             Thread.Sleep(500);
  7.            
  8.             //start the stopwatch for searching
  9.             Stopwatch _lootingWatch = new Stopwatch();
  10.             _lootingWatch.Start();
  11.  
  12.             //searching for weapons, armor and jewery
  13.             var _weaponList = Item.Find(typeof(BaseWeapon), Corpse.Serial.Value, false);
  14.             var _armorList = Item.Find(typeof(BaseArmor), Corpse.Serial.Value, false);
  15.             var _jewelryList = Item.Find(typeof(BaseJewel), Corpse.Serial.Value, false);
  16.             ConsoleMessage("Searching took: " + _lootingWatch.Elapsed.ToString());
  17.  
  18.             //restart the stopwatch for filtering
  19.             _lootingWatch.Restart();
  20.  
  21.             foreach (BaseWeapon _weapon in _weaponList)
  22.             {
  23.                 if (_weapon.WeaponAttributes.SplinteringWeapon >= 20)
  24.                     _toLootList.Add(new Loot(_weapon.Serial, "Splintering weapon"));
  25.             }
  26.             ConsoleMessage("Filtering took: " + _lootingWatch.Elapsed.ToString());
  27.  
  28.  
  29.             if (_toLootList.Count() > 0)
  30.                 LootItems(_toLootList);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement