Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function receiveSkillCD(protocol, opcode, buffer)
- print("recebendo")
- local info = loadstring("return " .. buffer)()
- print(buffer)
- onCooldown(info.itemId, info.duration)
- end
- function onCooldown(itemId, duration)
- print("on cd")
- print(itemId)
- local widgetId = "skill"..getSkillIdByItemId(itemId)
- local widget = skillsBarWindow:getChildById(widgetId)
- if not widget then return false end
- local progressRect = widget:getChildById(itemId)
- if not progressRect then
- progressRect = g_ui.createWidget('SkillProgressRect', widget)
- progressRect:setId(itemId)
- progressRect.icon = widget
- progressRect:fill('parent')
- else
- progressRect:setPercent(0)
- end
- local updateFunc = function()
- updateCooldown(progressRect, duration/19)
- end
- local finishFunc = function()
- removeCooldown(progressRect)
- end
- initCooldown(progressRect, updateFunc, finishFunc)
- print("foi")
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement