-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.lua
69 lines (56 loc) · 1.94 KB
/
init.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
aura_env.debug = function(string)
if aura_env.config.debug then
print(string)
end
end
aura_env.GetBookSpellIndex = function(spellId, bookType)
aura_env.debug("GetBookSpellIndex("..spellId..","..bookType..") invoked")
--1000 is maximum index
for i=1,1000,1 do
local skillType,bookSpellId = GetSpellBookItemInfo(i, bookType)
if not skillType then
break
end
aura_env.debug(i.." "..skillType.." "..bookSpellId)
if bookSpellId == spellId then
aura_env.debug("Found spell id: "..spellId.." in bookType: "..bookType.. ".")
return i
end
end
aura_env.debug("Spell id: "..spellId.." in bookType: "..bookType.. " not found.")
return nil
end
--Wing Clip rank 1
aura_env.WingClipIndex = aura_env.GetBookSpellIndex(2974, "spell")
aura_env.AutoShotIndex = aura_env.GetBookSpellIndex(75, "spell")
aura_env.SixDemonBagItemId = 7734 --30 meters cast range
aura_env.IsValidEnemyUnit = function(unit)
return UnitExists(unit)
and UnitIsVisible(unit)
and UnitCanAttack("player", unit)
and not UnitIsDead(unit)
end
aura_env.IsMeleeRange = function(unit)
if IsSpellInRange(aura_env.WingClipIndex, "spell", unit) == 1 then
aura_env.debug("Melee range with "..unit)
return true
end
aura_env.debug("Not melee range with "..unit)
return false
end
aura_env.IsAutoShotRange = function(unit)
if IsSpellInRange(aura_env.AutoShotIndex, "spell", unit) == 1 then
aura_env.debug("Auto shot range with "..unit)
return true
end
aura_env.debug("Not auto shot range with "..unit)
return false
end
aura_env.Is30MetersRange = function(unit)
if IsItemInRange(aura_env.SixDemonBagItemId, unit) then
aura_env.debug("30 meters or less from "..unit)
return true
end
aura_env.debug("More than 30 meters from "..unit)
return false
end