Advertisement
Guest User

Untitled

a guest
Feb 18th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.38 KB | None | 0 0
  1. local events = {
  2. 'PlayerDeath',
  3. 'LevelSave',
  4. 'SvargrondArenaKill',
  5. 'DropLoot'
  6. }
  7.  
  8. local townIds = {1, 2, 3, 4, 5, 7, 8, 9, 10, 11, 12}
  9.  
  10. function onLogin(player)
  11. local loginStr = 'Welcome to ' .. configManager.getString(configKeys.SERVER_NAME) .. '!'
  12. if player:getLastLoginSaved() <= 0 then
  13. loginStr = loginStr .. ' Please choose your outfit.'
  14. player:sendOutfitWindow()
  15. for i = 1, #townIds do
  16.  
  17. end
  18. else
  19. if loginStr ~= '' then
  20. player:sendTextMessage(MESSAGE_STATUS_DEFAULT, loginStr)
  21. end
  22.  
  23. loginStr = string.format('Your last visit was on %s.', os.date('%a %b %d %X %Y', player:getLastLoginSaved()))
  24. end
  25. player:sendTextMessage(MESSAGE_STATUS_DEFAULT, loginStr)
  26.  
  27. -- Stamina
  28. nextUseStaminaTime[player.uid] = 0
  29.  
  30. -- Promotion
  31. local vocation = player:getVocation()
  32. local promotion = vocation:getPromotion()
  33. if player:isPremium() then
  34. local value = player:getStorageValue(STORAGEVALUE_PROMOTION)
  35. if not promotion and value ~= 1 then
  36. player:setStorageValue(STORAGEVALUE_PROMOTION, 1)
  37. elseif value == 1 then
  38. player:setVocation(promotion)
  39. end
  40. elseif not promotion then
  41. player:setVocation(vocation:getDemotion())
  42. end
  43.  
  44. if player:getStorageValue(2038) == 1 then -- Task System register if still has task
  45. player:registerEvent("TaskKill")
  46. end
  47.  
  48. for i = 1, #events do
  49. player:registerEvent(events[i])
  50. end
  51. return true
  52. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement