6 - PVP Remaining Timer for Dogtags/Pitbull
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
| User | When | Change |
|---|---|---|
| Tsevion | Nov 03, 2008 at 02:52 UTC | Create |
- 1 comment
- 1 comment
- Reply
- #1
Shefki Dec 23, 2008 at 10:55 UTC - 0 likesCommitted something similar but different last night.