Exemplo n.º 1
0
        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);
            }
        }
Exemplo n.º 2
0
        private void SearchContainer(Item Container)
        {
            CantReach = false;
            Container.DoubleClick();

            Thread.Sleep(250);

            if (CantReach)
            {
                return;
            }


            List <Item> _container = new List <Item>();
            List <uint> _findList  = new List <uint>();

            Stealth.Client.FindTypeEx(0xFFFF, 0xFFFF, Container.Serial.Value, false);
            if (!(Stealth.Client.GetFindCount() == 0))
            {
                _findList = Stealth.Client.GetFindList();
            }

            foreach (uint _item in _findList)
            {
                _container.Add(new Item(new Serial(_item)));
            }

            workerSearch.ReportProgress(0, _container.Count() + " items found...");

            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>();

            if (LoggingArmor)
            {
                _types.Add("Armor");
            }
            if (LoggingJewelry)
            {
                _types.Add("Jewel");
            }
            if (LoggingWeapons)
            {
                _types.Add("Weapon");
            }
            if (LoggingShields)
            {
                _types.Add("Shield");
            }

            LocateGear.Find(Container, _types);

            if (LoggingArmor)
            {
                foreach (BaseArmor _armor in LocateGear.ArmorList)
                {
                    _secondList.Add(_armor.Serial.Value);
                    ArmorList.Add(new Armor(_armor, Container.Serial.Value));
                }
            }
            if (LoggingJewelry)
            {
                foreach (BaseJewel _jewel in LocateGear.JewelList)
                {
                    _secondList.Add(_jewel.Serial.Value);
                    JewelryList.Add(new Jewelry(_jewel, Container.Serial.Value));
                }
            }
            if (LoggingWeapons)
            {
                foreach (BaseWeapon _weapon in LocateGear.WeaponList)
                {
                    _secondList.Add(_weapon.Serial.Value);
                    WeaponsList.Add(new Weapon(_weapon, Container.Serial.Value));
                }
            }
            if (LoggingShields)
            {
                foreach (BaseShield _shield in LocateGear.ShieldList)
                {
                    _secondList.Add(_shield.Serial.Value);
                    ShieldList.Add(new Shield(_shield, Container.Serial.Value));
                }
            }

            workerSearch.ReportProgress(0, "Checking for missed items...");
            List <uint> _missingItems = _firstList.Except(_secondList).ToList();

            foreach (uint _missingID in _missingItems)
            {
                Item _tempItem = new Item(new Serial(_missingID));
                MissingItems.Add(_tempItem);
            }

            ArmorList   = ArmorList.DistinctBy(x => x.ID).ToList();
            JewelryList = JewelryList.DistinctBy(x => x.ID).ToList();
            WeaponsList = WeaponsList.DistinctBy(x => x.ID).ToList();
            ShieldList  = ShieldList.DistinctBy(x => x.ID).ToList();

            ContainersSearched.Add(Container.Serial.Value);
            Scanner.Ignore(Container.Serial);
            //Stealth.Client.CloseClientUIWindow(UIWindowType.Container, Container.Serial.Value);


            workerSearch.ReportProgress(0, "Total Armor: " + ArmorList.Count().ToString());
            workerSearch.ReportProgress(0, "Total Jewelry: " + JewelryList.Count().ToString());
            workerSearch.ReportProgress(0, "Total Weapons: " + WeaponsList.Count().ToString());
            workerSearch.ReportProgress(0, "Total Shields: " + ShieldList.Count().ToString());
        }
Exemplo n.º 3
0
        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);
            }
        }
Exemplo n.º 4
0
        private void workerDebug_DoWork(object sender, DoWorkEventArgs e)
        {
            try
            {
                Scanner.Initialize();

                Scanner.Range         = 20;
                Scanner.VerticalRange = 0;

                //start the stopwatch for searching
                Stopwatch _loggerWatch = new Stopwatch();
                Stopwatch _moverWatch  = new Stopwatch();
                _loggerWatch.Start();
                _moverWatch.Start();

                Item _result    = RequestTarget();
                Item _container = new Item(new Serial(_result.Serial.Value));

                workerDebug.ReportProgress(0, "Starting search...");
                LocateGear.Find(_container, new List <string> {
                    "Armor", "Weapon", "Shield", "Jewel"
                });


                foreach (BaseArmor _armor in LocateGear.ArmorList)
                {
                    _armor.UpdateLocalizedProperties();

                    if (_armor.Cursed || _armor.Antique)
                    {
                        continue;
                    }

                    if (_armor.LootValue.Equals(LootValue.LegendaryArtifact) || _armor.LootValue.Equals(LootValue.MajorArtifact))
                    {
                        workerDebug.ReportProgress(0, _armor.Serial.Value.ToString() + "Legendary/Major Armor");
                    }
                    else if (!(_armor.MaterialType.Equals(ArmorMaterialType.Bone) || _armor.MaterialType.Equals(ArmorMaterialType.Studded)))
                    {
                        if (_armor.Attributes.LowerManaCost >= 8 && _armor.Attributes.BonusHits >= 5)
                        {
                            workerDebug.ReportProgress(0, _armor.Serial.Value.ToString() + "HP Studded/Bone");
                        }
                        else if (_armor.Attributes.BonusStam == 10)
                        {
                            workerDebug.ReportProgress(0, _armor.Serial.Value.ToString() + "Stam Studded/Bone");
                        }
                    }
                }

                foreach (BaseWeapon _weapon in LocateGear.WeaponList)
                {
                    _weapon.UpdateLocalizedProperties();

                    if (_weapon.Cursed || _weapon.Antique)
                    {
                        continue;
                    }

                    if (_weapon.WeaponAttributes.SplinteringWeapon >= 20)
                    {
                        workerDebug.ReportProgress(0, _weapon.Serial.Value.ToString() + "Splintering Weapon");
                    }
                    else if (_weapon.LootValue.Equals(LootValue.LegendaryArtifact) || _weapon.LootValue.Equals(LootValue.MajorArtifact))
                    {
                        if (_weapon.Attributes.CastSpeed == 0 && _weapon.Attributes.SpellChanneling)
                        {
                            workerDebug.ReportProgress(0, _weapon.Serial.Value.ToString() + "Mage Weapon");
                        }
                        else if (_weapon.Attributes.WeaponSpeed >= 30)
                        {
                            workerDebug.ReportProgress(0, _weapon.Serial.Value.ToString() + "Warrior Weapon");
                        }
                    }
                }

                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)
                    {
                        workerDebug.ReportProgress(0, _shield.Serial.Value.ToString() + "Mage Shield");
                    }
                    else if (_shield.Attributes.WeaponSpeed >= 5 && _shield.Attributes.WeaponDamage >= 5)
                    {
                        workerDebug.ReportProgress(0, _shield.Serial.Value.ToString() + "Warrior Shield");
                    }
                }

                foreach (BaseJewel _jewel in LocateGear.JewelList)
                {
                    _jewel.UpdateLocalizedProperties();

                    if (_jewel.Cursed || _jewel.Antique)
                    {
                        continue;
                    }

                    if (_jewel.LootValue.Equals(LootValue.LegendaryArtifact) || _jewel.LootValue.Equals(LootValue.MajorArtifact))
                    {
                        workerDebug.ReportProgress(0, _jewel.Serial.Value.ToString() + "Legendary/Major Jewel");
                    }
                    else if (_jewel.Attributes.WeaponSpeed >= 5 &&
                             _jewel.Attributes.WeaponDamage >= 5 &&
                             _jewel.Attributes.AttackChance >= 15)
                    {
                        workerDebug.ReportProgress(0, _jewel.Serial.Value.ToString() + "Dexer Jewel");
                    }
                }

                _loggerWatch.Stop();

                workerDebug.ReportProgress(0, "Finished searching!");
                workerDebug.ReportProgress(0, "Took: " + _loggerWatch.Elapsed);

                workerDebug.CancelAsync();
            }
            catch (Exception x)
            {
                workerDebug.ReportProgress(0, "Exception Message: " + x.Message.ToString());
                workerDebug.ReportProgress(0, "Exception Stack Trace: " + x.StackTrace.ToString());
                workerDebug.ReportProgress(0, "Exception Source: " + x.Source.ToString());
                workerDebug.CancelAsync();
            }
        }