Skymagnum

Untitled

Jun 18th, 2013
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.03 KB | None | 0 0
  1. function onKill(cid, target)
  2.  
  3. local ringId = 8302
  4. local percent = 0.25 -- 25%
  5. local maxExp = 150000 -- quando ele checar a isso de exp o ring é deletado
  6.  
  7.     local exp = getExperienceStage(getPlayerLevel(cid), getVocationInfo(getPlayerVocation(cid)).experienceMultiplier)
  8.     local count = math.floor(((getMonsterInfo(string.lower(getCreatureName(target))).experience * exp) * percent))
  9.  
  10.     if(getPlayerSlotItem(cid, CONST_SLOT_AMMO).itemid == ringId) then
  11.         if(getPlayerStorageValue(cid, 738921) < maxExp) then
  12.             doPlayerAddExperience(cid, count)
  13.             doSendAnimatedText(getThingPosition(cid), "+ " .. count, math.random(50, 60))
  14.             setPlayerStorageValue(cid, 738921, getPlayerStorageValue(cid, 738921) + count)
  15.         else
  16.             doPlayerSendTextMessage(cid, 27, "Você já chegou ao máximo permitido, compre um anel novo.")
  17.             doRemoveItem(getPlayerSlotItem(cid, CONST_SLOT_AMMO).uid)
  18.             setPlayerStorageValue(cid, 738921, 0)
  19.         end
  20.     end
  21.  
  22.     return true
  23. end
Advertisement
Add Comment
Please, Sign In to add comment