PVP Remaining Timer for Dogtags/Pitbull #6


  • New
  • Patch
Open
Assigned to ckknight
  • Tsevion created this issue Nov 2, 2008

    Here's some code I whipped up to add a time remaining before PVP flag drops tag:

    I put this is Status.lua:

    DogTag:AddTag("Unit", "PVPRemaining", {
        code = function(unit)
            if unit == 'player' and IsPVPTimerRunning() then
                local t = GetPVPTimer()/1000
                if(t < 1) then
                    return nil
                else
                    return t
                end
            else
                return nil
            end
        end,
        arg = {
            'unit', 'string;undef', 'player'
        },
        ret = "number;nil",
        events = "PVPRemaining#$unit",
        doc = L["Return the time remaining until PVP flag expires"],
        example = ('[PVPRemaining] => "110"; [PVPRemaining:FormatDuration] => "1:50"'),
        category = L["Status"]
    })

    And I added this to DogTag:AddTimerHandler:

        if IsPVPTimerRunning() then
            DogTag:FireEvent("PVPRemaining", 'player')
        end

  • Tsevion added the tags New Patch Nov 2, 2008
  • Shefki posted a comment Dec 23, 2008

    Committed something similar but different last night.


To post a comment, please login or register a new account.