Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2018
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. function chgColor(iFrame,mhp,hp)
  2. local icon = iFrame.frame_hp
  3. local a = hp/mhp
  4. local b = (1-badhp)/2
  5. if a <= (1-b) then
  6. if a <= badhp then
  7. if icon.anim ~= 1 then
  8. if not iFrame.animation then
  9. iFrame.animation = CreateFrame("frame")
  10. end
  11. if iFrame.animation:GetScript("OnUpdate") == nil then
  12. iFrame.animation:SetScript("OnUpdate", function(self)
  13. icon.anim = 1
  14. lowHpAnimation(icon)
  15. end)
  16. end
  17. end
  18. else
  19. icon:SetBackdropColor(icon.classcolor.r,icon.classcolor.g,icon.classcolor.b,i_alpha)
  20. if icon.anim == 1 then
  21. icon.anim = 0
  22. iFrame.animation:SetScript("OnUpdate", nil)
  23. icon:SetAlpha(i_alpha)
  24. icon.anim_alpha_dest = nil
  25. end
  26. end
  27. else
  28. icon:SetBackdropColor(icon.classcolor.r,icon.classcolor.g,icon.classcolor.b,i_alpha)
  29. end
  30. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement