Beispiel #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("");
 }
Beispiel #2
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);
            }
        }