-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathraw-svo.priesthealing.lua
66 lines (52 loc) · 2.2 KB
/
raw-svo.priesthealing.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
-- Svof (c) 2011-2015 by Vadim Peretokin
-- Svof is licensed under a
-- Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
-- You should have received a copy of the license along with this
-- work. If not, see <http://creativecommons.org/licenses/by-nc-sa/4.0/>.
function ph_diag(aff)
if not sk.healingmap[aff] then
echo(" (your Healing skills don't know how to cure "..aff..")")
return
end
if not sk.healingmap[aff]() then
echo(" (you lack the open channels to cure "..aff..")")
return
end
svo.currently_diagnosing.affs[aff] = true
end
-- called on the prompt to determine, and heal, the most important affliction
-- as determined by sync prio
function healothersaff()
local syncprios = make_sync_prio_table("%s")
-- syncprios is now a sparse table with priorities - afflictions
-- trasverse the table to find the highest priotized affliction
-- that healing can heal
local highestcount, highestaff = 0
for prio, aff in pairs(syncprios) do
-- print(string.format("aff: %s, prio: %s, highestcount: %s, currently_diagnosing: %s, sk.healingmap: %s", aff, prio, highestcount, tostring(svo.currently_diagnosing.affs[aff]), tostring(sk.healingmap[aff])))
if svo.currently_diagnosing.affs[aff] and sk.healingmap[aff] and prio > highestcount and sk.healingmap[aff]() then
highestcount, highestaff = prio, aff
end
end
local cant_heal_these = {"unknowncrippledlimb", "blackout"}
if not highestaff or table.contains(cant_heal_these, highestaff) then echo(string.format("%s hasn't got any afflictions we can cure\n", (svo.currently_diagnosing.name or '?'))) return end
local aff = highestaff
local svonames = {
blind = "blindness",
deaf = "deafness",
blindaff = "blindness",
deafaff = "deafness",
illness = "vomiting",
weakness = "weariness",
crippledleftarm = "arms",
crippledrightarm = "arms",
crippledleftleg = "legs",
crippledrightleg = "legs",
unknowncrippledleg = "legs",
unknowncrippledarm = "arms",
ablaze = "burning",
}
send("heal "..svo.currently_diagnosing.name .." "..(svonames[aff] or aff), false)
echo(" (healing "..(svonames[aff] or aff)..")")
end
echof("Loaded svo Priest Healer.")