Advertisement
Guest User

Untitled

a guest
Nov 24th, 2014
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.91 KB | None | 0 0
  1. function receiveSkillCD(protocol, opcode, buffer)
  2. print("recebendo")
  3.  
  4.   local info = loadstring("return " .. buffer)()
  5.   print(buffer)
  6.   onCooldown(info.itemId, info.duration)
  7. end
  8.  
  9. function onCooldown(itemId, duration)
  10. print("on cd")
  11. print(itemId)
  12.   local widgetId = "skill"..getSkillIdByItemId(itemId)
  13.   local widget = skillsBarWindow:getChildById(widgetId)
  14.   if not widget then return false end
  15.   local progressRect = widget:getChildById(itemId)
  16.   if not progressRect then
  17.     progressRect = g_ui.createWidget('SkillProgressRect', widget)
  18.     progressRect:setId(itemId)
  19.     progressRect.icon = widget
  20.     progressRect:fill('parent')
  21.   else
  22.     progressRect:setPercent(0)
  23.   end
  24.   local updateFunc = function()
  25.     updateCooldown(progressRect, duration/19)
  26.   end
  27.   local finishFunc = function()
  28.     removeCooldown(progressRect)
  29.   end
  30.   initCooldown(progressRect, updateFunc, finishFunc)
  31.   print("foi")
  32. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement