From 8290b8a8c111c274c7465751ea4ee3afbfb3fbaa Mon Sep 17 00:00:00 2001 From: F16Gaming Date: Sat, 2 Feb 2013 13:43:37 +0100 Subject: [PATCH] It's now possible to disable kill achiev notices by setting the threshold to 0. --- KillTrack.lua | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/KillTrack.lua b/KillTrack.lua index 6c68983..934c199 100644 --- a/KillTrack.lua +++ b/KillTrack.lua @@ -245,8 +245,12 @@ function KT:SetThreshold(threshold) error("KillTrack.SetThreshold: Argument #1 (threshold) must be of type 'number'") end self.Global.ACHIEV_THRESHOLD = threshold - self:ResetAchievCount() - KT:Msg(("New kill notice (achievement) threshold set to %d."):format(threshold)) + if threshold > 0 then + self:ResetAchievCount() + KT:Msg(("New kill notice (achievement) threshold set to %d."):format(threshold)) + else + KT:Msg("Kill notices have been disabled (set threshold to a value greater than 0 to re-enable).") + end end function KT:SetImmediateThreshold(threshold) @@ -296,13 +300,13 @@ function KT:AddKill(id, name) end if type(self.Global.MOBS[id].AchievCount) ~= "number" then self.Global.MOBS[id].AchievCount = floor(self.Global.MOBS[id].Kills / self.Global.ACHIEV_THRESHOLD) - if self.Global.MOBS[id].AchievCount >= 1 then + if self.Global.ACHIEV_THRESHOLD > 0 and self.Global.MOBS[id].AchievCount >= 1 then self:KillAlert(self.Global.MOBS[id]) end else local achievCount = self.Global.MOBS[id].AchievCount self.Global.MOBS[id].AchievCount = floor(self.Global.MOBS[id].Kills / self.Global.ACHIEV_THRESHOLD) - if self.Global.MOBS[id].AchievCount > achievCount then + if self.Global.ACHIEV_THRESHOLD > 0 and self.Global.MOBS[id].AchievCount > achievCount then self:KillAlert(self.Global.MOBS[id]) end end -- 1.7.9.5