ty 4 the answers.
ill try vuhdo later on.
This morning I installed stuf unitframes which has a range finder working with stuf_range -> LibRangeCheck-2.0.
They show the range with a text msg like "0 ~ 5" " 5 ~ 10" "10 ~ 15" etc.
Additionally you can set a condition "oor" in the text functions.
I looked through the code and found:
Code:
oor = function(ca, unit)
if ( unit == "player" or not ca.assist or ca.dead or not UnitIsConnected(unit) ) then
return false
elseif ( not UnitIsVisible(unit) ) or
( s40 and IsSpellInRange(s40, unit) == 0 ) or
( not s40 and Stuf.ingroup and ca.ingroup and not UnitInRange(unit) ) then
return true
end
return false
The "IsSpellInRange" function in the elseif-blog is the API-call you mentioned ? Because then I dont understand the "s40" string in the name-tag.
IsSpellInRange("name", "unit")
name - Name of a spell (string)
unit - A unit to target with the spell (string, unitID)
|
Quote from:
http://wowprogramming.com/docs/api/IsSpellInRange
So s40 seems to be a spellname? is s40 spelldummy with 40y range for all classes and does s20 exists?
I also found a way to use "custom LUA-tags" in textboxes and by that (being optimistic) could show a text when beeing out of 20y range, but i'll try that if i fail with the code.
Hope you got some answers for me, because i have no clue which search terms to use for that problem.
Cheers
EDIT: found the s40 reference in the code *facepalm*
looks like the set typical spells for a lot of classes, but not for rogues. Ill change that and see how it works
Code:
-- spell range setup
if CLS == "PALADIN" then
Stuf.supportspell = GetSpellInfo(635)
elseif CLS == "PRIEST" then
Stuf.supportspell = GetSpellInfo(2050)
elseif CLS == "DRUID" then
Stuf.supportspell = GetSpellInfo(5185)
elseif CLS == "MAGE" then
Stuf.supportspell = GetSpellInfo(475)
elseif CLS == "SHAMAN" then
Stuf.supportspell = GetSpellInfo(331)
end