forked from jp-ganis/JPS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jphealing.lua
executable file
·45 lines (38 loc) · 1.12 KB
/
jphealing.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
--Blacklistplayer functions
--These functions will blacklist a target for a set time.
function jps.UpdateHealerBlacklist(self)
if #jps.HealerBlacklist > 0 then
for i = #jps.HealerBlacklist, 1, -1 do
if GetTime() - jps.HealerBlacklist[i][2] > jps.BlacklistTimer then
if jps.Debug then print("Releasing ", jps.HealerBlacklist[i][1]) end
table.remove(jps.HealerBlacklist,i)
end
end
end
end
function jps.PlayerIsBlacklisted(unit)
local playername
if UnitExists(unit) and UnitIsPlayer(unit) then
playername = GetUnitName(unit)
end
for i = 1, #jps.HealerBlacklist do
if jps.HealerBlacklist[i][1] == playername then
return true
end
end
return false
end
function jps.BlacklistPlayer(unit)
local playername
if UnitExists(unit) and UnitIsPlayer(unit) then
playername = GetUnitName(unit)
end
if playername ~= nil then
local playerexclude = {}
table.insert(playerexclude, playername)
table.insert(playerexclude, GetTime())
table.insert(jps.HealerBlacklist,playerexclude)
if jps.Debug then print("Blacklisting ", playername) end
end
end
---More to come...