[Guide][OOP][C#] Determining the player's spec menu

Shout-Out

User Tag List

Results 1 to 9 of 9
  1. #1
    Tanaris4's Avatar Contributor Authenticator enabled
    Reputation
    148
    Join Date
    Oct 2008
    Posts
    646
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [Guide][OOP][C#] Determining the player's spec

    For those that are also trying to achieve the same thing:

    Code:
     
            // from Script_GetPrimaryTalentTree
            public enum Talent
            {
                TalentGroup = 0xB4B5E4,         // 4.3.4 15595
                TalentArray = 0xB4B620,         // 4.3.4 15595 (not entirely sure why I had to add +0x20 to this one...)
                TalentArraySize = 0x6C,         // 4.3.4 15595
                TalentDBIndex = 0x64,           // 4.3.4 15595
            }
    
            // returns the player's current spec!
            public String PlayerSpec()
            {
    
                UInt32 TalentGroup = Memory.ReadUInt((uint)Resources.Offsets.Talent.TalentGroup, "wow.exe");
                UInt32 TalentTabIndex = Memory.ReadUInt((uint)Resources.Offsets.Talent.TalentArray + ((uint)Resources.Offsets.Talent.TalentDBIndex + (TalentGroup * (uint)Resources.Offsets.Talent.TalentArraySize)), "wow.exe");
    
                // sanity check (as of 4.3.4 15595 the highest is around 900)
                if (TalentTabIndex < 1000)
                {
                    UInt32 TalentTabRow = ClientDB__GetRow(Memory.WowBaseAddress + (uint)Resources.Offsets.DBCs.TalentTab, TalentTabIndex);
    
                    if (TalentTabRow > 0)
                    {
                        return Memory.ReadUTF8String(Memory.ReadUInt(TalentTabRow + 0x4), 128);
                    }
                }
    
                return String.Empty;
            }
    Last edited by Tanaris4; 04-20-2012 at 08:30 AM.
    https://tanaris4.com

    [Guide][OOP][C#] Determining the player's spec
  2. #2
    _Mike's Avatar Contributor
    Reputation
    310
    Join Date
    Apr 2008
    Posts
    531
    Thanks G/R
    0/2
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    C#? You stepping over to the dark side? I seem to remember you as a Mac user
    Thanks for sharing.

  3. #3
    Tanaris4's Avatar Contributor Authenticator enabled
    Reputation
    148
    Join Date
    Oct 2008
    Posts
    646
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    THE SECRET IS OUT OMG! Got a new job as a .NET dev, please don't tell anyone
    https://tanaris4.com

  4. #4
    romb0t's Avatar Member
    Reputation
    79
    Join Date
    Dec 2011
    Posts
    212
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I like this kind of post...

    Thanks for sharing.
    +rep

  5. #5
    guizmows's Avatar Banned
    Reputation
    57
    Join Date
    Feb 2008
    Posts
    414
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    UInt32 TalentTabRow = MyWoW.Helpers.ClientDB.Functions.ClientDB__GetRow(Memory.WowBaseAddress + (uint)Resources.Offsets.DBCs.TalentTab, TalentTabIndex);

    .....
    You've name your bot like an well known other bot

    Thanks for sharing this code.

  6. #6
    Tanaris4's Avatar Contributor Authenticator enabled
    Reputation
    148
    Join Date
    Oct 2008
    Posts
    646
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What? I'm not sure what you're referring to
    https://tanaris4.com

  7. #7
    JuJuBoSc's Avatar Banned for scamming CoreCoins Purchaser
    Reputation
    1019
    Join Date
    May 2007
    Posts
    922
    Thanks G/R
    1/3
    Trade Feedback
    1 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Tanaris4 View Post
    What? I'm not sure what you're referring to
    Haha, the secret is gone!

  8. #8
    Jadd's Avatar 🐸 Premium Seller
    Reputation
    1515
    Join Date
    May 2008
    Posts
    2,433
    Thanks G/R
    81/336
    Trade Feedback
    1 (100%)
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Tanaris4 View Post
    THE SECRET IS OUT OMG! Got a new job as a .NET dev, please don't tell anyone

  9. #9
    haku43's Avatar Member
    Reputation
    3
    Join Date
    Sep 2009
    Posts
    27
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
     public string PrimarySpecName
            {
                get
                {
                    int tree = PrimarySpecTree;
                    if (tree == 0) return string.Empty;
                    lstring res = DoString(string.Format(@"(function()
                    local _,_,_,spec = GetTalentTabInfo({0})           
                    return spec
                    end)()", tree));
    
                    if (res.HasValues) return res.Values[0];
    
                    return string.Empty;
                }
            }
    
            public int PrimarySpecTree
            {
                get
                {
                    lstring res = DoString(@"(function()
                    local _,_,tree1 = GetTalentTabInfo(1)
                    local _,_,tree2 = GetTalentTabInfo(2)
                    local _,_,tree3 = GetTalentTabInfo(3)
                    return tree1,tree2,tree3
                    end)()");
    
                    int tree1 = res.As<int>(0);
                    int tree2 = res.As<int>(1);
                    int tree3 = res.As<int>(2);
    
                    if (tree1 > tree2 && tree1 > tree3) return 1;
    
                    if (tree2 > tree1 && tree2 > tree3) return 2;
    
                    if (tree3 > tree1 && tree3 > tree2) return 3;
    
                    return 0;
                }
            }

Similar Threads

  1. [Guide] How to lookup the Arena Points from another Player
    By Bl4ckSt0rm229 in forum World of Warcraft Guides
    Replies: 7
    Last Post: 07-13-2008, 10:04 AM
  2. [GUIDE] Make an area sanctuary (Players will see 'sanctuary' on the screen!
    By flat-down in forum WoW EMU Guides & Tutorials
    Replies: 4
    Last Post: 06-10-2008, 09:47 AM
  3. [Guide] How to get the "WoW Card" loots
    By [ Prototype ] in forum World of Warcraft Guides
    Replies: 46
    Last Post: 10-14-2007, 07:16 PM
  4. [GUIDE]Nice cash for alliance players
    By shadowfox47 in forum World of Warcraft Guides
    Replies: 8
    Last Post: 10-06-2007, 01:17 PM
  5. Video Guides to MOST of the secret places in WoW
    By Matt in forum World of Warcraft Guides
    Replies: 4
    Last Post: 05-19-2006, 10:33 PM
All times are GMT -5. The time now is 10:23 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