Requesting help creating a Weak Aura probably with some custom LUA

Note: I do not know how to write LUA scripts; I’m mainly asking whether this is possible and also if anyone is willing to straight up write some of this for me if it isn’t much trouble. I don’t know LUA, so I don’t really know how much work this Weak Aura might require if it can’t be done with default presets as I suspect.

How can I have a Weak Aura triggered when Target Health ≤ Player spellpower + N, where N is a predefined, non-dynamic number that I can specify? I’m kinda assuming that this isn’t something that I can accomplish with the preset triggers, but even if it was, spellpower annoyingly seems to be one of the few stats that are missing from the list of options under Player/Unit Info > Character Stats.

Also, how could I go about making ‘N’ a range of numbers rather than just one?

Maybe if you could explain what you’re trying to do with this information I could help.

It looks like you’re trying for a “Do I have enough attack power for a killing blow” sort of thing, but it might be for healing.

There are UnitAttackPower and UnitRangedAttackPower functions in the API that might be of help.

Both return 3 values: base, buff amount, debuff amount. To get the CURRENT (situationally) attack power you sum the first two and subract the third (assuming it’s a positive number - the text in the wiki isn’t clear - you’d have to test that).

If that’s the case, then it’s just a matter of comparing that to your target’s health and evaluating the results.

You’d need it in an event-driven function or a timer-driven function or you’ll get a warning from WA about resource usage, but there are templates for that right in the WA interface.,

That’s precisely what I’m trying to do. I want a Weak Aura that will consistently help me choose the ‘safest’ time to cast Shadow Word: Death. Though, I probably should’ve clarified, I do not know LUA. The extent of my knowledge of it is basically just tweaking tiny pieces of code in Pitbull functions and seeing the resulting changes in displayed info on unit frames. I’m curious to know if this would be simple enough for someone to just write some of it for me, or if this is going to be a bit of a project.

Ultimately, I’d not only like to have a Weak Aura that displays when casting it can possibly kill my target, but also maybe have a progress bar that will show the relative likeliness that the spellcast will successfully kill my target given RNG. For example, if the spell deals 80-100 damage and my target has 90 health left, the progress bar would basically show that I have roughly a 50/50 chance of successfully killing the target with a single cast (though I have no idea if that’s how damage range RNG works in WoW).

Ranged or Melee? I can probably do either, but helps to know.

Sorry for the late reply, I’ve been super busy at work.

It’s specifically for Shadow Word: Death, so it’s a ranged spell.

I’ll take a look today. I’m on my hunter, so the basics can be done with any ranged abilities.

Update: It looks like SWD is not tied to attack power but has a flat amount of damage (expressed as a range between 450 and 522) that it does. That simplifies things GREATLY but I’m not 100% positive the wiki I’m looking at is correct.

Can you confirm that?

If that’s true, the WA is simpler. If it’s not, I’ll need to know the actual parameters of the damage that spell does, although how to find out is a bit beyond me. I don’t play TBC or Classic and I don’t have a Priest.

Update: I broke down and started a Priest in Classic to find out for myself. I have to get him to 14 to get the spell you’re using.

Be a while. Today’s raid day in Retail for me so I’ll be doing that soon. I’ll get this, though. Eventually.

I threw something together. There is a custom trigger that activates on PLAYER_TARGET_CHANGED, UNIT_HEALTH, and UNIT_MAXHEALTH.

function(event, unit)
    if UnitExists("target") and UnitIsEnemy("player", "target") and not UnitIsDeadOrGhost("target") then
        local health, max = UnitHealth("target"), UnitHealthMax("target")
        local int = select(2, UnitStat("player", 4))
        local vers = 1 + GetCombatRatingBonus(CR_VERSATILITY_DAMAGE_DONE)/100
        return health < (health/max < 0.2 and 2.5 or 1) * 0.85 * int * vers
    else
        return false
    end
end

Weak Aura import string:

!WA:2!Dv1ZUTrry8AciaFa14wcTsG0QGOkPeL2M2uqOYbVoBSnYX2S7M2u4GZS7o2ZqwpZ2zMnXPfQu9PC2pc(mN8Ba5jyLfWdqFeYnUX3mRD(3kzVZ3))Z877BlSDP(LIkfDYxpMgYzE8uri(lVHBipMl(PfGhXXT62vIvfMGyHeUOnNYubvCA674onKZJJ4hX8oIMG3)05Kor9Webkur5m5tDLkKqvmOlLrLKI2WlvXHkbTxpSq(z3tm74j3(9PsChuGKlc2HhH33ofunaSUhwnulttV)KWuPI3VdHgHDv0(4O3ltdWhIzQ2cCx6axV2onAyRoobhKRBsPl8Cnmk249ZiWjfPdpblqkUO0ZM7zJLqwRsLUmuFSSORX9gBvK8yjt2ODJYV0XTJFz3Qo(DQuRCZQoBTM1UnR73PMt5g(1MrSt59YPhRZJ84sopR9s7cz9Kovk753Xd8M)qzcooUEKSy2xmOWF1nLz6LRyuFnlDBy1IwWdTR1UaHZaQujxz58w1YRAHyrg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xsYHA90Pq2tS7JOSTZEJr7SFp7pYEl8U415mjIk1RxRd2FNp4w)ZW5F0MKC75h1dqBrLiathrkjDF86F36pU0H)9E))

I’m gonna assume that works. I gave up trying to level a toon in Classic to get the information I need and the communication through this forum thread is agonizingly slow.

I wasn’t able to test it as much as I wanted to, but it seems to work! Thank you so much. I did modify it slightly, as it will trigger if you select dead targets. So far, I haven’t taken any damage from Shadow Word: Death. When I finally get some time off I’ll test it a bit more thoroughly in a questing environment rather than in a dungeon.

Yeah, it would definitely take you a while as Shadow Word: Death is trained at level 62. Thanks for giving it a go though!