Ejemplo n.º 1
0
        private void DoDisenchant()
        {
            var activePlayer         = game.GetGameObjects();
            var nextItemToDesenchant = activePlayer.ItemsInBags.FirstOrDefault(l => (l.Class == 2 || l.Class == 4) && l.Quality == 2 && l.Level > 1);

            if (nextItemToDesenchant != null)
            {
                game.CastSpellByName(Wowhead.GetSpellInfo(13262).Name);
                game.UseItem(nextItemToDesenchant.BagID, nextItemToDesenchant.SlotID);
            }
        }
Ejemplo n.º 2
0
        private void DoProspect()
        {
            var activePlayer = game.GetGameObjects();
            var nextOre      = activePlayer.ItemsInBags.FirstOrDefault(l => ores.Contains(l.EntryID) && l.StackSize >= 5);

            if (nextOre != null)
            {
                game.CastSpellByName(Wowhead.GetSpellInfo(31252).Name);
                game.UseItem(nextOre.BagID, nextOre.SlotID);
            }
        }
Ejemplo n.º 3
0
        private void OnZoneChanged(uint zone)
        {
            switch (zone)
            {
            case 3277:
            case 5031:                                                                                           // Два Пика
                searchingObjects = new[] { Wowhead.GetSpellInfo(23335).Name, Wowhead.GetSpellInfo(23333).Name }; // Флаг Альянса, Horde Flag
                break;

            case 3820:                                                                          // regular Око Бури
            case 5799:
                searchingObjects = new[] { Wowhead.GetSpellInfo(34976).Name, "Флаг Ока Бури" }; // Флаг Пустоверти
                break;

            case 6051:
                searchingObjects = new[] { Wowhead.GetSpellInfo(121164).Name };     // entry ids: 212091, 212092, 212093, 212094; Сфера могущества
                break;

            case 6665:                                                                                             // Каньон Суровых Ветров
                searchingObjects = new[] { Wowhead.GetSpellInfo(140876).Name, Wowhead.GetSpellInfo(141210).Name }; // Вагонетка Альянса, Вагонетка Орды
                break;

            case 9136:                                                          // Бурлящий берег
                searchingObjects = new[] { Wowhead.GetSpellInfo(273459).Name }; // Азерит
                break;

            default:
                searchingObjects = new string[] { };
                break;
            }
            if (searchingObjects.Length > 0)
            {
                var zoneText = game.ZoneText;
                this.LogPrint($"We're in {zoneText}, searching for {{{string.Join(", ", searchingObjects)}}}");
                this.ShowNotify($"{zoneText}: {{{string.Join(", ", searchingObjects)}}}", false, true);
            }
            else
            {
                this.LogPrint("Unknown battlefield, ID: " + zone + "; zoneText: " + game.ZoneText);
            }
        }
Ejemplo n.º 4
0
 private bool ApplyArcaneLureIfNeeded(WoWPlayerMe me)
 {
     if (settings.UseArcaneLure)
     {
         uint itemID = 0;
         var  arcaneLureSpellName = Wowhead.GetSpellInfo(218861).Name;
         if (me.Auras.All(l => l.Name != arcaneLureSpellName))
         {
             var item = me.ItemsInBags.FirstOrDefault(l => l.Name == arcaneLureSpellName);
             if (item != null)
             {
                 itemID = item.EntryID;
             }
         }
         if (itemID != 0)
         {
             this.LogPrint($"Applying arcane lure --> ({Wowhead.GetItemInfo(itemID).Name})");
             game.UseItemByID(itemID);
             Thread.Sleep(Utilities.Rnd.Next(250, 750));
             return(true);
         }
     }
     return(false);
 }
Ejemplo n.º 5
0
        public void OnPulse()
        {
            var activePlayer = game.GetGameObjects();

            if (activePlayer != null)
            {
                if (!game.IsLooting)
                {
                    if (activePlayer.CastingSpellID == 0 && activePlayer.ChannelSpellID == 0)
                    {
                        if (game.IsSpellKnown(51005)) // mill
                        {
                            if (settings.UseFastDraenorMill && activePlayer.ItemsInBags.Any(l => fastMillHerbs.Contains(l.EntryID) && l.StackSize >= 20))
                            {
                                game.SendToChat($"/run {someRandomString}={{}}");
                                game.SendToChat($"/run local s=C_TradeSkillUI.GetFilteredRecipeIDs();local t={{}};if(#s>0) then for i=1,#s do C_TradeSkillUI.GetRecipeInfo(s[i], t);{someRandomString}[t.name]={{t.recipeID,t.numAvailable}}; end end");
                                game.SendToChat($"/run for n,i in pairs({someRandomString}) do if(strfind(n,\"Массовое измельчение\") and i[2]>0) then C_TradeSkillUI.CraftRecipe(i[1],i[2]);return; end end");
                                Thread.Sleep(2000);
                                return;
                            }
                            if (activePlayer.ItemsInBags.Any(l => l.EntryID == 136926)) // Кошмарный стручок
                            {
                                game.UseItemByID(136926);
                                Thread.Sleep(500);
                                return;
                            }
                            var nextHerb = activePlayer.ItemsInBags.FirstOrDefault(l => herbs.Contains(l.EntryID) && l.StackSize >= 5);
                            if (nextHerb != null)
                            {
                                game.CastSpellByName(Wowhead.GetSpellInfo(51005).Name);
                                game.UseItem(nextHerb.BagID, nextHerb.SlotID);
                                Thread.Sleep(500);
                                return;
                            }
                            if (settings.LaunchInkCrafter)
                            {
                                this.AddPluginToRunning("InkCrafter");
                            }
                        }
                        if (game.IsSpellKnown(31252)) // prospect
                        {
                            DoProspect();
                        }
                        if (game.IsSpellKnown(13262)) // disenchant
                        {
                            Thread.Sleep(1000);       // pause to prevent disenchanting nonexistent item
                            DoDisenchant();
                        }
                        if ((DateTime.UtcNow - lastNotifiedAboutCompletion).TotalSeconds >= 60)
                        {
                            this.ShowNotify("Task is completed", false, true);
                            lastNotifiedAboutCompletion = DateTime.UtcNow;
                        }
                    }
                    else
                    {
                        Thread.Sleep(500); // wait for cast
                    }
                }
            }
        }