Spell Cooldown how to get recovery time menu

Shout-Out

User Tag List

Results 1 to 5 of 5
  1. #1
    iceblockman's Avatar Member
    Reputation
    2
    Join Date
    Jun 2012
    Posts
    36
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Spell Cooldown how to get recovery time

    HI guys I am trying to find out the spell recovery time. I checked all info in recent dump thread. So far i can get the gcd time and the spell default cd but not how long will it finish cd. Below is my code any help
    Code:
    namespace WowDBCExample
    {
    	
    	[StructLayout(LayoutKind.Sequential)]
        internal struct SpellCooldowns //5.0.4
        {
            public int id;    // cooldown table id
            public int unk1;  // spell id
            public uint unk2;
            public uint CoolDown;
            public uint m_recoveryTime;
            public uint GlobalCoolDown;
        } ;
    	
    	[StructLayout(LayoutKind.Sequential)]
        internal struct SpellRec //not correct yet
        {
            public int m_Id;
            public uint s_spellName; // Localized Name
            public uint s_type; 
            public uint s_description;
            public uint s_effectDescription;
            public uint m_SpellRuneCostId; 
            public uint m_unk1;
            public uint m_unk2;
            public float m_unk3;
            public uint m_SpellScalingId;
            public uint m_SpellAuraOptionsId;
            public uint m_SpellAuraRestrictionsId;
            public int m_SpellCastingRequirementsId;
            public int m_SpellCategoriesId;
            public int m_SpellClassOptionsId;
            public int m_SpellCooldownsID;        //confirmed
            public int m_SpellEquippedItemsId;
            public uint m_SpellInterruptsId;
            public uint m_SpellLevelId;            //confirmed
            public int m_SpellReagentsId;
            public int m_SpellShapeshiftId;
            public uint s_name2;                // don't realy know but it's a text                 
            public uint s_nameSubtext; 
            public uint s_unk; //             Description
            public uint s_auraDescription;   //text
        } ;  
    
    
        class Program
        {		
                                    const uint Spell_DBC = 0xBBC40C;
    		const uint SpellCooldowns_DBC = 0xBBBF68;
    		
            static void Main(string[] args)
            {
    			DBC<SpellRec> spellTable = new DBC<SpellRec>(new IntPtr(Spell_DBC));
                foreach (var row in spellTable)
                {
    				if (row.m_Id == 1752)
    				{
    					Console.WriteLine("Spellid {0}: {1}", row.m_Id, row.m_SpellCooldownsID);
    					
    					DBC<SpellCooldowns> spellCDTable = new DBC<SpellCooldowns>(new IntPtr(SpellCooldowns_DBC));
    					foreach (var r in spellCDTable)
    						if (r.id == row.m_SpellCooldownsID)
    							Console.WriteLine("{0}, {1}, {2}, {3}, {4}", r.unk1, r.unk2, r.CoolDown, r.m_recoveryTime, r.GlobalCoolDown);
    					
    				}
    				
    				if (row.m_Id == 131474)
    				{
    					Console.WriteLine("Spellid {0}: {1}", row.m_Id, row.m_SpellCooldownsID);
    					
    					DBC<SpellCooldowns> spellCDTable = new DBC<SpellCooldowns>(new IntPtr(SpellCooldowns_DBC));
    					foreach (var r in spellCDTable)
    						if (r.id == row.m_SpellCooldownsID)
    							Console.WriteLine("{0}, {1}, {2}, {3}, {4}", r.unk1, r.unk2, r.CoolDown, r.m_recoveryTime, r.GlobalCoolDown);
    					
    				}
    					
                }
    			
            }
        }
    }
    Editing: not well formatted after paste, I just retrieve 2 spell in formation in dbc based on the struct. I expect the spell recovery time is there as the name hint but i always get 0.
    Last edited by iceblockman; 10-26-2012 at 01:38 AM.

    Spell Cooldown how to get recovery time
  2. #2
    Apoc's Avatar Angry Penguin
    Reputation
    1388
    Join Date
    Jan 2008
    Posts
    2,750
    Thanks G/R
    0/13
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    [StructLayout(LayoutKind.Sequential, Size = 0x30)]
            private struct SpellCooldownEntry
            {
                public uint Unk;
                public IntPtr Next;
                public uint SpellId;
                public uint ItemId;
                public uint StartTime;
                public uint TimeOffset;
                public uint SpellCategoryId;
                public uint CategoryCooldownTimeStart;
                public uint CooldownDuration;
                public uint HasCooldown; // Check low byte
                public uint GCDStartTime;
                public uint StartRecoveryCategoryId;
                public uint GCDLeft;
    
                public override string ToString()
                {
                    return
                        string.Format(
                            "Unk: {0}, Next: {1}, SpellId: {2}, ItemId: {3}, StartTime: {4}, TimeOffset: {5}, SpellCategoryId: {6}, CategoryCooldownTimeStart: {7}, CooldownDuration: {8}, HasCooldown: {9}, GcdStartTime: {10}, StartRecoveryCategoryId: {11}, GcdLeft: {12}",
                            Unk,
                            Next,
                            SpellId,
                            ItemId,
                            StartTime,
                            TimeOffset,
                            SpellCategoryId,
                            CategoryCooldownTimeStart,
                            CooldownDuration,
                            HasCooldown,
                            GCDStartTime,
                            StartRecoveryCategoryId,
                            GCDLeft);
                }
            }

    Then something like this:

    Code:
            public static TimeSpan GetSpellCooldownTimeLeft(int spellId)
            {
                // We need to do this, because the WoW client is often off by 1-4 seconds. The actual val from perf counter is accurate.
                long currentTime = (long)WoWClient.PerformanceCounter();
    
                //Get first list object
                var current = Memory.Read<IntPtr>(Offsets.Statics.LocalPlayerSpellsOnCooldown + 0x8);
    
                while (current != (IntPtr)0 && ((uint)current & 1) == 0)
                {
                    var entry = Memory.Read<SpellCooldownEntry>(current);
    
                    // Spell ID doesn't match
                    if (entry.SpellId != spellId)
                    {
                        current = entry.Next;
                        continue;
                    }
    
                    //Spell on gcd?
                    if ((entry.StartTime + entry.TimeOffset + entry.CooldownDuration) > currentTime)
                    {
                        return Utilities.PerformanceCounterToDateTime(entry.StartTime + entry.TimeOffset).AddMilliseconds(entry.CooldownDuration) -
                               Utilities.PerformanceCounterToDateTime((ulong)currentTime);
                    }
    
                    //Get next list object
                    current = entry.Next;
                }
    
                return TimeSpan.Zero;
            }

  3. #3
    Empted's Avatar Contributor
    Reputation
    83
    Join Date
    Aug 2011
    Posts
    117
    Thanks G/R
    0/5
    Trade Feedback
    2 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    As you've posted
    Originally Posted by Apoc View Post
    Code:
    [StructLayout(LayoutKind.Sequential, Size = 0x30)]
    record size is 0x30 bytes. While i've been inspecting it's raw byte view today and I think (nearly sure) that you can get total GCD duration at 0x30, so it's 0x34 size minimal.
    I'm sorry if I'm not right.
    Last edited by Empted; 10-26-2012 at 02:48 PM.

  4. #4
    Apoc's Avatar Angry Penguin
    Reputation
    1388
    Join Date
    Jan 2008
    Posts
    2,750
    Thanks G/R
    0/13
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Empted View Post
    As you've posted


    record size is 0x30 bytes. While i've been inspecting it's raw byte view today and I think (nearly sure) that you can get total GCD duration at 0x30, so it's 0x34 size minimal.
    I'm sorry if I'm not right.
    Yeah, copied a bad declaration, sorry.

    The C struct:

    Code:
    #pragma pack(push, 1)struct SpellCooldownSubStruct
    {
      DWORD dword0;
      SpellCooldownSubStruct *Next;
    DWORD SpellId;
    DWORD ItemId;
      DWORD StartTime;
    DWORD SpellOrItemCooldownDuration;
    DWORD SpellCategoryId;
      DWORD CategoryCooldownStartTime;
      DWORD CategoryCooldownDuration;
      BYTE HasCooldown;
      BYTE pad[3];
      DWORD GlobalCooldownStartTime;
      DWORD StartRecoveryCategoryId;
      DWORD GlobalCooldownDuration;
    };
    #pragma pack(pop)
    C#
    Code:
            [StructLayout(LayoutKind.Sequential)]
            private struct SpellCooldownEntry
            {
                public uint dword0;
                public IntPtr Next;
                public uint SpellId;
                public uint ItemId;
                public uint StartTime;
                public uint SpellOrItemCooldownDuration;
                public uint SpellCategoryId;
                public uint CategoryCooldownStartTime;
                public uint CategoryCooldownDuration;
                public byte HasCooldown;
                public byte pad1,pad2,pad3;
                public uint GCDStartTime;
                public uint StartRecoveryCategoryId;
                public uint GCDDuration;
            }

  5. #5
    iceblockman's Avatar Member
    Reputation
    2
    Join Date
    Jun 2012
    Posts
    36
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    yeah a more detailed struct for spellcooldown
    just mention for who request the same thing , Offsets.Statics.LocalPlayerSpellsOnCooldown = 0xBD0B68 // 5.0.5 // I found on another thread
    http://www.ownedcore.com/forums/worl...lcooldown.html ([C#] Getting GCD or SpellCooldown)

Similar Threads

  1. spell.cooldown how to get it to work?
    By classdog in forum PE Support forum
    Replies: 1
    Last Post: 07-22-2015, 06:41 PM
  2. how to get 200% spell haste as mage in mr. t
    By Joeydragon in forum World of Warcraft Guides
    Replies: 22
    Last Post: 06-07-2008, 11:23 AM
  3. Replies: 4
    Last Post: 03-26-2008, 11:21 AM
  4. How DO I CHANGE HOW MANY TALENT POINTS PLAYERS GET EACH TIME THEZY LEVEL?
    By BillyBob31 in forum World of Warcraft Emulator Servers
    Replies: 15
    Last Post: 03-10-2008, 11:46 AM
All times are GMT -5. The time now is 11:52 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search