1. #1

    Weak Aura track buff refresh

    I want to keep a running counter during combat to keep track of number of buff refreshes for Shooting Stars proc. It's easy to look it up on WoL but I'd like something more real time. I am unsure if and/or how a WA can track a combat log event (or even if there's another way to go about doing this).

  2. #2
    The Patient
    15+ Year Old Account
    Join Date
    Apr 2008
    Location
    United Kingdom
    Posts
    319
    Does Skada or Recount not tell you the amount of procs?

    What you said is possible in WA however tracking combat could be quite difficult (I think) if you factor in combat res on you if you die, otherwise you would have to create custom code for events PLAYER_REGEN_DISABLED. PLAYER_REGEN_ENABLED and COMBAT_LOG_EVENT_UNFILTERED if you want it to reset when you die. There might be an easier way but I can't think of one right now.

  3. #3
    If I could have the code for just tracking it within WA, I can go from there to looking for something that works for out of combat. I think if I keep the function variable that tracks it local and have the WA load on combat, it should automatically reset on combat. One step at a time though, I don't know how to write a function that can recognize a spell refresh.

  4. #4
    The Patient
    15+ Year Old Account
    Join Date
    Apr 2008
    Location
    United Kingdom
    Posts
    319
    I'm going to assume that it uses SPELL_AURA_APPLIED when you don't have the buff and if you do have the buff and the buff refreshes (is this possible?) it uses SPELL_AURA_REFRESH.

    Anyhow I'll give you a basic step which will print the Shooting Star proc number (does not track combat state so will work out and in combat, does not have a reset function unless you /reload).

    Create a new aura and go to trigger, choose custom -> event -> type in COMBAT_LOG_EVENT_UNFILTERED under Event(s).

    Under the custom trigger enter:
    Code:
    function(event, timestamp, message, hideCaster, sourceGUID, sourceName, sourceFlags, sourceRaidFlags, destGUID, destName, destFlags, destRaidFlags, ...)  
        if message == "SPELL_AURA_APPLIED" or message == "SPELL_AURA_REFRESH" then
            local spellId, spellName, spellSchool = ...
            if sourceName == UnitName("player") and spellId == 93400 then
    			if not WeakAuraSScount then
    				WeakAuraSScount = 1
    				print(WeakAuraSScount.. " Shooting Star Procs")
    				else
    				WeakAuraSScount = WeakAuraSScount + 1 
    				print(WeakAuraSScount.. " Shooting Star Procs")
    			end
    		end
    	end
    end
    Untested, should work though.
    Last edited by suprep; 2013-06-23 at 02:45 AM.

  5. #5
    I appreciate it!
    I've re-eingeered the code to fit my specifications.
    It now only increases counter on a refresh and in combat.
    It now resets the counter when you refresh mark of the wild on yourself AND you are out of combat
    Code:
    function(event, timestamp, message, hideCaster, sourceGUID, sourceName, sourceFlags, sourceRaidFlags, destGUID, destName, destFlags, destRaidFlags, ...)  
        
        if message == "SPELL_AURA_REFRESH" then
            local spellId, spellName, spellSchool = ...
            if sourceName == UnitName("player") and spellId == 1126 then
                if UnitAffectingCombat("player") == nil then
                    if not WeakAuraSScount or not WeakAuraSSdamage then
                        WeakAuraSScount = 0
                        WeakAuraSSdamage = 0
                    end
                    print("Since last combat:")
                    print(WeakAuraSScount.. " SS procs refreshed")
                    ratio = WeakAuraSScount/WeakAuraSSdamage
                    ratio = ratio * 100
                    if WeakAuraSSdamage == 0 then
                        ratio = 0
                    end
                    print("SS loss: ".. math.floor(ratio*math.pow(10,2)+0.5) / math.pow(10,2).. "%")
                    print("SS Count reset")
                    WeakAuraSScount = 0
                    WeakAuraSSdamage = 0
                end
            end
            if UnitAffectingCombat("player") == 1 then
                if sourceName == UnitName("player") and spellId == 93400 then
                    WeakAuraSScount = WeakAuraSScount + 1 
                end
            end
        end
        if message == "SPELL_DAMAGE" then
            local spellId, spellName, spellSchool = ...
            if sourceName == UnitName("player") and spellName == "Starsurge" then
                WeakAuraSSdamage = WeakAuraSSdamage + 1
            end
        end
    end

    EDIT:
    One last change. Instead of making it print each refresh, I am now only printing when I am resetting so I know how much was done since last reset.

    Need to add a check if the variable exists, accidently deleted it.. but doing more edits right now so I'll have something else up soon.

    FINAL EDIT:
    Finished. Now also prints out truncated percentage of lost shooting stars procs to successful starsurge casts.
    Last edited by boomkinhero; 2013-06-23 at 05:49 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •