Skip to content
View in the app

A better way to browse. Learn more.

WRobot

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Ranges ...

Featured Replies

I'm building a protection warrior fight class, and am having some issues with some of the spells and effective range to target.

Heroic Throw: range must be greater than 8 but less than 30

Here is the scenario I set up:

I positioned my character in game at the precise minimum range where I can cast Heroic Throw. I know this because if I move forward even a tiny distance, the Heroic Throw icon greys out.

I then do a memory info dump, and get these values for my Target:

InteractDistance = 9.3
CombatReach = 6.6
GetDistance = 16.10403
GetDistance2D = 16.0859
GetDistanceZ = 0.7640839

None of these distances is giving me what I'm looking for. From the perspective of being able to cast a spell, I should be at or very slightly above 8 meters.

Even if I subtract CombatReach, that still leaves a distance of 9.9, which is still not accurate. Same for InteractDistance, which if subtracted leaves a distance of 6.9. 

How do I get a real range value that tells me "spell casting range" or whatever?

  • Author

Actually, I believe I might have figured this out...

If I add together my player's CombatReach and the Target's CombatReach, that seems to make up the difference.

So to get the minimum distance I must be from the target:

Spell.MinRange + Me.CombatReach + Target.CombatReach

Of course, if MinRange is 0, we don't need to consider CombatReach, and can ignore it.

And likewise, the maximum distance to target would be:

Spell.MaxRange + Me.CombatReach + Target.CombatReach

This can make a significant difference on very large mobs, when trying to calculate whether a spell can be cast.

For you C# folks, here's a good function to check if a spell is in range to cast:

    public static bool isSpellInRange(Spell spell)
    {
        float minRange = spell.MinRange == 0 ? 0 : spell.MinRange + ObjectManager.Me.CombatReach + ObjectManager.Target.CombatReach;
        float maxRange = spell.MaxRange + ObjectManager.Me.CombatReach + ObjectManager.Target.CombatReach;
        return (minRange <= ObjectManager.Target.GetDistance) && (ObjectManager.Target.GetDistance <= maxRange);
    }

 

  • Author

So I tested this using LUA, and it seems that only spells that actually list a range on their tooltip will work with IsInSpellRange().

Here's the code I tested:

        var lua = new[]
                  {
                      "inRange = 0",
                      "local unit = \"target\"",
                      "if UnitExists(unit) and UnitIsVisible(unit) then",
                      string.Format(" inRange = IsSpellInRange(\"{0}\", unit)", spell.Name),
                      "  if inRange == nil then",
                      "    inRange = 2",
                      "  end",
                      "end",
                  };
        var returnedValue = Lua.LuaDoString<int>(lua, "inRange");

Any spell without a range listed on the tooltip returns 2 (nil) from this snippet.

For example, Revenge does not list a range, but it's description states that it will "deal damage to all enemies in front of you", and through testing has an effective range of 8m (plus the target's CombatReach).

Similarly, the spell Shockwave (a talent) does not list a range on the tooltip, but the description says "Sends a wave of force in a frontal cone, causing 25,052 damage and stunning all enemies within 10 yards for 3 sec." It also returns a 2 (nil).

And AoE spells like Demoralizing Shout and Thunder Clap list their effective range in the spell's description, but does not list an explicit range in the tooltip, and return 2 (nil) when calling IsSpellInRange().

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.