public static void LootCorpse(Corpse _corpse) { try { List <Loot> _toLootList = new List <Loot>(); Stopwatch _lootTimer = new Stopwatch(); var _corpseID = _corpse.Serial.Value; _corpse.DoubleClick(); Thread.Sleep(1500); _lootTimer.Start(); //ConsoleMessage("Starting Search"); List <Item> _container = new List <Item>(); List <uint> _findList = new List <uint>(); Stealth.Client.FindTypeEx(0xFFFF, 0xFFFF, _corpseID, true); if (!(Stealth.Client.GetFindCount() == 0)) { _findList = Stealth.Client.GetFindList(); } foreach (uint _item in _findList) { _container.Add(new Item(new Serial(_item))); } if (_container.Count == 0) { return; } List <uint> _firstList = new List <uint>(); foreach (Item _item in _container) { _firstList.Add(_item.Serial.Value); } List <Item> _resultsList = new List <Item>(); List <uint> _secondList = new List <uint>(); List <string> _types = new List <string>(); _types.Add("Armor"); _types.Add("Jewel"); _types.Add("Weapon"); _types.Add("Shield"); LocateGear.Find(_corpse, _types); foreach (BaseArmor _armor in LocateGear.ArmorList) { _secondList.Add(_armor.Serial.Value); _armor.UpdateLocalizedProperties(); if (!_armor.Antique && !_armor.Cursed) { ArmorList.Add(new Armor(_armor, _corpseID)); } } foreach (BaseJewel _jewel in LocateGear.JewelList) { _secondList.Add(_jewel.Serial.Value); _jewel.UpdateLocalizedProperties(); JewelryList.Add(new Jewelry(_jewel, _corpseID)); } foreach (BaseWeapon _weapon in LocateGear.WeaponList) { _secondList.Add(_weapon.Serial.Value); _weapon.UpdateLocalizedProperties(); if (!_weapon.Antique && !_weapon.Cursed) { WeaponsList.Add(new Weapon(_weapon, _corpseID)); } } foreach (BaseShield _shield in LocateGear.ShieldList) { _secondList.Add(_shield.Serial.Value); _shield.UpdateLocalizedProperties(); if (!_shield.Antique) { ShieldList.Add(new Shield(_shield, _corpseID)); } } List <uint> _missingItems = _firstList.Except(_secondList).ToList(); foreach (Armor _armor in ArmorList) { if (_armor.TotalStat >= 20 && _armor.LMC > 4) { _toLootList.Add(new Loot(new Serial(_armor.ID), "20 Stats and LMC")); } else if (_armor.TotalStat >= 20 && _armor.LRC > 4) { _toLootList.Add(new Loot(new Serial(_armor.ID), "20 Stats and LRC")); } } foreach (Jewelry _jewel in JewelryList) { if (_jewel.EnhancePotions >= 25 && _jewel.DCI >= 15 && _jewel.HCI >= 15 && _jewel.FCR >= 3) { _toLootList.Add(new Loot(new Serial(_jewel.ID), "EP/DCI Jewel")); } } foreach (Weapon _weapon in WeaponsList) { if (_weapon.Splintering >= 20) { _toLootList.Add(new Loot(new Serial(_weapon.ID), "Splintering Weapon")); } if (_weapon.ItemName.Contains("Bokuto") || _weapon.ItemName.Contains("bokuto")) { ConsoleMessage("Parsed bokuto...", ConsoleColor.Blue); if (_weapon.Splintering >= 5) { ConsoleMessage("It had splintering...", ConsoleColor.Yellow); } } if (_weapon.ItemName.Contains("Yumi") || _weapon.ItemName.Contains("yumi")) { if (_weapon.HitSpell.Contains("Lightning") || _weapon.HitSpell.Contains("lightning")) { _toLootList.Add(new Loot(new Serial(_weapon.ID), "Yumi with hit lightning")); } } //add check for splintering anything bokuto } //ConsoleMessage("Search complete"); _lootTimer.Stop(); ConsoleMessage("Search took {0}, {1} items.", ConsoleColor.Green, _lootTimer.Elapsed, _findList.Count()); //ConsoleMessage("Old search took {0}", ConsoleColor.Cyan, _lootTimer.Elapsed); if (_toLootList.Count() > 0) { LootItems(_toLootList); } ArmorList.Clear(); WeaponsList.Clear(); JewelryList.Clear(); ShieldList.Clear(); } catch (Exception ex) { ConsoleMessage("Error during Looting: {0}", ex.StackTrace); } }
public static void LootCorpse(Corpse _corpse) { Controller.ConsoleMessage("Checking corpse: {0}", ConsoleColor.DarkBlue, _corpse.Serial.Value.ToString()); List <BaseLoot> _toLootList = new List <BaseLoot>(); _corpse.DoubleClick(); Thread.Sleep(250); List <string> _lootTypes = new List <string> { "Armor", "Weapon", "Shield", "Jewel" }; LocateGear.Find(_corpse, _lootTypes); #region Armor Filter foreach (BaseArmor _armor in LocateGear.ArmorList) { _armor.UpdateLocalizedProperties(); if (_armor.Cursed || _armor.Antique) { continue; } if (_armor.LootValue.Equals(LootValue.LegendaryArtifact)) { _toLootList.Add(new BaseLoot(_armor.Serial, "Legendary Armor")); } else if (_armor.LootValue.Equals(LootValue.MajorArtifact)) { _toLootList.Add(new BaseLoot(_armor.Serial, "Major Armor")); } else if (_armor.MaterialType.Equals(ArmorMaterialType.Bone) || _armor.MaterialType.Equals(ArmorMaterialType.Studded)) { if (_armor.Attributes.LowerManaCost >= 8 && _armor.Attributes.BonusHits >= 5) { _toLootList.Add(new BaseLoot(_armor.Serial, "HP Studded/Bone Armor")); } else if (_armor.Attributes.BonusStam == 10) { _toLootList.Add(new BaseLoot(_armor.Serial, "Stam Studded/Bone Armor")); } } } #endregion #region Weapon Filter foreach (BaseWeapon _weapon in LocateGear.WeaponList) { _weapon.UpdateLocalizedProperties(); if (_weapon.Cursed || _weapon.Antique) { continue; } if (_weapon.WeaponAttributes.SplinteringWeapon >= 20) { _toLootList.Add(new BaseLoot(_weapon.Serial, "Splintering Weapon")); } else if (_weapon.LootValue.Equals(LootValue.LegendaryArtifact) || _weapon.LootValue.Equals(LootValue.MajorArtifact)) { if (_weapon.Attributes.CastSpeed == 0 && _weapon.Attributes.SpellChanneling) { _toLootList.Add(new BaseLoot(_weapon.Serial, "Mage Weapon")); } else if (_weapon.Attributes.WeaponSpeed >= 30) { _toLootList.Add(new BaseLoot(_weapon.Serial, "Warrior Weapon")); } } } #endregion #region Shield Filter foreach (BaseShield _shield in LocateGear.ShieldList) { _shield.UpdateLocalizedProperties(); if (_shield.Cursed || _shield.Antique) { continue; } if (!(_shield.LootValue.Equals(LootValue.LegendaryArtifact) || _shield.LootValue.Equals(LootValue.MajorArtifact))) { continue; } if (_shield.Attributes.CastSpeed == 0 && _shield.Attributes.SpellChanneling) { _toLootList.Add(new BaseLoot(_shield.Serial, "Mage Shield")); } else if (_shield.Attributes.WeaponSpeed >= 5 && _shield.Attributes.WeaponDamage >= 5) { _toLootList.Add(new BaseLoot(_shield.Serial, "Warrior Shield")); } } #endregion #region Jewel Filter foreach (BaseJewel _jewel in LocateGear.JewelList) { _jewel.UpdateLocalizedProperties(); if (_jewel.Cursed || _jewel.Antique) { continue; } if (_jewel.LootValue.Equals(LootValue.LegendaryArtifact)) { _toLootList.Add(new BaseLoot(_jewel.Serial, "Legendary Jewel")); } else if (_jewel.LootValue.Equals(LootValue.MajorArtifact)) { _toLootList.Add(new BaseLoot(_jewel.Serial, "Major Jewel")); } else if (_jewel.Attributes.BonusDex == 0 && _jewel.Attributes.BonusHits == 0 && _jewel.Attributes.BonusInt == 0 && _jewel.Attributes.BonusMana == 0 && _jewel.Attributes.BonusStam == 0 && _jewel.Attributes.BonusStr == 0 && _jewel.Attributes.RegenHits == 0 && _jewel.Attributes.RegenMana == 0 && _jewel.Attributes.RegenStam == 0 && _jewel.Attributes.SpellDamage == 0 && _jewel.Attributes.CastRecovery == 0 && _jewel.Attributes.CastSpeed == 0 && _jewel.Attributes.LowerManaCost == 0 && _jewel.Attributes.LowerRegCost == 0 && _jewel.Attributes.Luck == 0 && _jewel.Resistances.Physical == 0 && _jewel.Resistances.Fire == 0 && _jewel.Resistances.Cold == 0 && _jewel.Resistances.Poison == 0 && _jewel.Resistances.Energy == 0 && _jewel.Attributes.WeaponSpeed >= 5) { _toLootList.Add(new BaseLoot(_jewel.Serial, "Clean Dexer Jewel")); } else if (_jewel.Attributes.BonusDex == 0 && _jewel.Attributes.BonusHits == 0 && _jewel.Attributes.BonusInt == 0 && _jewel.Attributes.BonusMana == 0 && _jewel.Attributes.BonusStam == 0 && _jewel.Attributes.BonusStr == 0 && _jewel.Attributes.RegenHits == 0 && _jewel.Attributes.RegenMana == 0 && _jewel.Attributes.RegenStam == 0 && _jewel.Attributes.SpellDamage >= 15 && _jewel.Attributes.Luck == 0 && _jewel.Resistances.Physical == 0 && _jewel.Resistances.Fire == 0 && _jewel.Resistances.Cold == 0 && _jewel.Resistances.Poison == 0 && _jewel.Resistances.Energy == 0 && _jewel.Attributes.AttackChance == 0 && _jewel.Attributes.DefendChance == 0 && _jewel.Attributes.WeaponSpeed == 0) { _toLootList.Add(new BaseLoot(_jewel.Serial, "Clean Mage Jewel")); } } #endregion if (_toLootList.Count() > 0) { LootItems(_toLootList); } }