vanilla-wow-addons – Blame information for rev 1
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
1 | office | 1 | function Moog_MobHealth_PPP( index ) |
2 | if MobHealth_PPP then |
||
3 | return MobHealth_PPP( index ); |
||
4 | else |
||
5 | if( index and MobHealthDB[index] ) then |
||
6 | local s, e, pts, pct = string.find(MobHealthDB[index], "^(%d+)/(%d+)$"); |
||
7 | if( pts and pct ) then |
||
8 | pts = pts + 0; |
||
9 | pct = pct + 0; |
||
10 | if( pct ~= 0 ) then |
||
11 | return pts / pct; |
||
12 | end |
||
13 | end |
||
14 | end |
||
15 | return 0; |
||
16 | end |
||
17 | end -- of My_MobHealth_PPP |
||
18 | |||
19 | function Moog_MobHealth_GetTargetCurHP() |
||
20 | if MobHealth_GetTargetCurHP then |
||
21 | if MobHealth_GetTargetCurHP() then |
||
22 | return MobHealth_GetTargetCurHP(); |
||
23 | else |
||
24 | return UnitHealth("target"); |
||
25 | end |
||
26 | else |
||
27 | local name = UnitName("target"); |
||
28 | local level = UnitLevel("target"); |
||
29 | local healthPercent = UnitHealth("target"); |
||
30 | if name and level and healthPercent then |
||
31 | local index = name..":"..level; |
||
32 | local ppp = Moog_MobHealth_PPP( index ); |
||
33 | return math.floor( healthPercent * ppp + 0.5); |
||
34 | end |
||
35 | end |
||
36 | return 0; |
||
37 | end -- of My_MobHealth_GetTargetCurHP() |
||
38 | |||
39 | function Moog_MobHealth_GetTargetMaxHP() |
||
40 | if MobHealth_GetTargetMaxHP then |
||
41 | if MobHealth_GetTargetMaxHP() then |
||
42 | return MobHealth_GetTargetMaxHP(); |
||
43 | else |
||
44 | return 100; |
||
45 | end |
||
46 | else |
||
47 | local name = UnitName("target"); |
||
48 | local level = UnitLevel("target"); |
||
49 | if name and level then |
||
50 | local index = name..":"..level; |
||
51 | local ppp = Moog_MobHealth_PPP( index ); |
||
52 | return math.floor( 100 * ppp + 0.5); |
||
53 | end |
||
54 | end |
||
55 | return 0; |
||
56 | end -- of My_MobHealth_GetTargetMaxHP() |