[CODE][4.2.0] How to determine if a game object is gatherable menu

User Tag List

Page 1 of 3 123 LastLast
Results 1 to 15 of 44
  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)

    [CODE][4.2.0] How to determine if a game object is gatherable

    The below code snippet allows you to determine if a gameobject is 1) Herb or Mining node and 2) If it's gatherable due to skill level

    Huge thanks to JuJu and TOM_RUS, without them I wouldn't have the below. Enjoy!

    Assumptions: You have the offsets for Lock.dbc and you understand how to read a row from it. SkillLineOffset is 0x790 and PlayerField_Ptr is 0x11FC (Note: This is for OS X, I'm sure it's close but not the same for windows)

    Code:
    #define NODE_NAMESTRUCT_POINTER_OFFSET     0x1BC
    
    enum eNodeNameStructFields {
    	NAMESTRUCT_NAME_PTR         = 0xB4,
    	NAMESTRUCT_ENTRY_ID         = 0xC4,
        NAMESTRUCT_LockIndex        = 0x14,            // 0x15C for mining objects!
    };
    
    // thanks @TOM_RUS for the below!
    enum LockKeyType
    {
        LOCK_KEY_NONE  = 0,
        LOCK_KEY_ITEM  = 1,
        LOCK_KEY_SKILL = 2
    };
    
    enum LockType
    {
        LOCKTYPE_PICKLOCK              = 1,
        LOCKTYPE_HERBALISM             = 2,
        LOCKTYPE_MINING                = 3,
        LOCKTYPE_DISARM_TRAP           = 4,
        LOCKTYPE_OPEN                  = 5,
        LOCKTYPE_TREASURE              = 6,
        LOCKTYPE_CALCIFIED_ELVEN_GEMS  = 7,
        LOCKTYPE_CLOSE                 = 8,
        LOCKTYPE_ARM_TRAP              = 9,
        LOCKTYPE_QUICK_OPEN            = 10,
        LOCKTYPE_QUICK_CLOSE           = 11,
        LOCKTYPE_OPEN_TINKERING        = 12,
        LOCKTYPE_OPEN_KNEELING         = 13,
        LOCKTYPE_OPEN_ATTACKING        = 14,
        LOCKTYPE_GAHZRIDIAN            = 15,
        LOCKTYPE_BLASTING              = 16,
        LOCKTYPE_SLOW_OPEN             = 17,
        LOCKTYPE_SLOW_CLOSE            = 18,
        LOCKTYPE_FISHING               = 19,
        LOCKTYPE_INSCRIPTION           = 20,
        LOCKTYPE_OPEN_FROM_VEHICLE     = 21
    };
    
    #define MAX_LOCK_CASE 8
    
    typedef struct LockEntry{
        uint32      ID;                                 // 0        m_ID
        uint32      Type[MAX_LOCK_CASE];                // 1-8      m_Type see enum LockKeyType 
        uint32      Index[MAX_LOCK_CASE];               // 9-16     m_Index see enum LockType
        uint32      Skill[MAX_LOCK_CASE];               // 17-24    m_Skill skill value/item id etc... depends on LockEntry::Type
        //uint32      Action[MAX_LOCK_CASE];            // 25-32    m_Action
        
    } LockEntry;
    
    - (BOOL)isGatherable{
        
        UInt32 cachePtr = 0;
        if ( [_memory readMemoryAtAddress: ([self baseAddress] + NODE_NAMESTRUCT_POINTER_OFFSET) Buffer:(Byte *)&cachePtr BufLength:sizeof(cachePtr)] && cachePtr > 0x0 ){
             
            UInt32 index = [_memory readUInt:cachePtr + NAMESTRUCT_LockIndex];
            
            if ( index > 0 ){
    
                LockEntry lock;
                if ( [[ClientDBController sharedInstance] getObjectForRow:index withTable:LockDBTable withStruct:&lock withStructSize:sizeof(lock)] ){
         
                    // loop through all indexes!
                    int i = 0;
                    for ( ; i < MAX_LOCK_CASE; i++ ){
    
                        // herbalism
                        if ( lock.Type[i] == LOCKTYPE_HERBALISM && lock.Skill[i] > 0 ){
                            if ( [[[ObjController sharedInstance] currentPlayer] getHerbalismLevel] >= lock.Skill[i] ){
                                return YES;
                            }
                        }
                        
                        // mining
                        else if ( lock.Type[i] == LOCKTYPE_MINING && lock.Skill[i] > 0 ){
                            if ( [[[ObjController sharedInstance] currentPlayer] getMiningLevel] >= lock.Skill[i] ){
                                return YES;
                            }
                        }
                    }
                }
            }
        }
    
    	return NO;
    }
    Here is determining your skill level:
    Code:
    enum SkillLine{
    	Frost = 6,
    	Fire = 8,
    	Arms = 26,
    	Combat = 38,
    	Subtlety = 39,
    	Swords = 43,
    	Axes = 44,
    	Bows = 45,
    	Guns = 46,
    	BeastMastery = 50,
    	HunterSurvival = 51,
    	Maces = 54,
    	TwoHandedSwords = 55,
    	Holy = 56,
    	ShadowMagic = 78,
    	Defense = 95,
    	LanguageCommon = 98,
    	DwarvenRacial = 101,
    	LanguageOrcish = 109,
    	LanguageDwarven = 111,
    	LanguageDarnassian = 113,
    	LanguageTaurahe = 115,
    	DualWield = 118,
    	TaurenRacial = 124,
    	OrcRacial = 125,
    	NightElfRacial = 126,
    	FirstAid = 129,
    	FeralCombat = 134,
    	Staves = 136,
    	LanguageThalassian = 137,
    	LanguageDraconic = 138,
    	LanguageDemonTongue = 139,
    	LanguageTitan = 140,
    	LanguageOldTongue = 141,
    	Survival = 142,
    	HorseRiding = 148,
    	WolfRiding = 149,
    	TigerRiding = 150,
    	RamRiding = 152,
    	Swimming = 155,
    	TwoHandedMaces = 160,
    	Unarmed = 162,
    	Marksmanship = 163,
    	Blacksmithing = 164,
    	Leatherworking = 165,
    	Alchemy = 171,
    	TwoHandedAxes = 172,
    	Daggers = 173,
    	Thrown = 176,
    	Herbalism = 182,
    	Retribution = 184,
    	Cooking = 185,
    	Mining = 186,
    	PetImp = 188,
    	PetFelhunter = 189,
    	Tailoring = 197,
    	Engineering = 202,
    	PetSpider = 203,
    	PetVoidwalker = 204,
    	PetSuccubus = 205,
    	PetInfernal = 206,
    	PetDoomguard = 207,
    	PetWolf = 208,
    	PetCat = 209,
    	PetBear = 210,
    	PetBoar = 211,
    	PetCrocolisk = 212,
    	PetCarrionBird = 213,
    	PetCrab = 214,
    	PetGorilla = 215,
    	PetRaptor = 217,
    	PetTallstrider = 218,
    	RacialUndead = 220,
    	Crossbows = 226,
    	Wands = 228,
    	Polearms = 229,
    	PetScorpid = 236,
    	Arcane = 237,
    	PetTurtle = 251,
    	Assassination = 253,
    	Fury = 256,
    	Protection = 257,
    	Protection2 = 267,
    	PetGenericHunter = 270,
    	PlateMail = 293,
    	LanguageGnomish = 313,
    	LanguageTroll = 315,
    	Enchanting = 333,
    	Demonology = 354,
    	Affliction = 355,
    	Fishing = 356,
    	Enhancement = 373,
    	ShamanRestoration = 374,
    	ElementalCombat = 375,
    	Skinning = 393,
    	Mail = 413,
    	Leather = 414,
    	Cloth = 415,
    	Shield = 433,
    	FistWeapons = 473,
    	RaptorRiding = 533,
    	MechanostriderPiloting = 553,
    	UndeadHorsemanship = 554,
    	Restoration = 573,
    	Balance = 574,
    	Destruction = 593,
    	DruidHoly = 594,
    	Discipline = 613,
    	Lockpicking = 633,
    	PetBat = 653,
    	PetHyena = 654,
    	PetBirdofPrey = 655,
    	PetWindSerpent = 656,
    	LanguageGutterspeak = 673,
    	KodoRiding = 713,
    	RacialTroll = 733,
    	RacialGnome = 753,
    	RacialHuman = 754,
    	Jewelcrafting = 755,
    	BloodElfRacial = 756,
    	PetEventRemoteControl = 758,
    	LanguageDraenei = 759,
    	DraeneiRacial = 760,
    	PetFelguard = 761,
    	Riding = 762,
    	PetDragonhawk = 763,
    	PetNetherRay = 764,
    	PetSporebat = 765,
    	PetWarpStalker = 766,
    	PetRavager = 767,
    	PetSerpent = 768,
    	Internal = 769,
    	DkBlood = 770,
    	DkFrost = 771,
    	DkUnholy = 772,
    	Inscription = 773,
    	PetMoth = 775,
    	Runeforging = 776,
    	Mounts = 777,
    	Companions = 778,
    	PetExoticChimaera = 780,
    	PetExoticDevlisaur = 781,
    	PetGhoul = 782,
    	PetExoticSilithid = 783,
    	PetExoticWorm = 784,
    	PetWasp = 785,
    	PetExoticRhino = 786,
    	PetExoticCoreHound = 787,
    };
    
    typedef struct PlayerSkillInfo
    {
        int16_t Id;
        int16_t SkillStep;
        int16_t Value;
        int16_t MaxValue;
        int16_t Modifier;
        int16_t Bonus;
    } PlayerSkillInfo;
    
    - (NSDictionary*)CGPlayer_C__GetSkillIndexById:(int)zeID{
    	
    	UInt32 playerBase = [self baseAddress];
    	UInt32 skillPtrBase = 0x0;
    	[_memory readMemoryAtAddress:playerBase + [[OffsetController sharedInstance] offset:@"PlayerField_Pointer"] Buffer:(Byte *)&skillPtrBase BufLength:sizeof(skillPtrBase)];
    	
    	int offset = 0, skillInfoOffset = [[OffsetController sharedInstance] offset:@"SkillLineOffset"];
    	PlayerSkillInfo skillInfo;
    
    	do{
    		// read the struct!
    		[_memory readMemoryAtAddress:skillPtrBase + offset + skillInfoOffset Buffer:(Byte *)&skillInfo BufLength:sizeof(skillInfo)];
    		
    		// match? return it!
    		if ( zeID == skillInfo.Id ){
    			NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys:
    								  [NSNumber numberWithInt:skillInfo.Value],			@"Value", 
    								  [NSNumber numberWithInt:skillInfo.MaxValue],		@"MaxValue", nil];
    			return [[dict retain] autorelease];		
    		}
    		
    		offset += 12;
    	} while ( offset < 0x600 );
    	
    	return nil;	
    }
    Last edited by Tanaris4; 07-15-2011 at 09:05 AM.
    https://tanaris4.com

    [CODE][4.2.0] How to determine if a game object is gatherable
  2. #2
    lanman92's Avatar Active Member
    Reputation
    50
    Join Date
    Mar 2007
    Posts
    1,033
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    How the f*ck can anyone understand that code? Obj-C must be the most meticulous, confusing language ever...

  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)
    Your welcome?

    https://tanaris4.com

  4. #4
    Frosttall's Avatar Active Member
    Reputation
    64
    Join Date
    Feb 2011
    Posts
    261
    Thanks G/R
    16/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by lanman92 View Post
    How the f*ck can anyone understand that code? Obj-C must be the most meticulous, confusing language ever...
    Try ASM xD

  5. #5
    lanman92's Avatar Active Member
    Reputation
    50
    Join Date
    Mar 2007
    Posts
    1,033
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ASM makes sense. Obj-C is just.... Makes my eyes bleed.

  6. #6
    DarkLinux's Avatar Former Staff
    CoreCoins Purchaser Authenticator enabled
    Reputation
    1627
    Join Date
    May 2010
    Posts
    1,846
    Thanks G/R
    193/539
    Trade Feedback
    16 (100%)
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    Just because all the script kiddies only understand AutoIt and C# doesn't mean that intelligent people need to dumb down there code for them. I know it does not look perfect, but its your problem you don't understand it, so keep it to your self lols

  7. #7
    Frosttall's Avatar Active Member
    Reputation
    64
    Join Date
    Feb 2011
    Posts
    261
    Thanks G/R
    16/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by lanman92 View Post
    ASM makes sense. Obj-C is just.... Makes my eyes bleed.
    Well, because you've learned ASM... Learn this language and you'll understand it, too xD

    Math is confusing, if you don't understand it. But if you understand it, is it easy

  8. #8
    pyromaniac119's Avatar Active Member
    Reputation
    34
    Join Date
    Aug 2007
    Posts
    42
    Thanks G/R
    0/2
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by lanman92 View Post
    How the f*ck can anyone understand that code? Obj-C must be the most meticulous, confusing language ever...
    Erlang says hi.


    Originally Posted by DarkLinux View Post
    Just because all the script kiddies only understand AutoIt and C#...
    First time I've heard anyone accusing "script kiddies" of understanding C#


    On Topic:

    This is awesome. I'm not working on anything that could use this right now but it'll definitely make things easier when I do. Thanks.

  9. #9
    DrakeFish's Avatar Lazy Leecher

    Reputation
    634
    Join Date
    Nov 2008
    Posts
    569
    Thanks G/R
    0/14
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by DarkLinux View Post
    Just because all the script kiddies only understand AutoIt and C# doesn't mean that intelligent people need to dumb down there code for them. I know it does not look perfect, but its your problem you don't understand it, so keep it to your self lols
    Because the language you're coding in shows how intelligent you are? :confused:
    And doesn't the term "script-kiddie" reference to people using already-made scripts and programs to achieve something?

    Also, as some people seem to think, using a managed language doesn't make you less intelligent. There are tons of advantages from it other than easiness.
    Last edited by DrakeFish; 07-16-2011 at 06:48 PM.

  10. #10
    Serpious's Avatar Contributor CoreCoins Purchaser
    Reputation
    134
    Join Date
    Jul 2011
    Posts
    364
    Thanks G/R
    0/1
    Trade Feedback
    4 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by DrakeFish View Post
    Because the language you're coding in shows how intelligent you are? :confused:
    And doesn't the term "script-kiddie" referencing to people using already-made scripts and programs to achieve something?
    It does, yes. I am not sure if DarkLinux knows what he's talking about.

  11. #11
    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)
    Bah you would all derail my thread!

    Also, the NODE STRUCT thing is 0x1BC, someone asked in IRC (obv could be something else on windows, but usually nearby)
    https://tanaris4.com

  12. #12
    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)
    Just discovered this doesn't ALWAYS work (basically it sucks for low level nodes).

    The check for lock.Skill[i] > 0 needs to be removed. But, it will try to mine/herb quest items as well, which is obviously a problem.

    Anyone have any ideas?
    https://tanaris4.com

  13. #13
    caytchen's Avatar Contributor
    Reputation
    138
    Join Date
    Apr 2007
    Posts
    162
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Blacklisting and whitelisting, of course quest nodes have a LockType, too. You're just causing yourself more trouble.

  14. #14
    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)
    Yea but there has to be a way. I was going to try "is usable", but I can't find a function for GameObjects... CGGameObject_CanUse actually calls another function, but I don't know which.
    https://tanaris4.com

  15. #15
    Traxex84's Avatar Contributor Authenticator enabled
    Reputation
    257
    Join Date
    May 2010
    Posts
    816
    Thanks G/R
    1/25
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by DarkLinux View Post
    intelligent people
    Originally Posted by DarkLinux View Post
    dumb down there code
    Just sayin'

Page 1 of 3 123 LastLast

Similar Threads

  1. How to determine mine and herb?
    By starfish99 in forum WoW Memory Editing
    Replies: 19
    Last Post: 12-20-2018, 11:07 PM
  2. [ArcEmu] How to create a teleporting game object?
    By UnknownEncryption in forum WoW EMU Questions & Requests
    Replies: 1
    Last Post: 08-15-2010, 02:22 PM
  3. [Database] How to make a healing Game Object!
    By lyonar96 in forum WoW EMU Guides & Tutorials
    Replies: 3
    Last Post: 08-03-2010, 02:43 PM
  4. [Question] How to determine if a bg has started?
    By Deathvortex in forum WoW Memory Editing
    Replies: 32
    Last Post: 11-19-2009, 02:21 PM
  5. Replies: 6
    Last Post: 09-17-2009, 07:38 AM
All times are GMT -5. The time now is 04:19 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