Skip to content

Instantly share code, notes, and snippets.

@arieh
Created May 16, 2018 11:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arieh/756285d088ce1905b4b29b4533e50b4c to your computer and use it in GitHub Desktop.
Save arieh/756285d088ce1905b4b29b4533e50b4c to your computer and use it in GitHub Desktop.
^1^T^SType^Sconditionicon ^SConditions^T ^N1^T ^SType^SINSTANCE2 ^SBitFlags^N245760 ^t^Sn^N1 ^t^SEvents^T ^N1^T ^SType^SLua ^SLua^Slocal~`icon~`=~`...~J ~J if~`TMW.getLowHealthCount~`then~`return~`end~J TMW.getLowHealthCount~`=~`true~J icon.env_aura~`=~`{};~J local~`aura_env=~`icon.env_aura~J aura_env.low_health_count~`=~`0;~J local~`counter_name~`=~`"low_health_count";~J ~J function~`getLowHealthCount()~J ~`~`~`~`local~`low_health_count~`=~`0~J ~`~`~`~`~J ~`~`~`~`local~`i,~`unit_name,~`current,~`max~J ~`~`~`~`~J ~`~`~`~`for~`i=1,40~`do~`~J ~`~`~`~`~`~`~`~`unit_name~`=~`GetRaidRosterInfo(index)~J ~`~`~`~`~`~`~`~`if~`(unit_name)~`then~J ~`~`~`~`~`~`~`~`~`~`~`~`current~`=~`UnitHealth(unit_name)~J ~`~`~`~`~`~`~`~`~`~`~`~`max~`=~`UnitHealthMax(unit_name)~J ~`~`~`~`~`~`~`~`~`~`~`~`~J ~`~`~`~`~`~`~`~`~`~`~`~`if~`(current~`/~`max~`<~`0.3)~`then~J ~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`low_health_count~`=~`~`low_health_count+1~J ~`~`~`~`~`~`~`~`~`~`~`~`end~J ~`~`~`~`~`~`~`~`end~J ~`~`~`~`end~J ~`~`~`~`~J ~`~`~`~`return~`low_health_count~J end~J ~J TMW_ST:InitCounter(counter_name,~`aura_env.fragment_counter)~J ~J LibStub("AceEvent-3.0"):Embed(aura_env);~J ~J function~`aura_env:COMBAT_LOG_EVENT_UNFILTERED(event,...)~`~`~J ~`~`~`~`local~`_,~`t~`=~`GetInstanceInfo()~J ~`~`~`~`~J ~`~`~`~`if~`(t~`~|=~`'raid')~`then~`return~`end~J ~`~`~`~`~J ~`~`~`~`aura_env.low_health_count~`=~`getLowHealthCount()~J ~`~`~`~`TMW_ST:UpdateCounter(counter_name,~`~`aura_env.low_health_count)~J ~`~`~`~`~J ~`~`~`~`return~`true~J end~`~J ~J aura_env:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")~J ~J ~J ~J ~J ^SEvent^SOnEventsRestored ^t^Sn^N1 ^t^SSettingsPerView^T ^Sicon^T ^STexts^T ^N1^S[Counter("low_health_count")] ^t^t^t^SCustomTex^S6940 ^SStates^T ^N1^T ^t^N2^T ^SAlpha^N1 ^t^N3^T ^t^N4^T ^t^t^SEnabled^B ^t^N84305^S~`~| ^Sicon^^
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment