Guest User

Untitled

a guest
Nov 23rd, 2014
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.30 KB | None | 0 0
  1. local t = {
  2. -- [storage], level, points
  3. [15512] = {50000, 2},
  4. [15513] = {100000, 2},
  5. [15514] = {150000, 2},
  6. [15515] = {200000, 2},
  7. [15516] = {250000, 2},
  8. [15517] = {300000, 2},
  9. [15518] = {350000, 2},
  10. [15519] = {400000, 2},
  11. [15520] = {450000, 2},
  12. [15521] = {500000, 1},
  13. [15522] = {550000, 1},
  14. [15523] = {550000, 1},
  15. [15524] = {600000, 1},
  16. [15525] = {650000, 1},
  17. [15526] = {700000, 1},
  18. [15527] = {750000, 1},
  19. [15528] = {800000, 1},
  20. [15529] = {850000, 1},
  21. [15530] = {900000, 1},
  22. [15531] = {950000, 1},
  23. [15532] = {1000000, 1},
  24. [15533] = {1050000, 1},
  25. [15534] = {1100000, 1},
  26. [15535] = {1150000, 1},
  27. [15536] = {1200000, 1},
  28. [15537] = {1250000, 1},
  29. [15538] = {1300000, 1},
  30. [15539] = {1350000, 1},
  31. [15540] = {1400000, 1}
  32. }
  33.  
  34. local points = 4595 -- storage for all talent points
  35.  
  36. function onAdvance(cid, skill, oldLevel, newLevel)
  37. if skill == SKILL__LEVEL then
  38. for storage, v in pairs(t) do
  39. if newLevel >= v[1] and getPlayerStorageValue(cid, storage) < 1 then
  40. setPlayerStorageValue(cid, storage, 1)
  41. setPlayerStorageValue(cid, points, v[2] + getPlayerStorageValue(cid, points))
  42. doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "CONGRATULATIONS! You've reached level " .. v[1] .. " and GAINED " .. v[2] .. " talent points you can spend at talent npc.")
  43. break
  44. end
  45. end
  46. end
  47. return true
  48. end
Advertisement
Add Comment
Please, Sign In to add comment