OoP - IsSpellReady  problem menu

Shout-Out

User Tag List

Results 1 to 1 of 1
  1. #1
    kajko's Avatar Member
    Reputation
    4
    Join Date
    Oct 2009
    Posts
    48
    Thanks G/R
    3/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    OoP - IsSpellReady problem

    Hi all,

    At the moment I am using following code to check is spell ready to be cast:

    Code:
    	struct _spellInfo
    	{
    		uint spellId;		// 8
    		uint _d12;			// 12
    		uint startTime;		// 16
    		uint cooldown1;		// 20
    		uint _d24;			// 24
    		uint _d28;			// 28
    		uint cooldown2;		// 32
    		uint _d36;			// 36
    		uint _d40;			// 40
    		uint GlobalTime;	// 44
    	};
    
    	bool Manager::IsSpellReady(int spellidToCheck)
    	{
    		_spellInfo inf;
    
    		__int64 frequency;
    		__int64 perfCount;
    		QueryPerformanceFrequency((LARGE_INTEGER*)&frequency);
    		QueryPerformanceCounter((LARGE_INTEGER*)&perfCount);
    		//Get first list object
    		uint currentListObject = m_pMemMan->Read<uint>(m_pMemMan->dwBaseAddress + WOW_SPELL_CoolDown + 0x8);
    		while ((currentListObject != 0) && ((currentListObject & 1) == 0))
    		{
    			m_pMemMan->Read((BYTE*)(currentListObject + 0x8), (BYTE*)&inf, sizeof(_spellInfo));
    			if (inf.spellId == spellidToCheck)
    			{
    				if (inf.GlobalTime > 100000)
    					inf.GlobalTime = 0;
    
    				uint GlobalCooldown = inf.cooldown1 + inf.cooldown2;
    				uint cooldownLength = max(GlobalCooldown, inf.GlobalTime);
    
    				//Current time in ms
    				uint currentTime = uint((perfCount * 1000) / frequency);
    				if ((inf.startTime + cooldownLength) > currentTime)
    					return true;
    
    				return false;
    
    			}
    			currentListObject = m_pMemMan->Read<uint>((BYTE*)(currentListObject + 4));
    		}
    		
    		return true;
    	}
    but having problem as it does not work reliably.
    Maybe some one can see what is a problem with this approach ?

    Also, as I am working out of process is there any other way to reliably check is spell ready to be cast or not, or better yet, can I somehow check what was it that I cast last ?

    Thanks,
    Kajko

    OoP - IsSpellReady  problem

Similar Threads

  1. Another GetActorAttribute OOP problem...
    By Zwingling in forum Diablo 3 Memory Editing
    Replies: 2
    Last Post: 07-25-2012, 02:17 PM
  2. realm list problem
    By robtuner in forum World of Warcraft General
    Replies: 2
    Last Post: 07-21-2006, 09:08 AM
  3. I have problem with BHW 3.0
    By sunrize1 in forum World of Warcraft General
    Replies: 1
    Last Post: 07-17-2006, 08:49 AM
  4. wow emu problem
    By bezike in forum World of Warcraft General
    Replies: 0
    Last Post: 07-09-2006, 04:45 PM
  5. Site problems
    By Shanaar in forum Community Chat
    Replies: 10
    Last Post: 05-14-2006, 01:15 AM
All times are GMT -5. The time now is 12:17 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