Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void LootCorpse(Corpse _corpse)
- {
- _corpse.Use();
- Thread.Sleep(500);
- //Container _container = new Container(Container.Serial.Value);
- Stopwatch _lootTimer = new Stopwatch();
- _lootTimer.Start();
- #region New Search
- var _weapons = Item.Find(typeof(BaseWeapon), _corpse.Serial.Value, false);
- var _armor = Item.Find(typeof(BaseArmor), _corpse.Serial.Value, false);
- var _jewelry = Item.Find(typeof(BaseJewel), _corpse.Serial.Value, false);
- foreach (BaseWeapon _i in _weapons)
- {
- if (_i.WeaponAttributes.SplinteringWeapon > 15)
- {
- if (_i.Brittle)
- ConsoleMessage("Found brittle splintering weapon", ConsoleColor.Yellow);
- else
- ConsoleMessage("Found clean splintering weapon", ConsoleColor.Yellow);
- }
- if (_i.LootValue.Equals(LootValue.LegendaryArtifact))
- ConsoleMessage("Found legendary weapon", ConsoleColor.Yellow);
- else if (_i.LootValue.Equals(LootValue.MajorArtifact))
- ConsoleMessage("Found legendary weapon", ConsoleColor.Yellow);
- }
- foreach (BaseArmor _i in _armor)
- {
- if (_i.LootValue.Equals(LootValue.LegendaryArtifact))
- ConsoleMessage("Found legendary armor", ConsoleColor.Yellow);
- else if (_i.LootValue.Equals(LootValue.MajorArtifact))
- ConsoleMessage("Found legendary armor", ConsoleColor.Yellow);
- }
- foreach (BaseJewel _i in _jewelry)
- {
- if (_i.LootValue.Equals(LootValue.LegendaryArtifact))
- ConsoleMessage("Found legendary jewelry", ConsoleColor.Yellow);
- else if (_i.LootValue.Equals(LootValue.MajorArtifact))
- ConsoleMessage("Found legendary jewelry", ConsoleColor.Yellow);
- }
- #endregion
- _lootTimer.Stop();
- ConsoleMessage("New search took {0}", ConsoleColor.Green, _lootTimer.Elapsed);
- _lootTimer.Restart();
- #region Old Search
- List<Item> _container = new List<Item>();
- List<uint> _findList = new List<uint>();
- Stealth.Client.FindTypeEx(0xFFFF, 0xFFFF, _corpse.Serial.Value, true);
- if (!(Stealth.Client.GetFindCount() == 0))
- _findList = Stealth.Client.GetFindList();
- foreach (uint _item in _findList)
- {
- _container.Add(new Item(new Serial(_item)));
- }
- Thread.Sleep(500);
- List<Loot> _toLootList = new List<Loot>();
- Regex _splinter = new Regex(@"splintering weapon [2,3][0,5]%", RegexOptions.IgnoreCase);
- List<uint> _firstList = new List<uint>();
- foreach (Item _loot in _container)
- {
- //ConsoleMessage("parsing item: " + _loot.Serial.Value);
- bool _cursed = false;
- bool _antique = false;
- bool _legendary = false;
- bool _major = false;
- bool _splintering = false;
- string[] _tooltip = _loot.Tooltip.Split('|');
- //ConsoleMessage(_loot.Tooltip);
- foreach (string _s in _tooltip)
- {
- if (Regex.IsMatch(_s, "cursed", RegexOptions.IgnoreCase))
- _cursed = true;
- if (Regex.IsMatch(_s, "antique", RegexOptions.IgnoreCase))
- _antique = true;
- if (Regex.IsMatch(_s, "major artifact", RegexOptions.IgnoreCase))
- _major = true;
- if (Regex.IsMatch(_s, "legendary", RegexOptions.IgnoreCase))
- _legendary = true;
- if (_splinter.IsMatch(_s))
- _splintering = true;
- }
- if (_cursed || _antique)
- continue;
- else if (_major)
- _toLootList.Add(new Loot(_loot.Serial, "Major Artifact"));
- else if (_legendary)
- _toLootList.Add(new Loot(_loot.Serial, "Legendary Artifact"));
- else if (_splintering)
- _toLootList.Add(new Loot(_loot.Serial, "Splintering Weapon"));
- Scanner.Ignore(_loot.Serial);
- }
- #endregion
- _lootTimer.Stop();
- ConsoleMessage("Old search took {0}", ConsoleColor.Green, _lootTimer.Elapsed);
- if (_toLootList.Count() > 0)
- LootItems(_toLootList);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement