Alscara

Untitled

Nov 16th, 2015
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.17 KB | None | 0 0
  1. local events = {
  2. "fasttravel_modal",
  3. "PlayerDeath",
  4. "blessingnoob",
  5. "DropLoot",
  6. "Tasks",
  7. "FishingTasks",
  8. "ExpertTasks",
  9. "RiftTasks",
  10. "MasterTasks",
  11. "Horse",
  12. "firstloginmessage",
  13. "pvparena",
  14. "vipexp",
  15. "skillpotion",
  16. "BossKill",
  17. "Fishingtasks",
  18. "SpellUp",
  19. "Resist",
  20. "tokensforall",
  21. "medalbonusdemonlord",
  22. "medalbonushaunter",
  23. "medalbonusoldwidow",
  24. }
  25.  
  26. function onLogin(player)
  27. local loginStr = "Welcome to ArchLight, If you have any questions feel free to ask a tutor in the help channel!" .. configManager.getString(configKeys.SERVER_NAME) .. "!"
  28. activatFireWalk(player)
  29. if player:getLastLoginSaved() <= 0 then
  30. player:sendFLoginWindow()
  31. loginStr = loginStr .. " Please choose your outfit :)."
  32. player:sendOutfitWindow()
  33. else
  34. if loginStr ~= "" then
  35. player:sendTextMessage(MESSAGE_STATUS_DEFAULT, loginStr)
  36. end
  37.  
  38. player:sendALoginWindow()
  39. loginStr = string.format("Your last visit was on %s.", os.date("%a %b %d %X %Y", player:getLastLoginSaved()))
  40. end
  41.  
  42. player:sendTextMessage(MESSAGE_STATUS_DEFAULT, loginStr)
  43.  
  44. -- Stamina
  45. nextUseStaminaTime[player.uid] = 0
  46.  
  47. -- Promotion
  48. local vocation = player:getVocation()
  49. local promotion = vocation:getPromotion()
  50. local demotion = vocation:getDemotion()
  51. local value = player:getStorageValue(STORAGEVALUE_PROMOTION)
  52. if player:getStorageValue(STORAGEVALUE_PROMOTION) == 1 then
  53. if demotion == vocation then
  54. player:setVocation(promotion)
  55. end
  56. elseif player:getStorageValue(STORAGEVALUE_PROMOTION) == 2 then
  57. if demotion == vocation then
  58. player:setVocation(promotion:getPromotion())
  59. end
  60. end
  61. if not promotion and value ~= 3 then
  62. player:setStorageValue(STORAGEVALUE_PROMOTION, 2)
  63. player:setVocation(vocation:getDemotion())
  64. end
  65.  
  66. if player:getStorageValue(15) == 1 then
  67. player:sendTextMessage(MESSAGE_INFO_DESCR, "You Have Free Blessings Until Level 80!")
  68. player:setStorageValue(15, 0)
  69. end
  70.  
  71. if player:getLevel() < 80 then
  72. for i = 1, 5 do
  73. if not player:hasBlessing(i) then
  74. player:addBlessing(i)
  75. end
  76. end
  77. end
  78.  
  79. -- Events
  80. for _, eventName in ipairs(events) do
  81. player:registerEvent(eventName)
  82. end
  83.  
  84. return true
  85. end
Advertisement
Add Comment
Please, Sign In to add comment