示例#1
0
 public static string GetClientNameBySpellName(List <string> spellList)
 {
     try
     {
         for (int i = (int)Memory.WowProcess.WowModule + (int)Addresses.BarManager.startBar;
              i <= (int)Memory.WowProcess.WowModule + (int)Addresses.BarManager.startBar + 0x11C;
              // To be updated.
              i = i + (int)Addresses.BarManager.nextSlot)
         {
             uint sIdt = Memory.WowMemory.Memory.ReadUInt((uint)i);
             if (sIdt != 0)
             {
                 if (spellList.Contains(SpellListManager.SpellNameById(sIdt)))
                 {
                     return(SpellListManager.SpellNameByIdExperimental(sIdt));
                 }
             }
         }
     }
     catch (Exception exception)
     {
         Logging.WriteError("GetClientNameBySpellName(List<string> spellList): " + exception);
     }
     return("");
 }
示例#2
0
 public static List <uint> AllInteractMountId()
 {
     try
     {
         if (AllInteractMountIdList.Count <= 0)
         {
             AllInteractMountIdList.AddRange(SpellListManager.SpellIdByName("Demonsteel Stirrups"));
         }
         return(AllInteractMountIdList);
     }
     catch (Exception exception)
     {
         Logging.WriteError("AllInteractMountId(): " + exception);
     }
     return(new List <uint>());
 }
示例#3
0
 public static List <uint> HerbsInteractMountId()
 {
     try
     {
         if (HerbsInteractMountIdList.Count <= 0)
         {
             HerbsInteractMountIdList.AddRange(SpellListManager.SpellIdByName("Travel Form"));
             HerbsInteractMountIdList.AddRange(SpellListManager.SpellIdByName("Sky Golem"));
         }
         return(HerbsInteractMountIdList);
     }
     catch (Exception exception)
     {
         Logging.WriteError("HerbsInteractMountId(): " + exception);
     }
     return(new List <uint>());
 }
示例#4
0
        public static void UpdateSpellBook()
        {
            try
            {
                uint nbSpells =
                    Memory.WowMemory.Memory.ReadUInt(Memory.WowProcess.WowModule + (uint)Addresses.SpellBook.nbSpell);
                uint spellBookInfoPtr =
                    Memory.WowMemory.Memory.ReadUInt(Memory.WowProcess.WowModule + (uint)Addresses.SpellBook.knownSpell);

                for (UInt32 i = 0; i < nbSpells; i++)
                {
                    uint      Struct = Memory.WowMemory.Memory.ReadUInt(spellBookInfoPtr + i * 4);
                    SpellInfo si     = (SpellInfo)Memory.WowMemory.Memory.ReadObject(Struct, typeof(SpellInfo));
                    if (si.State == SpellInfo.SpellState.Known)
                    {
                        if (!_spellBookID.Contains(si.ID))
                        {
                            _spellBookID.Add(si.ID);
                            _spellBookName.Add(SpellListManager.SpellNameByIdExperimental(si.ID));
                            _spellBookSpell.Add(SpellInfoLUA(si.ID));
                        }
                    }
                    Application.DoEvents();
                }


                foreach (Spell o in _spellBookSpell)
                {
                    o.Update();
                }

                if (CombatClass.IsAliveCombatClass)
                {
                    CombatClass.ResetCombatClass();
                }
                if (HealerClass.IsAliveHealerClass)
                {
                    HealerClass.ResetHealerClass();
                }
            }
            catch (Exception exception)
            {
                Logging.WriteError("UpdateSpellBook(): " + exception);
            }
        }
示例#5
0
 public static List <uint> FlightFormsIds()
 {
     try
     {
         if (FlightFormsIdsList.Count <= 0)
         {
             FlightFormsIdsList.AddRange(SpellListManager.SpellIdByName("Swift Flight Form"));
             FlightFormsIdsList.AddRange(SpellListManager.SpellIdByName("Flight Form"));
             // Sky Golem is not a flight form, and wont cause trouble to farm underwater.
         }
         return(FlightFormsIdsList);
     }
     catch (Exception exception)
     {
         Logging.WriteError("MountDruidId(): " + exception);
     }
     return(new List <uint>());
 }
示例#6
0
 public static List <uint> MountDruidId()
 {
     try
     {
         if (MountDruidIdList.Count <= 0)
         {
             MountDruidIdList.AddRange(SpellListManager.SpellIdByName("Swift Flight Form"));
             MountDruidIdList.AddRange(SpellListManager.SpellIdByName("Flight Form"));
             MountDruidIdList.AddRange(SpellListManager.SpellIdByName("Aquatic Form"));
         }
         return(MountDruidIdList);
     }
     catch (Exception exception)
     {
         Logging.WriteError("MountDruidId(): " + exception);
     }
     return(new List <uint>());
 }
示例#7
0
 public static string GetClientNameBySpellName(List <string> spellList)
 {
     try
     {
         foreach (uint id in SpellBookID())
         {
             string spellName = SpellListManager.SpellNameById(id);
             if (spellList.Contains(spellName))
             {
                 return(spellName);
             }
         }
     }
     catch (Exception exception)
     {
         Logging.WriteError("GetClientNameBySpellName(List<string> spellList): " + exception);
     }
     return("");
 }
示例#8
0
 public static string GetSlotBarBySpellName(List <string> spellList)
 {
     try
     {
         for (int i = (int)Memory.WowProcess.WowModule + (int)Addresses.BarManager.startBar;
              i <= (int)Memory.WowProcess.WowModule + (int)Addresses.BarManager.startBar + 0x11C;
              // To be updated.
              i = i + (int)Addresses.BarManager.nextSlot)
         {
             uint sIdt = Memory.WowMemory.Memory.ReadUInt((uint)i);
             if (sIdt != 0)
             {
                 if (spellList.Contains(SpellListManager.SpellNameById(sIdt)))
                 {
                     int j = ((i - ((int)Memory.WowProcess.WowModule + (int)Addresses.BarManager.startBar)) /
                              (int)Addresses.BarManager.nextSlot);
                     int k = 0;
                     while (true)
                     {
                         if (j - 12 >= 0)
                         {
                             j = j - 12;
                             k++;
                         }
                         else
                         {
                             return((k + 1) + ";" + (j + 1));
                         }
                     }
                 }
             }
         }
     }
     catch (Exception exception)
     {
         Logging.WriteError("GetSlotBarBySpellName(List<string> spellList): " + exception);
     }
     return("");
 }
示例#9
0
        public static List <Spell> SpellBook()
        {
            try
            {
                lock (SpellManagerLocker)
                {
                    if (_spellBookSpell.Count <= 0)
                    {
                        Logging.Write("Initializing Character's SpellBook.");
                        SpellInfoCreateCache(SpellBookID());
                        SpellListManager.SpellIdByNameCreateCache();
                        var spellBook = new List <Spell>();
                        Logging.Write("May take few seconds...");

                        Memory.WowMemory.GameFrameLock();
                        foreach (uint id in SpellBookID())
                        {
                            spellBook.Add(new Spell(id));
                        }
                        Memory.WowMemory.GameFrameUnLock();
                        Logging.Write("Character's SpellBook fully loaded. Found " + _spellBookID.Count + " spells, mounts and professions.");
                        Logging.Status  = "Character SpellBook loaded.";
                        _spellBookSpell = spellBook;
                    }
                }
                return(_spellBookSpell);
            }
            catch (Exception exception)
            {
                Logging.WriteError("SpellBook(): " + exception);
            }
            finally
            {
                Memory.WowMemory.GameFrameUnLock();
            }
            return(new List <Spell>());
        }
示例#10
0
    internal void CombatRotation()
    {
        if (Conditions.InGameAndConnectedAndAliveAndProductStartedNotInPause && Fight.InFight)
        {
            if (Lua.LuaDoString <bool>(@"return (UnitIsTapped(""target"")) and (not UnitIsTappedByPlayer(""target""));"))
            {
                Fight.StopFight();
                Lua.LuaDoString("ClearTarget();");
                System.Threading.Thread.Sleep(400);
            }
        }
        if (ObjectManager.Me.HealthPercent <= 40 && !FlashHeal.KnownSpell)
        {
            LesserHeal.Launch();
        }

        if (ObjectManager.Me.HealthPercent <= 40 && FlashHeal.KnownSpell && !ObjectManager.Me.HaveBuff("Shadowform"))
        {
            FlashHeal.Launch();
        }

        if (ObjectManager.Me.HealthPercent <= 70 && Shield.KnownSpell && !ObjectManager.Me.HaveBuff("Power Word: Shield") && !ObjectManager.Me.HaveBuff("Weakened Soul"))
        {
            Shield.Launch();
        }

        if (VampiricEmbrace.KnownSpell && !ObjectManager.Target.HaveBuff("Vampiric Embrace") && ObjectManager.Target.GetDistance < 28)
        {
            VampiricEmbrace.Launch();
        }

        if (MindBlast.KnownSpell && ObjectManager.Me.ManaPercentage > 60 && ObjectManager.Target.GetDistance < 28)
        {
            this.MindBlast.Launch();
        }

        if (HolyFire.KnownSpell && !Shadowform.KnownSpell && ObjectManager.Me.ManaPercentage > 60 && ObjectManager.Target.GetDistance < 25 && ObjectManager.Target.GetDistance > 8 && ObjectManager.Target.HealthPercent >= 85)
        {
            this.HolyFire.Launch();
        }

        if (ShadowWordPain.KnownSpell && !ObjectManager.Target.HaveBuff("Shadow Word: Pain") && ObjectManager.Target.GetDistance < 28)
        {
            ShadowWordPain.Launch();
        }

        if (Mindflay.KnownSpell && ObjectManager.Me.ManaPercentage > 40 && ObjectManager.Target.GetDistance < 20 && ObjectManager.Me.HaveBuff("Power Word: Shield"))
        {
            Mindflay.Launch();
            Thread.Sleep(Usefuls.Latency);
            Usefuls.WaitIsCasting();
        }


        if (Smite.KnownSpell && ObjectManager.Me.ManaPercentage > 20 && ObjectManager.Me.HealthPercent >= 40 && ObjectManager.Me.Level < 5 && ObjectManager.Target.GetDistance < 25)
        {
            Smite.Launch();
        }

        if (DevouringPlague.KnownSpell && ObjectManager.Target.GetDistance < 25)
        {
            DevouringPlague.Launch();
        }

        if (!Lua.LuaDoString <bool>("return IsAutoRepeatAction(" + (SpellManager.GetSpellSlotId(SpellListManager.SpellIdByName("Shoot")) + 1) + ")") && ObjectManager.Me.HealthPercent >= 40)
        {
            if (Shoot.KnownSpell)
            {
                SpellManager.CastSpellByNameLUA("Shoot");
            }
            return;
        }
    }
示例#11
0
 private void EventsLua_OnEventLuaPlayerTargetChanged()
 {
     if (Lua.LuaDoString <bool>("return IsCurrentAction(" + (SpellManager.GetSpellSlotId(SpellListManager.SpellIdByName("Attack")) + 1) + ")"))
     {
         SpellManager.CastSpellByNameLUA("Attack");
     }
 }
示例#12
0
文件: Warlock.cs 项目: QiMata/WoWBot
    internal void CombatRotation()
    {
        // auto tag avoid
        if (Conditions.InGameAndConnectedAndAliveAndProductStartedNotInPause && Fight.InFight)
        {
            if (Lua.LuaDoString <bool>(@"return (UnitIsTapped(""target"")) and (not UnitIsTappedByPlayer(""target""));"))
            {
                Fight.StopFight();
                Lua.LuaDoString("ClearTarget();");
                System.Threading.Thread.Sleep(400);
            }
        }
        if (ObjectManager.Pet.IsValid && ObjectManager.Me.IsAlive && HealthFunnel.KnownSpell && HealthFunnel.IsDistanceGood && ObjectManager.Pet.HealthPercent <= 30 && ObjectManager.Me.HealthPercent >= 60)
        {
            HealthFunnel.Launch();
            //channeling ?
        }
        if (ObjectManager.Target.HealthPercent >= 20 && ObjectManager.Me.HaveBuff("Shadow trance") && ObjectManager.Me.ManaPercentage > 15)
        {
            ShadowBolt.Launch();
            Thread.Sleep(Usefuls.Latency + 1000);
        }
        if (CurseofAgony.KnownSpell && ObjectManager.Target.HealthPercent >= 40 && !ObjectManager.Target.HaveBuff("Curse of Agony") && ObjectManager.Me.ManaPercentage > 15)
        {
            this.CurseofAgony.Launch();
            Thread.Sleep(Usefuls.Latency + 1200);
        }

        if (Corruption.KnownSpell && ObjectManager.Target.HealthPercent >= 40 && !ObjectManager.Target.HaveBuff("Corruption") && ObjectManager.Me.ManaPercentage > 15 && ObjectManager.Target.GetDistance < 25)
        {
            this.Corruption.Launch();
            Thread.Sleep(Usefuls.Latency + 1200);
        }

        if (SiphonLife.KnownSpell && ObjectManager.Target.GetDistance < 25 && ObjectManager.Target.HealthPercent >= 40 && !ObjectManager.Target.HaveBuff("Siphon Life") && ObjectManager.Me.ManaPercentage > 15)
        {
            this.SiphonLife.Launch();
            Thread.Sleep(Usefuls.Latency + 1200);
        }



        if (Immolate.KnownSpell && ObjectManager.Target.GetDistance < 25 && ObjectManager.Target.HealthPercent >= 50 && !ObjectManager.Target.HaveBuff("Immolate") && ObjectManager.Me.ManaPercentage > 15 && !SiphonLife.KnownSpell)
        {
            this.Immolate.Launch();
            Thread.Sleep(Usefuls.Latency + 1200);
        }

        if (DrainSoul.KnownSpell && ObjectManager.Target.GetDistance < 25 && ObjectManager.Target.HealthPercent <= 25 && ItemsManager.GetItemCountByNameLUA("Soul Shard") <= 3)
        {
            DrainSoul.Launch();
            Thread.Sleep(Usefuls.Latency + 500);
        }

        if (DrainLife.KnownSpell && ObjectManager.Target.GetDistance < 25 && ObjectManager.Me.ManaPercentage > 40 && ObjectManager.Me.HealthPercent <= 60 && ObjectManager.Target.HealthPercent >= 20 && ObjectManager.Target.GetDistance > 8)
        {
            DrainLife.Launch();
            Thread.Sleep(Usefuls.Latency + 500);
        }

        if (LifeTap.KnownSpell && ObjectManager.Me.HealthPercent >= 60 && ObjectManager.Me.ManaPercentage < 30)
        {
            LifeTap.Launch();
        }


        //low lvl showbolt
        if (!SummonVoid.KnownSpell && ObjectManager.Target.GetDistance < 25)
        {
            ShadowBolt.Launch();
            Thread.Sleep(Usefuls.Latency + 1000);
        }

        //shoot
        if (!Lua.LuaDoString <bool>("return IsAutoRepeatAction(" + (SpellManager.GetSpellSlotId(SpellListManager.SpellIdByName("Shoot")) + 1) + ")") && ObjectManager.Me.HealthPercent >= 60)
        {
            if (Shoot.KnownSpell)
            {
                SpellManager.CastSpellByNameLUA("Shoot");
                Thread.Sleep(Usefuls.Latency + 1000);
            }
            return;
        }
        //shoot
        if (!Lua.LuaDoString <bool>("return IsAutoRepeatAction(" + (SpellManager.GetSpellSlotId(SpellListManager.SpellIdByName("Shoot")) + 1) + ")") && ObjectManager.Target.GetDistance < 8)
        {
            if (Shoot.KnownSpell)
            {
                SpellManager.CastSpellByNameLUA("Shoot");
                Thread.Sleep(Usefuls.Latency + 1000);
            }
            return;
        }
    }