Leorazor90, попробуй так
Код:
function inTillerDefile:WaitFocusTarget()
self.timerCount = self.timerCount + 1
local current_ft = UnitName("boss1")
if self.focustarget ~= current_ft then
SendChatMessage(">> "..GetSpellLink(72754).." на тебе, выбегай из рейда! <<", "WHISPER", nil, current_ft)
SendChatMessage(">> "..GetSpellLink(72754).." на " .. current_ft .. " <<", "RAID_WARNING")
self:CancelTimer(self.targetTimer)
end
if self.timerCount == 20 then
self:CancelTimer(self.targetTimer)
end
end
function inTillerDefile:UNIT_SPELLCAST_START(event, unit, spell)
if unit == "focus" then
self.focustarget = UnitName("boss1")
if (self.focustarget ~= nil) and spell == "Осквернение" then
self.timerCount = 0
self.targetTimer = self:ScheduleRepeatingTimer("WaitFocusTarget", .1)
end
end
end