MaXwEllDeN

Untitled

Jul 28th, 2013
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.80 KB | None | 0 0
  1. local amuletos = {
  2.    [8] = 2170,
  3.    [9] = 2171,
  4.    [10] = 2172,
  5.    [11] = 2173,
  6.    [12] = 2174,
  7.    [13] = 2175,
  8. }
  9.  
  10. function onLogin(cid)
  11.    if getPlayerLastLoginSaved(cid) < 1 then
  12.       doPlayerAddItem(cid, amuletos[getPlayerLevel(cid)])
  13.    end
  14.  
  15.    local amuleto = amuletos[getPlayerLevel(cid)]
  16.    if amuleto and getPlayerItemCount(cid, amuleto) > 0 then
  17.       registerCreatureEvent(cid, "AmuletoChange")
  18.    end
  19.  
  20.    return true
  21. end
  22.  
  23. function onAdvance(cid, skill, oldlevel, newlevel)
  24.    if skill == 8 then
  25.       local amuleto = amuletos[oldlevel]
  26.       if getPlayerItemCount(cid, amuleto) > 0 and amuletos[newlevel] then
  27.          doPlayerRemoveItem(cid, amuleto)
  28.          doPlayerAddItem(cid, amuletos[newlevel], 1, false, CONST_SLOT_NECKLACE)
  29.       end
  30.    end
  31.  
  32.    return true
  33. end
Advertisement
Add Comment
Please, Sign In to add comment