Advertisement
Guest User

Untitled

a guest
Jul 1st, 2016
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.91 KB | None | 0 0
  1. function playerAddExp(cid, exp)
  2. if not isCreature(cid) then return true end
  3. if isInPartyAndSharedExperience(cid) then
  4. local partyPlayers = getPartyMembers(getPlayerParty(cid))
  5. local partyExp = math.ceil(exp / #partyPlayers)
  6. for i = 1, #partyPlayers do
  7. if isPlayer(partyPlayers[i]) then
  8. if getPlayerLevel(cid) <= 50 then
  9. doPlayerAddExp(partyPlayers[i], partyExp * 150)
  10. doSendAnimatedText(getThingPos(partyPlayers[i]), partyExp * 150, 215)
  11. elseif getPlayerLevel(partyPlayers[i]) >= 51 and getPlayerLevel(partyPlayers[i]) <= 100 then
  12. doPlayerAddExp(partyPlayers[i], partyExp * 120)
  13. doSendAnimatedText(getThingPos(partyPlayers[i]), partyExp * 100, 215)
  14. elseif getPlayerLevel(partyPlayers[i]) >= 101 and getPlayerLevel(partyPlayers[i]) <= 150 then
  15. doPlayerAddExp(partyPlayers[i], partyExp * 100)
  16. doSendAnimatedText(getThingPos(partyPlayers[i]), partyExp * 100, 215)
  17. elseif getPlayerLevel(partyPlayers[i]) >= 151 and getPlayerLevel(partyPlayers[i]) <= 200 then
  18. doPlayerAddExp(partyPlayers[i], partyExp * 80)
  19. doSendAnimatedText(getThingPos(partyPlayers[i]), partyExp * 80, 215)
  20. elseif getPlayerLevel(partyPlayers[i]) >= 201 and getPlayerLevel(partyPlayers[i]) <= 250 then
  21. doPlayerAddExp(partyPlayers[i], partyExp * 50)
  22. doSendAnimatedText(getThingPos(partyPlayers[i]), partyExp * 50, 215)
  23. elseif getPlayerLevel(partyPlayers[i]) >= 251 and getPlayerLevel(partyPlayers[i]) <= 300 then
  24. doPlayerAddExp(partyPlayers[i], partyExp * 30)
  25. doSendAnimatedText(getThingPos(partyPlayers[i]), partyExp * 30, 215)
  26. elseif getPlayerLevel(partyPlayers[i]) >= 351 then
  27. doPlayerAddExp(partyPlayers[i], partyExp * 10)
  28. doSendAnimatedText(getThingPos(partyPlayers[i]), partyExp * 10, 215)
  29. return true end
  30. doPlayerAddExp(partyPlayers[i], partyExp * 30)
  31. doSendAnimatedText(getThingPos(partyPlayers[i]), partyExp * 30, 215)
  32. end
  33. end
  34. return true
  35. end
  36.  
  37. if getPlayerLevel(cid) <= 50 then
  38. doPlayerAddExp(cid, exp * 150)
  39. doSendAnimatedText(getThingPos(cid), exp * 150, 215)
  40. elseif getPlayerLevel(cid) >= 51 and getPlayerLevel(cid) <= 100 then
  41. doPlayerAddExp(cid, exp * 120)
  42. doSendAnimatedText(getThingPos(cid), exp * 100, 215)
  43. elseif getPlayerLevel(cid) >= 101 and getPlayerLevel(cid) <= 150 then
  44. doPlayerAddExp(cid, exp * 100)
  45. doSendAnimatedText(getThingPos(cid), exp * 100, 215)
  46. elseif getPlayerLevel(cid) >= 151 and getPlayerLevel(cid) <= 200 then
  47. doPlayerAddExp(cid, exp * 80)
  48. doSendAnimatedText(getThingPos(cid), exp * 80, 215)
  49. elseif getPlayerLevel(cid) >= 201 and getPlayerLevel(cid) <= 250 then
  50. doPlayerAddExp(cid, exp * 50)
  51. doSendAnimatedText(getThingPos(cid), exp * 50, 215)
  52. elseif getPlayerLevel(cid) >= 251 and getPlayerLevel(cid) <= 300 then
  53. doPlayerAddExp(cid, exp * 30)
  54. doSendAnimatedText(getThingPos(cid), exp * 30, 215)
  55. elseif getPlayerLevel(cid) >= 351 then
  56. doPlayerAddExp(cid, exp * 10)
  57. doSendAnimatedText(getThingPos(cid), exp * 10, 215)
  58. return true end
  59.  
  60. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement