AOE Target Spells (HandleTerrainClick) Question menu

User Tag List

Results 1 to 6 of 6
  1. #1
    Shadowhunter12's Avatar Member
    Reputation
    1
    Join Date
    Sep 2012
    Posts
    44
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    AOE Target Spells (HandleTerrainClick) Question

    Good Morning Everyone.

    I am looking to work in AOE spell targetting into my bot and I have a question.

    I am using the following code and offset:

    Code:
    public static uint HandleTerrainClick = 0x3FCD50;
    
            [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
            private delegate bool HandleTerrainClickDelegate(CTerrainClickEvent clickEvent);
            private static HandleTerrainClickDelegate WoWFunction_HandleTerrainClick;
            
            [StructLayout(LayoutKind.Sequential)]
            private struct CTerrainClickEvent
            {
                public ulong GUID;
                public Location Position;
                public uint Button;
            }
    
            public static bool ClickRemoteLocation(Location location)
            {
                if (WoWFunction_HandleTerrainClick == null)
                    WoWFunction_HandleTerrainClick = WoW.Memory.CreateFunction<HandleTerrainClickDelegate>(new IntPtr(PatternOffsets.HandleTerrainClick), true);
    
                return WoWFunction_HandleTerrainClick(new CTerrainClickEvent { Position = location, GUID = 0, Button = 0 });
            }

    I am getting an AccessViolationException when running that function, so I am assuming that my offset may be incorrect or that I am not calling it correctly. Does anyone have any experience with the HandleTerrainClick function that may be able to point me in the right direction?

    Thanks in advance!

    -Shadow
    Last edited by Shadowhunter12; 01-24-2013 at 10:00 AM.

    AOE Target Spells (HandleTerrainClick) Question
  2. #2
    Jadd's Avatar 🐸 Premium Seller
    Reputation
    1511
    Join Date
    May 2008
    Posts
    2,432
    Thanks G/R
    81/333
    Trade Feedback
    1 (100%)
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Post crash dump (careful to remove your account, character name, guid etc.).

  3. #3
    Shadowhunter12's Avatar Member
    Reputation
    1
    Join Date
    Sep 2012
    Posts
    44
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Jadd View Post
    Post crash dump (careful to remove your account, character name, guid etc.).
    Thanks for your quick response. I'll work on getting the crash dump.

    Just looking at the code, is the offset, CTerrainClickEvent, and the method of calling look correct?

    Thanks again!

    -Shadow

  4. #4
    TOM_RUS's Avatar Legendary
    Reputation
    914
    Join Date
    May 2008
    Posts
    699
    Thanks G/R
    0/52
    Trade Feedback
    0 (0%)
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Isn't argument of that function supposed to be a pointer (ref in C#) to struct?

  5. #5
    Jadd's Avatar 🐸 Premium Seller
    Reputation
    1511
    Join Date
    May 2008
    Posts
    2,432
    Thanks G/R
    81/333
    Trade Feedback
    1 (100%)
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by TOM_RUS View Post
    Isn't argument of that function supposed to be a pointer (ref in C#) to struct?
    Seems like a common reason for an access violation to me.

  6. #6
    Shadowhunter12's Avatar Member
    Reputation
    1
    Join Date
    Sep 2012
    Posts
    44
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by TOM_RUS View Post
    Isn't argument of that function supposed to be a pointer (ref in C#) to struct?
    Worked, thanks so much!!

Similar Threads

  1. PQR: cast spell when target is near. [question]
    By Fantersam123 in forum WoW Bot Maps And Profiles
    Replies: 10
    Last Post: 06-12-2013, 11:05 AM
  2. And again spell Cooldowns question
    By HexNeo in forum WoW Memory Editing
    Replies: 20
    Last Post: 04-20-2012, 02:24 PM
  3. Spell swap question (no animation > taunka from dbw proc)
    By yoan61 in forum WoW ME Questions and Requests
    Replies: 0
    Last Post: 09-18-2010, 10:20 AM
  4. Some Spell Editing Questions
    By Glacialus in forum WoW ME Questions and Requests
    Replies: 11
    Last Post: 11-22-2007, 03:24 PM
  5. [Question] Quick spell model question
    By Naralesca in forum WoW ME Questions and Requests
    Replies: 5
    Last Post: 10-02-2007, 11:21 AM
All times are GMT -5. The time now is 01:58 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search