Advertisement
Guest User

Untitled

a guest
Jul 24th, 2016
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.45 KB | None | 0 0
  1. function onEquip(cid, item, slot)
  2. local slots = getPlayerSlotItem(cid, slot)
  3. if slots.itemid ~= item.itemid then
  4.     return true
  5. end
  6. if getItemAttribute(item.uid, 'description') == nil then return true end
  7.     local desc = getItemAttribute(item.uid, 'description')
  8. if string.find(desc:lower(), 'attack damage:') ~= nil then
  9.     local x = string.sub(desc, 17)
  10.     local y = string.sub(desc, 8)
  11.     local z = string.sub(desc, 9)
  12.     setPlayerStorageValue(cid, 9002, getCreatureStorage(cid, 9002) + x)
  13. elseif string.find(desc:lower(), 'dodge:') ~= nil then
  14.     setPlayerStorageValue(cid, 48902, getCreatureStorage(cid, 48902) + y)
  15. elseif string.find(desc:lower(), 'resist:') ~= nil then
  16.     setPlayerStorageValue(cid, 9003, getCreatureStorage(cid, 9003) + z)
  17. end
  18. end
  19.     return true
  20. end
  21.  
  22.  
  23. function onDeEquip(cid, item, slot)
  24. if getItemAttribute(item.uid, 'description') == nil then return true end
  25.  
  26.     local desc = getItemAttribute(item.uid, 'description')
  27. if string.find(desc:lower(), 'attack damage:') ~= nil then
  28.     local x = string.sub(desc, 17)
  29.     local y = string.sub(desc, 8)
  30.     local z = string.sub(desc, 9)
  31.     setPlayerStorageValue(cid, 9002, getCreatureStorage(cid, 9002) - x)
  32. elseif string.find(desc:lower(), 'dodge:') ~= nil then
  33.     setPlayerStorageValue(cid, 48902, getCreatureStorage(cid, 48902) - y)
  34. elseif string.find(desc:lower(), 'resist:') ~= nil then
  35.     setPlayerStorageValue(cid, 9003, getCreatureStorage(cid, 9003) - z)
  36. end
  37.     print("DEQUIPED")
  38.     return true
  39. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement