[mac][3.3.2] Strands - Detecting open/closed gates menu

User Tag List

Results 1 to 14 of 14
  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)

    [mac][3.3.2] Strands - Detecting open/closed gates

    So I've done some pretty extensive testing/research here to figure out how to detect if the gates are open/closed and I'm at a loss.

    I've looked at the mobs/nodes that are w/in the vicinity of the gates (generally 50 yards above them), as well as looked at the lua BG functions (which do nothing for Strand, only like flag info for WSG).

    Does anyone have any ideas on what I could either search for in memory, or research further?
    https://tanaris4.com

    [mac][3.3.2] Strands - Detecting open/closed gates
  2. #2
    audible83's Avatar Member
    Reputation
    4
    Join Date
    Jun 2008
    Posts
    48
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Edit edit.

    Search for the gates as objects ?
    Last edited by audible83; 02-09-2010 at 11:10 AM.

  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)
    LOL I saw the email come through and was like "seriously?" preparation buff?

    Well, the gates are still there when they are destroyed, and I scanned the unitfields for changes before/after, and there are no changes.
    https://tanaris4.com

  4. #4
    audible83's Avatar Member
    Reputation
    4
    Join Date
    Jun 2008
    Posts
    48
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well, yeah, i was sort of giving the standard answer on WSG

    My initial thought was that there could be some difference like the fishing bobber, animation active, etc.

  5. #5
    namreeb's Avatar Legendary

    Reputation
    668
    Join Date
    Sep 2008
    Posts
    1,029
    Thanks G/R
    8/222
    Trade Feedback
    0 (0%)
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    It's probably using a different model when it's destroyed. You could check that?

  6. #6
    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)
    The gates are game objects.

    GOs have 3 states (That I know of) which can be grabbed out of the GAMEOBJECT_BYTES_1 descriptor.

    Code:
            private byte[] Bytes1 { get { return BitConverter.GetBytes(GetStorageField<uint>(GameObjectFields.GAMEOBJECT_BYTES_1)); } }
            public WoWGameObjectState State { get { return (WoWGameObjectState) Bytes1[0]; } }
    And the states are as follows;

    Code:
        public enum WoWGameObjectState
        {
            /// <summary>
            /// Show in world as used and not reset. (Closed door open)
            /// </summary>
            Active = 0,
            /// <summary>
            /// Show in world as read. (Closed door close)
            /// </summary>
            Ready = 1,
            /// <summary>
            /// Show in world as used in alt way and not reset (closed door open by cannon fire)
            /// </summary>
            ActiveAlternative = 2
        }
    I may be wrong (I honestly haven't tested it), but that *should* work.


    Also the GO flags;

    Code:
            [Flags]
            public enum GameObjectFlags // :ushort
            {
                /// <summary>
                /// 0x1
                /// Disables interaction while animated
                /// </summary>
                InUse = 0x01,
                /// <summary>
                /// 0x2
                /// Requires a key, spell, event, etc to be opened. 
                /// Makes "Locked" appear in tooltip
                /// </summary>
                Locked = 0x02,
                /// <summary>
                /// 0x4
                /// Objects that require a condition to be met before they are usable
                /// </summary>
                ConditionalInteraction = 0x04,
                /// <summary>
                /// 0x8
                /// any kind of transport? Object can transport (elevator, boat, car)
                /// </summary>
                Transport = 0x08,
                GOFlag_0x10 = 0x10,
                /// <summary>
                /// 0x20
                /// These objects never de-spawn, but typically just change state in response to an event
                /// Ex: doors
                /// </summary>
                DoesNotDespawn = 0x20,
                /// <summary>
                /// 0x40
                /// Typically, summoned objects. Triggered by spell or other events
                /// </summary>
                Triggered = 0x40,
    
                GOFlag_0x80 = 0x80,
                GOFlag_0x100 = 0x100,
                GOFlag_0x200 = 0x200,
                GOFlag_0x400 = 0x400,
                GOFlag_0x800 = 0x800,
                GOFlag_0x1000 = 0x1000,
                GOFlag_0x2000 = 0x2000,
                GOFlag_0x4000 = 0x4000,
                GOFlag_0x8000 = 0x8000,
    
                Flag_0x10000 = 0x10000,
                Flag_0x20000 = 0x20000,
                Flag_0x40000 = 0x40000,
            }
    May be of some use, may not. Either way; I haven't honestly looked into it.

  7. #7
    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)
    Wow thanks for that Apoc, going to start testing now :-) Will post back w/what I discover

    Edit: Just to verify, so I'm not crazy. You're basically looking at the first 8 bits of the GAMEOBJECTS_BYTES_1 correct? (so 1 byte)

    If so, it's always being a 1 even for destroyed gates, hmmmm... Tinkering some more. Just realized my Memory viewer in pocket gnome isn't always flagging the "changed" sections correctly bleh. Going to add a view in 8-bit as well.

    Edit 2: Think I found the gate's health , 0-255. Last byte of GAMEOBJECTS_BYTE_1
    Last edited by Tanaris4; 02-09-2010 at 09:00 PM.
    https://tanaris4.com

  8. #8
    nitrogrlie's Avatar Member
    Reputation
    11
    Join Date
    Oct 2009
    Posts
    81
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm guessing Gate's Health: 0 - 255 is a percent (255 = 0xFF = 100%)

    Also, couldn't you just use traceline to see if you collide with a gate to determine if it is open or close?

  9. #9
    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 I know it's not real health, since when you attack it you can see "1000" move up on the screen

    I'm doing an out of process bot, so I doubt I could use traceline. And is there even a traceline function we can call w/in wow if I was using injection? I wasn't aware of this?
    https://tanaris4.com

  10. #10
    nitrogrlie's Avatar Member
    Reputation
    11
    Join Date
    Oct 2009
    Posts
    81
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Traceline Address: 0x0077D6C0

    I use it for determining if spells I'm casting are obstructed by objects, hence no Line-of-Sight. Ignore the messiness of my code right now...

    Code:
    bool CSpellMgr::HasLineOfSight(sSpellInfo * pSpell, WOWPOS * pPos)
    {
    	if( pSpell )
    	{
    		// If the spell has no range... true of self-cast spells
    		if( pSpell->uiMinRange == 0 && pSpell->uiMaxRange == 0 )
    			return true;
    
    		WOWPOS posMe;
    		g_ptrSelf->GetPosition( &posMe );
    
    		// Increase our z-axis (height) so we check from top of head, not bottom of feet
    		posMe.Z += g_ptrSelf->GetHeight();
    
    		//DBGLOG( "My Position X: " << posMe.X << ", Y: " << posMe.Y << ", Z: " << posMe.Z );
    
    		if( pPos == NULL )
    		{
    			CGUnit_C * target = gpBot->GetCurMgr()->GetCurrentTarget();
    			if( target == NULL ) 
    			{
    				DBGLOG( "[HasLineOfSight] Spell Check for '" << pSpell->sName << "' attempted but no target!!!" );
    				return false; 
    			}
    
    			pPos = new WOWPOS();
    			target->GetPosition( pPos );
    
    			// Increase target's z-axis (height) so we check from top of our head to their's
    			pPos->Z += target->GetHeight();
    		}
    
    		WOWPOS posResult;
    		float  fPercentDistance = 1.0f;
    		bool hitResult = gpBot->GetActions()->TraceLine( *pPos, posMe, posResult, fPercentDistance );
    
    		if( !hitResult )
    			return true;
    		else
    		{
    			DBGLOG( "[HasLineOfSight] Failed " << fPercentDistance*100.0f << "% of the distance" );
    			DBGLOG( "[HasLineOfSight] pResult X: " << posResult.X << ", Y: " << posResult.Y << ", Z: " << posResult.Z );
    		}
    	}
    	return false;
    }

    And the implementation:
    Code:
    bool CActions::TraceLine(WOWPOS &pEnd, WOWPOS &pStart, WOWPOS &pResult, float &fDistance)
    {
    	typedef bool (__cdecl* tTraceLine)(WOWPOS &pointEnd, WOWPOS &pointStart, WOWPOS &pointResult, float &pDistance, unsigned int dwFlag, unsigned int uiOptional);
    	tTraceLine oTraceLine = (tTraceLine)ADDR_TRACELINE;
    
    	return oTraceLine(pEnd, pStart, pResult, fDistance, HIT_LOS, 0);
    }
    where: HIT_LOS = 0x100171

    EDIT: Ignore the small memory-leak in there where if I don't have a position I let the target use it, but never free it... :P
    Last edited by nitrogrlie; 02-12-2010 at 10:03 AM.

  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)
    O snap TY sir that is awesome - I didn't realize we could use it Now I'm going to try to find a way to do it out of process heh
    https://tanaris4.com

  12. #12
    MaiN's Avatar Elite User
    Reputation
    335
    Join Date
    Sep 2006
    Posts
    1,047
    Thanks G/R
    0/10
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Tanaris4 View Post
    O snap TY sir that is awesome - I didn't realize we could use it Now I'm going to try to find a way to do it out of process heh
    How would you do it out of process? Not possible unless you implement your own function.
    [16:15:41] Cypher: caus the CPU is a dick
    [16:16:07] kynox: CPU is mad
    [16:16:15] Cypher: CPU is all like
    [16:16:16] Cypher: whatever, i do what i want

  13. #13
    Cypher's Avatar Kynox's Sister's Pimp
    Reputation
    1358
    Join Date
    Apr 2006
    Posts
    5,368
    Thanks G/R
    0/6
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by MaiN View Post
    How would you do it out of process? Not possible unless you implement your own function.
    You just answered your own question.

    If you want to replicate the functionality provided by an engine function so you can use it out of process, you need to reverse engineer the function and re-implement it.

  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)
    what Cypher said Not saying I can do it, but I semi-know my way around IDA, DEFINITELY not an expert, by any means, still learning

    Doesn't hurt to try I'll post back if i get anywhere
    https://tanaris4.com

Similar Threads

  1. How to detect open windows
    By Diablo3Bot in forum Diablo 3 Memory Editing
    Replies: 9
    Last Post: 11-06-2012, 10:16 AM
  2. Open/close chest
    By overhand in forum Diablo 3 Memory Editing
    Replies: 1
    Last Post: 08-30-2012, 01:34 PM
  3. [Mac][3.2] Game state detection
    By flukes1 in forum WoW Memory Editing
    Replies: 2
    Last Post: 09-10-2009, 01:28 PM
  4. [Zombie] Close Gates to PvP Gear Area In org
    By MabusPwns in forum World of Warcraft Exploits
    Replies: 4
    Last Post: 10-25-2008, 07:46 PM
  5. Ragingwow server closed beta offically open
    By streetratt in forum WoW Emulator Server Listings
    Replies: 0
    Last Post: 12-27-2007, 02:50 AM
All times are GMT -5. The time now is 03:43 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