AOE spell casting, terrain click without CTM menu

User Tag List

Results 1 to 9 of 9
  1. #1
    Sednogmah's Avatar Contributor
    Reputation
    129
    Join Date
    Oct 2009
    Posts
    158
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    AOE spell casting, terrain click without CTM

    As I couldn't get AOE casting to work with CTM I tried my luck with something else... As of 3.3.3a this is
    Code:
    004DDCF0    Spell_C__HandleTerrainClick
    typedef bool (*fp_Spell_C__HandleTerrainClick) (TerrainClickStruct*) __attribute__((cdecl));

    "TerrainClickStruct":
    Code:
    typedef struct {
        uint32_t unknown0, unknown1;
        float x, y, z;
    } TerrainClickStruct;
    Using 0 for the unknown 8 bytes worked perfectly for me. I'm not sure about their meaning but WoW seemed to set them to 0, at least when I checked them with a breakpoint in Spell_C__HandleTerrainClick.

    Decompiled function:
    Code:
    bool __cdecl Spell_C__HandleTerrainClick(TerrainClickStruct *tc)
    {
      bool result; // eax@1
      int v2; // edx@3
      int v3; // edx@4
      float v4; // ecx@4
      float v5; // ecx@6
    
      result = dword_AF6940;
      if ( !dword_AF6940 )
      {
        LOBYTE(result) = 0;
        return result;
      }
      v2 = dword_AF693C;
      if ( dword_AF693C & 0x20 )
      {
        *(_DWORD *)(dword_AF6940 + 72) = tc->unknown0;
        *(_DWORD *)(result + 76) = tc->unknown1;
        *(_DWORD *)(result + 88) = LODWORD(tc->x);
        *(_DWORD *)(result + 92) = LODWORD(tc->y);
        v4 = tc->z;
        *(_DWORD *)(result + 40) |= 0x20u;
        *(_DWORD *)(result + 96) = LODWORD(v4);
        v3 = v2 & 0xFFFFFFDF;
      }
      else
      {
        if ( !(dword_AF693C & 0x40) )
        {
          LOBYTE(result) = 0;
          return result;
        }
        *(_DWORD *)(dword_AF6940 + 80) = tc->unknown0;
        *(_DWORD *)(result + 84) = tc->unknown1;
        *(_DWORD *)(result + 100) = LODWORD(tc->x);
        *(_DWORD *)(result + 104) = LODWORD(tc->y);
        v5 = tc->z;
        *(_DWORD *)(result + 40) |= 0x40u;
        *(_DWORD *)(result + 108) = LODWORD(v5);
        v3 = v2 & 0xFFFFFFBF;
      }
      dword_AF693C = v3;
      if ( !v3 )
        result = SendCast(0);
      LOBYTE(result) = 1;
      return result;
    }
    Even though this works very well, I'd still like to know how it's done with CTM, just out of curiosity.
    Last edited by Sednogmah; 04-20-2010 at 11:04 AM.
    951388dcb8e5be825c2c10a7f53c16fcd84fc6c8b76ff0483237eeff745eaeac

    AOE spell casting, terrain click without CTM
  2. #2
    mnbvc's Avatar Banned
    Reputation
    120
    Join Date
    Jul 2009
    Posts
    273
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    from a pm:
    public static bool ClickRemoteLocation(WoWPoint location)
    {
    return Spell_C__HandleTerrainClick(new CTerrainClickEvent {Position = location, GUID = 0, Button = MouseButton.Left});
    }

    And the struct is
    [StructLayout(LayoutKind.Sequential)]
    private struct CTerrainClickEvent
    {
    public ulong GUID;
    public WoWPoint Position;
    [MarshalAs(UnmanagedType.U4)]
    public MouseButton Button;
    }

    -MaiN
    but i did only experience that if you set the "guid" value to something different than 0 you will get a "out of range" error, thus i don't think it's actually the guid, but i also don't have any other idea what it could be :/

  3. #3
    Kryso's Avatar Active Member
    Reputation
    40
    Join Date
    Jul 2009
    Posts
    97
    Thanks G/R
    0/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What about guid of transport? (I haven't done any research on this, just an idea)

  4. #4
    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 Kryso View Post
    What about guid of transport? (I haven't done any research on this, just an idea)
    That is actually a very good guess.
    I'm going to go with Kryso on this one. It's probably so the game knows that it needs to calculate the relative location of the transport to achieve the correct position. To do that it inverses its world matrix and then transform your click location by it.
    [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

  5. #5
    zzgw's Avatar Member
    Reputation
    6
    Join Date
    Mar 2008
    Posts
    31
    Thanks G/R
    0/2
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No, if you look at functions calling that function, you'll see it's mostly just the player's GUID.

  6. #6
    dook123's Avatar Active Member
    Reputation
    21
    Join Date
    Oct 2008
    Posts
    115
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Terrain Click ASM

    Zero seems to work for me. Thanks for the help everyone posting info in this thread.

    Code:
            
            internal static void TerrainClick(float X, float Y, float Z)
            {
                uint MyStructure = Memory.BlackMagic.AllocateMemory(20);
    
                Memory.BlackMagic.WriteFloat(MyStructure, 0);
                Memory.BlackMagic.WriteFloat(MyStructure + 4, 0);
                Memory.BlackMagic.WriteFloat(MyStructure + 8, X);
                Memory.BlackMagic.WriteFloat(MyStructure + 12, Y);
                Memory.BlackMagic.WriteFloat(MyStructure + 16, Z);
    
                Memory.BlackMagic.Asm.Clear();
    
                String[] asm = new String[] 
                {
                "nop",
                "nop",
                "mov eax, " + MyStructure + "",
                "push eax",
                "call " + ((uint)Memory.BaseAddress + (uint)0x49D820),
                "add esp, 0x4",
                "retn"
                };
    
                EndScene.InjectAndExecute(asm);
                Memory.BlackMagic.FreeMemory(MyStructure);
            }
    Last edited by dook123; 07-14-2011 at 05:36 PM.
    ------------------------------
    If not me than who?

  7. #7
    wag321's Avatar Member
    Reputation
    1
    Join Date
    Jul 2010
    Posts
    17
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by dook123 View Post
    Zero seems to work for me. Thanks for the help everyone posting info in this thread.

    Code:
            
            internal static void TerrainClick(float X, float Y, float Z)
            {
                uint MyStructure = Memory.BlackMagic.AllocateMemory(16);
    
                Memory.BlackMagic.WriteFloat(MyStructure, 0);
                Memory.BlackMagic.WriteFloat(MyStructure + 4, 0);
                Memory.BlackMagic.WriteFloat(MyStructure + 8, X);
                Memory.BlackMagic.WriteFloat(MyStructure + 12, Y);
                Memory.BlackMagic.WriteFloat(MyStructure + 16, Z);
    
                Memory.BlackMagic.Asm.Clear();
    
                String[] asm = new String[] 
                {
                "nop",
                "nop",
                "mov eax, " + MyStructure + "",
                "push eax",
                "call " + ((uint)Memory.BaseAddress + (uint)0x49D820),
                "add esp, 0x4",
                "retn"
                };
    
                EndScene.InjectAndExecute(asm);
                Memory.BlackMagic.FreeMemory(MyStructure);
            }
    I may be wrong but I think you need to replace
    Code:
    Memory.BlackMagic.AllocateMemory(16);
    with
    Code:
    Memory.BlackMagic.AllocateMemory(20);
    As you are writing 5 floats you could be overwriting other memory here

  8. #8
    dook123's Avatar Active Member
    Reputation
    21
    Join Date
    Oct 2008
    Posts
    115
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by wag321 View Post
    I may be wrong but I think you need to replace
    Code:
    Memory.BlackMagic.AllocateMemory(16);
    with
    Code:
    Memory.BlackMagic.AllocateMemory(20);
    As you are writing 5 floats you could be overwriting other memory here

    You are correct. Thank you, I will edit the post as incorrect information is not what I intended to share.
    ------------------------------
    If not me than who?

  9. #9
    andy012345's Avatar Active Member
    Reputation
    59
    Join Date
    Oct 2007
    Posts
    124
    Thanks G/R
    0/7
    Trade Feedback
    1 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That "guid" is a uint64 added in wrath. It's set when you use projectile spells from a vehicle.

    It's never been a valid guid.

    Noones really bothered looking into it because the only place it's used it seems to be worthless, projectile spells from vehicle, the destination, speed and pitch of the projectile are all somewhere else.

Similar Threads

  1. How to Cast AOE Spell like Blizzard?
    By phthegreat in forum WoW Memory Editing
    Replies: 9
    Last Post: 07-14-2011, 04:44 PM
  2. Does it possible cast aoe spell click with CTM?
    By NewNerr in forum WoW Memory Editing
    Replies: 6
    Last Post: 07-03-2011, 11:22 PM
  3. OOP - Casting AOE Spells (Protected LUA)
    By Tanaris4 in forum WoW Memory Editing
    Replies: 8
    Last Post: 04-04-2011, 02:39 PM
  4. How to Cast AOE Spell like Blizzard by memorywrite?
    By j_clairol in forum WoW Memory Editing
    Replies: 0
    Last Post: 02-16-2011, 10:27 PM
  5. Help! Cast aoe Spells
    By starfish99 in forum WoW Memory Editing
    Replies: 1
    Last Post: 11-21-2008, 04:36 AM
All times are GMT -5. The time now is 11:48 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