[Question] CGPlayer_C__GetSpellCastingTime? menu

User Tag List

Results 1 to 5 of 5
  1. #1
    -Ryuk-'s Avatar Elite User CoreCoins Purchaser Authenticator enabled
    Reputation
    529
    Join Date
    Nov 2009
    Posts
    1,028
    Thanks G/R
    38/51
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [Question] CGPlayer_C__GetSpellCastingTime?

    Hey guys,

    So ive been dumping the vTables today. Not sure if ive done it right thought xD

    Anyway, the reason for my dumping, is that I need a good way to check if im casting when InProcess.

    I found CGPlayer_C__GetSpellCastingTime which seems to be 0x85.

    I am using WhiteMagic to do this.

    My code is as follows:

    Code:
            private readonly CastTimeDelegate _castingTime;
    
            public WoWLocalPlayer(IntPtr pointer)
                : base(pointer)
            {
                _castingTime = RegisterVirtualFunction<CastTimeDelegate>((uint) vTables.CGPlayer_C.CGPlayer_C__GetSpellCastingTime);
            }
            #region Nested type: CastTimeDelegate
    
            [UnmanagedFunctionPointer(CallingConvention.ThisCall)]
            private delegate int CastTimeDelegate(IntPtr thisObj);
            #endregion
    and to call it I am using

    Code:
            public int CastingTime()
            {
                return _castingTime(Pointer);
            }
    This is returning a huge result...

    Any ideas?
    Last edited by -Ryuk-; 07-21-2011 at 05:08 AM.
    |Leacher:11/2009|Donor:02/2010|Established Member:09/2010|Contributor:09/2010|Elite:08/2013|

    [Question] CGPlayer_C__GetSpellCastingTime?
  2. #2
    Jens's Avatar Contributor
    Reputation
    179
    Join Date
    Sep 2006
    Posts
    251
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you're already injected, you might as well use lua?

    This is what I'm currently doing:

    Code:
    public bool IsCasting
    {
        get
        {
            return !string.IsNullOrEmpty(Lua.GetReturnValue<string>(string.Format("UnitCastingInfo(\"{0}\")", "player")));
        }
    }
    
    It's the crude way of doing it, but meh, the first return value will be empty if the unit is not casting a spell so the check works.

    API UnitCastingInfo - WoWWiki - Your guide to the World of Warcraft

  3. #3
    -Ryuk-'s Avatar Elite User CoreCoins Purchaser Authenticator enabled
    Reputation
    529
    Join Date
    Nov 2009
    Posts
    1,028
    Thanks G/R
    38/51
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Jens View Post
    If you're already injected, you might as well use lua?

    This is what I'm currently doing:

    Code:
    public bool IsCasting
    {
        get
        {
            return !string.IsNullOrEmpty(Lua.GetReturnValue<string>(string.Format("UnitCastingInfo(\"{0}\")", "player")));
        }
    }
    
    It's the crude way of doing it, but meh, the first return value will be empty if the unit is not casting a spell so the check works.

    API UnitCastingInfo - WoWWiki - Your guide to the World of Warcraft

    I guess I could do this... Id prefer to keep away from LUA as much as possible tho xD
    |Leacher:11/2009|Donor:02/2010|Established Member:09/2010|Contributor:09/2010|Elite:08/2013|

  4. #4
    jjaa's Avatar Contributor
    Reputation
    245
    Join Date
    Dec 2006
    Posts
    562
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by -Ryuk- View Post
    I guess I could do this... Id prefer to keep away from LUA as much as possible tho xD
    Why? its much better to use wow's lua API. Its completely patch independent (well..actually i suppose it does change sometimes). Let the WoWDev's do the work to fit the lua api, rather than you, jumping about trying to update things when stuff changes. If selecting the correct unit is an issue, just set the mouseover GUID and then call it with mouseover, or hook GetGUIDByKeyword.

  5. #5
    -Ryuk-'s Avatar Elite User CoreCoins Purchaser Authenticator enabled
    Reputation
    529
    Join Date
    Nov 2009
    Posts
    1,028
    Thanks G/R
    38/51
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by jjaa View Post
    Why? its much better to use wow's lua API. Its completely patch independent (well..actually i suppose it does change sometimes). Let the WoWDev's do the work to fit the lua api, rather than you, jumping about trying to update things when stuff changes. If selecting the correct unit is an issue, just set the mouseover GUID and then call it with mouseover, or hook GetGUIDByKeyword.
    I guess your right I don't know why I don't like using LUA...most likely stems back to my first Endscene hook, which was badly made, and lag like hell xD
    |Leacher:11/2009|Donor:02/2010|Established Member:09/2010|Contributor:09/2010|Elite:08/2013|

Similar Threads

  1. Model Changing Question
    By MasterYuke in forum World of Warcraft General
    Replies: 6
    Last Post: 09-17-2006, 09:56 PM
  2. Couple Private Server questions
    By Jboz in forum World of Warcraft General
    Replies: 21
    Last Post: 07-26-2006, 07:37 PM
  3. Sorry..newb mail question
    By nolbishop in forum World of Warcraft General
    Replies: 2
    Last Post: 06-07-2006, 07:21 PM
  4. Question..
    By janzi9 in forum Community Chat
    Replies: 3
    Last Post: 04-02-2006, 10:20 AM
  5. A GALB question
    By bassman in forum World of Warcraft General
    Replies: 4
    Last Post: 03-28-2006, 09:49 AM
All times are GMT -5. The time now is 02:38 AM. 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