1. #1
    Field Marshal opbear's Avatar
    10+ Year Old Account
    Join Date
    Jan 2014
    Location
    Brisbane, Australia
    Posts
    84

    WeakAuras Range Check with Enemy target

    Just got my legendary ring, and with its 20yard damage burst, I was wondering if I can have a range check to sit next to my ring proc icon.
    I can only find previous WA's of range checks with other players, but none to my current target / enemy target.

  2. #2
    Deleted
    You can't get exact distances to anything but group members. (Not even friendly units outside of your group)

  3. #3
    There was a similar thread for a range tracker WA posted under the hunter section of the forums. It was intended for the Archimonde trinket for MM but I can see how this would be a great application of it as well.

    You can find his string here: www . mmo-champion . com/threads/1813748-WA-How-far-I-am-from-my-target . (I'm sorry I can't correctly link - my posting privileges are limited.) You can customize the text as you see fit.

    Some of the people there also recommended using the addon Range Display. Though there are a variety of options with the addon, I prefer the WA; Having it only load when playing a certain spec or class (or in this case, characters using the ring) is such a luxury. See how they work out for you.

  4. #4
    Yeah, it's much, much easier to use an addon for this -- you can't get the exact range, but you can estimate it like the libRangeCheck library does, and/or some hard-coded stuff.

    That said, all you care about is 20 yards or less, right? You could use this custom trigger:

    Code:
    function()
      return IsItemInRange(10645, "target")
    end
    That item (Gnomish Death Ray) has a 20 yard range, and you don't need it in your possession to test range on it...

  5. #5
    Here is the code i have for the range finder i use.

    Code:
    {
        ["textFlags"] = "OUTLINE",
        ["stacksSize"] = 12,
        ["xOffset"] = -98.999755859375,
        ["stacksFlags"] = "None",
        ["yOffset"] = -106.00009155273,
        ["anchorPoint"] = "CENTER",
        ["borderColor"] = {
            [1] = 0,
            [2] = 0,
            [3] = 0,
            [4] = 1,
        },
        ["rotateText"] = "NONE",
        ["icon"] = false,
        ["fontFlags"] = "OUTLINE",
        ["icon_color"] = {
            [1] = 1,
            [2] = 1,
            [3] = 1,
            [4] = 1,
        },
        ["selfPoint"] = "CENTER",
        ["barColor"] = {
            [1] = 0.76470588235294,
            [2] = 1,
            [3] = 0.43137254901961,
            [4] = 1,
        },
        ["desaturate"] = false,
        ["sparkOffsetY"] = 0,
        ["load"] = {
            ["use_never"] = false,
            ["talent"] = {
                ["multi"] = {
                },
            },
            ["class"] = {
                ["single"] = "HUNTER",
                ["multi"] = {
                    ["HUNTER"] = true,
                },
            },
            ["difficulty"] = {
                ["multi"] = {
                },
            },
            ["race"] = {
                ["multi"] = {
                },
            },
            ["spec"] = {
                ["single"] = 2,
                ["multi"] = {
                    [2] = true,
                },
            },
            ["role"] = {
                ["multi"] = {
                },
            },
            ["size"] = {
                ["multi"] = {
                },
            },
        },
        ["timerColor"] = {
            [1] = 1,
            [2] = 1,
            [3] = 1,
            [4] = 1,
        },
        ["regionType"] = "aurabar",
        ["stacks"] = false,
        ["init_completed"] = 1,
        ["texture"] = "Minimalist",
        ["textFont"] = "Friz Quadrata TT",
        ["zoom"] = 0,
        ["spark"] = false,
        ["timerFont"] = "Friz Quadrata TT",
        ["alpha"] = 1,
        ["borderInset"] = 1,
        ["textColor"] = {
            [1] = 1,
            [2] = 1,
            [3] = 1,
            [4] = 1,
        },
        ["borderBackdrop"] = "Solid",
        ["disjunctive"] = true,
        ["customText"] = "function()\n    if(IsItemInRange(\"item:90067\",\"target\")) then\n        return \"0-10 yrs\"\n    end\n    if (IsItemInRange(\"item:90067\",\"target\")~=1) then\n        if (IsItemInRange(\"item:50741\",\"target\")) then\n            return \"10-15 yrs\"\n        end\n    end\n    if (IsItemInRange(\"item:50741\",\"target\")~=1) then\n        if (IsItemInRange(\"item:22783\",\"target\")) then\n            return \"15-20 yrs\"\n        end\n    end\n    if (IsItemInRange(\"item:22783\",\"target\")~=1) then\n        if (IsItemInRange(\"item:24268\",\"target\")) then\n            return \"20-25 yrs\"\n        end\n    end\n    if (IsItemInRange(\"item:24268\",\"target\")~=1) then\n        if (IsItemInRange(\"item:119083\",\"target\")) then\n            return \"25-30 yrs\"\n        end\n    end\n    if (IsItemInRange(\"item:119083\",\"target\")~=1) then\n        if (IsItemInRange(\"item:41509\",\"target\")) then\n            return \"30-35 yrs\"\n        end\n    end\n    if (IsItemInRange(\"item:41509\",\"target\")~=1) then\n        if (IsItemInRange(\"item:116400\",\"target\")) then\n            return \"35-40 yrs\"\n        end\n    end\n    if (IsItemInRange(\"item:116400\",\"target\")~=1) then\n        if (IsSpellInRange(\"Concussive Shot\",\"target\")==1) then\n            return \"40+ yrs\"\n        end\n    end\nend",
        ["untrigger"] = {
            ["custom"] = "\n\n",
            ["unit"] = "target",
        },
        ["sparkRotationMode"] = "AUTO",
        ["textSize"] = 14,
        ["animation"] = {
            ["start"] = {
                ["duration_type"] = "seconds",
                ["type"] = "none",
            },
            ["main"] = {
                ["duration"] = "",
                ["colorR"] = 0,
                ["use_color"] = true,
                ["duration_type"] = "seconds",
                ["colorType"] = "custom",
                ["scalex"] = 1,
                ["alpha"] = 0,
                ["x"] = 0,
                ["y"] = 0,
                ["colorA"] = 1,
                ["colorG"] = 0,
                ["colorB"] = 0,
                ["colorFunc"] = "return function(progress, r1, g1, b1, a1, r2, g2, b2, a2)\n    return r,g,b,a\nend",
                ["rotate"] = 0,
                ["scaley"] = 1,
                ["type"] = "custom",
            },
            ["finish"] = {
                ["duration_type"] = "seconds",
                ["type"] = "none",
            },
        },
        ["trigger"] = {
            ["sourceunit"] = "player",
            ["duration"] = "20",
            ["subeventPrefix"] = "SPELL",
            ["unit"] = "player",
            ["debuffType"] = "HELPFUL",
            ["use_attackable"] = true,
            ["spellName"] = "Sanha",
            ["custom_hide"] = "timed",
            ["type"] = "aura",
            ["subeventSuffix"] = "_CAST_SUCCESS",
            ["unevent"] = "auto",
            ["event"] = "Unit Characteristics",
            ["spellIds"] = {
            },
            ["use_source"] = false,
            ["use_spellName"] = true,
            ["custom_type"] = "event",
            ["customName"] = "\n\n",
            ["custom"] = "\n\n",
            ["use_sourceunit"] = true,
            ["check"] = "event",
            ["ownOnly"] = true,
            ["names"] = {
                [1] = "Longview",
            },
            ["use_unit"] = true,
        },
        ["text"] = true,
        ["stickyDuration"] = false,
        ["timer"] = true,
        ["timerFlags"] = "OUTLINE",
        ["sparkBlendMode"] = "ADD",
        ["backdropColor"] = {
            [1] = 1,
            [2] = 1,
            [3] = 1,
            [4] = 0,
        },
        ["sparkTexture"] = "Interface\\CastingBar\\UI-CastingBar-Spark",
        ["borderOffset"] = 1,
        ["auto"] = true,
        ["stacksFont"] = "Friz Quadrata TT",
        ["border"] = true,
        ["borderEdge"] = "Blizzard Achievement Wood",
        ["displayTextLeft"] = " ",
        ["borderSize"] = 3,
        ["inverse"] = false,
        ["icon_side"] = "LEFT",
        ["backgroundColor"] = {
            [1] = 0,
            [2] = 0,
            [3] = 0,
            [4] = 0.25,
        },
        ["customTextUpdate"] = "update",
        ["sparkHeight"] = 30,
        ["sparkOffsetX"] = 0,
        ["displayTextRight"] = " %c",
        ["stacksColor"] = {
            [1] = 1,
            [2] = 1,
            [3] = 1,
            [4] = 1,
        },
        ["timerSize"] = 14,
        ["id"] = "Range Finder",
        ["additional_triggers"] = {
            [1] = {
                ["trigger"] = {
                    ["custom_hide"] = "timed",
                    ["type"] = "custom",
                    ["custom"] = "function()  \n    if(IsItemInRange(\"item:90067\",\"target\")) then\n        r,g,b,a = 0.75,0,0,1\n        return true\n    end    \n    if (IsItemInRange(\"item:90067\",\"target\")~=1) then\n        if (IsItemInRange(\"item:50741\",\"target\")) then\n            r,g,b,a = 1,0,0,1\n            return true\n        end\n    end\n    if (IsItemInRange(\"item:50741\",\"target\")~=1) then\n        if (IsItemInRange(\"item:22783\",\"target\")) then\n            r,g,b,a = 1,0.25,0,1\n            return true\n        end\n    end    \n    if (IsItemInRange(\"item:22783\",\"target\")~=1) then\n        if (IsItemInRange(\"item:24268\",\"target\")) then\n            r,g,b,a = 1,0.5,0,1\n            return true\n        end\n    end\n    if (IsItemInRange(\"item:24268\",\"target\")~=1) then\n        if (IsItemInRange(\"item:119083\",\"target\")) then\n            r,g,b,a = 1,0.75,0,1\n            return true\n        end\n    end\n    if (IsItemInRange(\"item:119083\",\"target\")~=1) then\n        if (IsItemInRange(\"item:41509\",\"target\")) then\n            r,g,b,a = 1,1,0,1\n            return true\n        end\n    end\n    if (IsItemInRange(\"item:41509\",\"target\")~=1) then\n        if (IsItemInRange(\"item:116400\",\"target\")) then\n            r,g,b,a = 0.75,1,0,1\n            return true\n        end\n    end\n    if (IsItemInRange(\"item:116400\",\"target\")~=1) then\n        if (IsSpellInRange(\"Concussive Shot\",\"target\")==1) then\n            r,g,b,a = 0.5,1,0,1\n            return true\n        end\n    end\n    r,g,b,a = 0,0,0,1\n    return true\nend",
                    ["subeventSuffix"] = "_CAST_START",
                    ["check"] = "update",
                    ["custom_type"] = "status",
                    ["event"] = "Health",
                    ["subeventPrefix"] = "SPELL",
                },
                ["untrigger"] = {
                    ["custom"] = "function()\n    return true\nend",
                },
            },
            [2] = {
                ["trigger"] = {
                    ["type"] = "custom",
                    ["custom_type"] = "status",
                    ["event"] = "Health",
                    ["subeventPrefix"] = "SPELL",
                    ["unevent"] = "auto",
                    ["custom"] = "function()\n    if (IsSpellInRange(\"Concussive Shot\",\"target\")==1) then\n        return true\n    end\nend",
                    ["subeventSuffix"] = "_CAST_START",
                    ["check"] = "update",
                    ["use_unit"] = true,
                    ["unit"] = "player",
                    ["custom_hide"] = "timed",
                },
                ["untrigger"] = {
                    ["custom"] = "function()\n    return true\nend",
                },
            },
            [3] = {
                ["trigger"] = {
                    ["use_hostility"] = false,
                    ["use_character"] = false,
                    ["hostility"] = "hostile",
                    ["character"] = "npc",
                    ["spellName"] = 0,
                    ["use_attackable"] = true,
                    ["debuffType"] = "HELPFUL",
                    ["names"] = {
                    },
                    ["type"] = "status",
                    ["use_targetRequired"] = false,
                    ["unevent"] = "auto",
                    ["subeventSuffix"] = "_CAST_START",
                    ["use_alwaystrue"] = true,
                    ["event"] = "Unit Characteristics",
                    ["custom_hide"] = "timed",
                    ["use_threatUnit"] = true,
                    ["use_spellName"] = true,
                    ["spellIds"] = {
                    },
                    ["unit"] = "target",
                    ["subeventPrefix"] = "SPELL",
                    ["use_alive"] = true,
                    ["custom_type"] = "event",
                    ["use_unit"] = true,
                },
                ["untrigger"] = {
                    ["unit"] = "target",
                },
            },
        },
        ["sparkRotation"] = 0,
        ["frameStrata"] = 1,
        ["width"] = 100,
        ["sparkWidth"] = 10,
        ["barInFront"] = true,
        ["numTriggers"] = 4,
        ["sparkDesature"] = false,
        ["orientation"] = "HORIZONTAL_INVERSE",
        ["height"] = 30,
        ["sparkColor"] = {
            [1] = 1,
            [2] = 1,
            [3] = 1,
            [4] = 1,
        },
        ["actions"] = {
            ["start"] = {
            },
            ["init"] = {
            },
            ["finish"] = {
                ["do_custom"] = false,
            },
        },
    }

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •