Guest User

Untitled

a guest
Feb 10th, 2018
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.15 KB | None | 0 0
  1. local events = {
  2. 'ElementalSpheresOverlords',
  3. 'BigfootBurdenVersperoth',
  4. 'Razzagorn',
  5. 'Shatterer',
  6. 'Zamulosh',
  7. 'The Hunger',
  8. 'The Rage',
  9. 'Eradicator',
  10. 'Eradicator1',
  11. 'Rupture',
  12. 'World Devourer',
  13. 'Tarbaz',
  14. 'Shulgrax',
  15. 'Ragiaz',
  16. 'Plagirath',
  17. 'Mazoran',
  18. 'Destabilized',
  19. 'BigfootBurdenWiggler',
  20. 'SvargrondArenaKill',
  21. 'NewFrontierShardOfCorruption',
  22. 'NewFrontierTirecz',
  23. 'ServiceOfYalaharDiseasedTrio',
  24. 'ServiceOfYalaharAzerus',
  25. 'ServiceOfYalaharQuaraLeaders',
  26. 'InquisitionBosses',
  27. 'InquisitionUngreez',
  28. 'KillingInTheNameOfKills',
  29. 'KillingInTheNameOfKillss',
  30. 'KillingInTheNameOfKillsss',
  31. 'MastersVoiceServants',
  32. 'SecretServiceBlackKnight',
  33. 'ThievesGuildNomad',
  34. 'WotELizardMagistratus',
  35. 'WotELizardNoble',
  36. 'WotEKeeper',
  37. 'Maxxed',
  38. 'WotEBosses',
  39. 'WotEZalamon',
  40. 'WarzoneThree',
  41. 'PlayerDeath',
  42. 'AdvanceSave',
  43. 'bossesWarzone',
  44. 'AdvanceRookgaard',
  45. 'PythiusTheRotten',
  46. 'DropLoot',
  47. 'Yielothax',
  48. 'BossParticipation',
  49. 'Energized Raging Mage',
  50. 'Raging Mage',
  51. 'modalMD1',
  52. 'VibrantEgg',
  53. 'DeathCounter',
  54. 'KillCounter',
  55. 'bless1',
  56. 'lowerRoshamuul',
  57. 'SpikeTaskQuestCrystal',
  58. 'SpikeTaskQuestDrillworm',
  59. 'petlogin',
  60. 'Idle',
  61. 'petthink'
  62. }
  63.  
  64. local function onMovementRemoveProtection(cid, oldPosition, time)
  65. local player = Player(cid)
  66. if not player then
  67. return true
  68. end
  69.  
  70. local playerPosition = player:getPosition()
  71. if (playerPosition.x ~= oldPosition.x or playerPosition.y ~= oldPosition.y or playerPosition.z ~= oldPosition.z) or player:getTarget() then
  72. player:setStorageValue(Storage.combatProtectionStorage, 0)
  73. return true
  74. end
  75.  
  76. addEvent(onMovementRemoveProtection, 1000, cid, oldPosition, time - 1)
  77. end
  78.  
  79. function onLogin(player)
  80. local loginStr = 'Welcome to ' .. configManager.getString(configKeys.SERVER_NAME) .. '!'
  81. if player:getLastLoginSaved() <= 0 then
  82. loginStr = loginStr .. ' Please choose your outfit.'
  83. player:setBankBalance(0)
  84.  
  85. if player:getSex() == 1 then
  86. player:setOutfit({lookType = 128, lookHead = 78, lookBody = 106, lookLegs = 58, lookFeet = 76})
  87. else
  88. player:setOutfit({lookType = 136, lookHead = 78, lookBody = 106, lookLegs = 58, lookFeet = 76})
  89. end
  90.  
  91. player:sendTutorial(1)
  92. else
  93. if loginStr ~= "" then
  94. player:sendTextMessage(MESSAGE_STATUS_DEFAULT, loginStr)
  95. end
  96.  
  97. loginStr = string.format('Your last visit was on %s.', os.date('%a %b %d %X %Y', player:getLastLoginSaved()))
  98. end
  99.  
  100. player:sendTextMessage(MESSAGE_STATUS_DEFAULT, loginStr)
  101.  
  102. local playerId = player:getId()
  103.  
  104. player:loadSpecialStorage()
  105.  
  106. --[[-- Maintenance mode
  107. if (player:getGroup():getId() < 2) then
  108. return false
  109. else
  110.  
  111. end--]]
  112.  
  113. if (player:getGroup():getId() >= 4) then
  114. player:setGhostMode(true)
  115. end
  116.  
  117. -- Stamina
  118. nextUseStaminaTime[playerId] = 1
  119.  
  120. -- EXP Stamina
  121. nextUseXpStamina[playerId] = 1
  122.  
  123. -- Prey Stamina
  124. nextUseStaminaPrey[playerId+1] = {Time = 1}
  125. nextUseStaminaPrey[playerId+2] = {Time = 1}
  126. nextUseStaminaPrey[playerId+3] = {Time = 1}
  127.  
  128. -- Prey Data
  129. if (player:getVocation():getId() ~= 0) then
  130. local columnUnlocked = getUnlockedColumn(player)
  131. if (not columnUnlocked) then
  132. columnUnlocked = 0
  133. end
  134.  
  135. for i = 0, columnUnlocked do
  136. sendPreyData(player, i)
  137. end
  138. end
  139.  
  140. if (player:getAccountType() == ACCOUNT_TYPE_TUTOR) then
  141. local msg = [[:: Regras Tutor ::
  142. 1*>3 Advertências você perde o cargo.
  143. 2*>Sem conversas paralelas com jogadores no Help, se o player começar a ofender, você simplesmente o mute.
  144. 3*>Seja educado com os player no Help e principalmente no Privado, tenta ajudar o máximo possível.
  145. 4*>Sempre logue no seu horário, caso não tiver uma justificativa você será removido da staff.
  146. 5*>Help é somente permitido realizar dúvidas relacionadas ao tibia.
  147. 6*>Não é Permitido divulgar time pra upar ou para ajudar em quest.
  148. 7*>Não é permitido venda de itens no Help.
  149. 8*>Caso o player encontre um bug, peça para ir ao site mandar um ticket e explicar em detalhes.
  150. 9*>Mantenha sempre o Chat dos Tutores aberto. (obrigatório).
  151. 10*>Você terminou de cumprir seu horário, viu que não tem nenhum tutor Online, você comunica com algum CM in-game ou ts e fica no help até alguém logar, se der.
  152. 11*>Mantenha sempre um ótimo português no Help, queremos tutores que dêem suporte, não que fiquem falando um ritual satânico.
  153. 12*>Se ver um tutor fazendo algo que infrinja as regras, tire uma print e envie aos superiores."
  154. -- Comandos --
  155. Mutar Player: /mute nick,90. (90 segundos)
  156. Desmutar Player: /unmute nick.
  157. -- Comandos --]]
  158. player:popupFYI(msg)
  159. end
  160.  
  161. -- OPEN CHANNERLS (ABRIR CHANNELS)
  162. if table.contains({"Rookgaard", "Dawnport"}, player:getTown():getName())then
  163. --player:openChannel(7) -- help channel
  164. player:openChannel(3) -- world chat
  165. player:openChannel(6) -- advertsing rook main
  166. else
  167. --player:openChannel(7) -- help channel
  168. player:openChannel(3) -- world chat
  169. player:openChannel(5) -- advertsing main
  170. end
  171.  
  172. --
  173. -- Rewards
  174. local rewards = #player:getRewardList()
  175. if(rewards > 0) then
  176. player:sendTextMessage(MESSAGE_EVENT_ADVANCE, string.format("You have %d %s in your reward chest.", rewards, rewards > 1 and "rewards" or "reward"))
  177. end
  178.  
  179. -- Update player id
  180. local stats = player:inBossFight()
  181. if stats then
  182. stats.playerId = player:getId()
  183. end
  184.  
  185. -- fury gates
  186. local messageType = nil
  187. if (player:getClient().os == 3 or
  188. player:getClient().os == 5) then
  189. messageType = MESSAGE_EVENT_ADVANCE
  190. end
  191.  
  192. if Game.getStorageValue(9710) == 1 then
  193. player:sendTextMessage(messageType or MESSAGE_STATUS_CONSOLE_BLUE, 'Fury Gate is on Venore Today.')
  194. elseif Game.getStorageValue(9711) == 2 then
  195. player:sendTextMessage(messageType or MESSAGE_STATUS_CONSOLE_BLUE, 'Fury Gate is on Abdendriel Today.')
  196. elseif Game.getStorageValue(9712) == 3 then
  197. player:sendTextMessage(messageType or MESSAGE_STATUS_CONSOLE_BLUE, 'Fury Gate is on Thais Today.')
  198. elseif Game.getStorageValue(9713) == 4 then
  199. player:sendTextMessage(messageType or MESSAGE_STATUS_CONSOLE_BLUE, 'Fury Gate is on Carlin Today.')
  200. elseif Game.getStorageValue(9714) == 5 then
  201. player:sendTextMessage(messageType or MESSAGE_STATUS_CONSOLE_BLUE, 'Fury Gate is on Edron Today.')
  202. elseif Game.getStorageValue(9716) == 6 then
  203. player:sendTextMessage(messageType or MESSAGE_STATUS_CONSOLE_BLUE, 'Fury Gate is on Kazordoon Today.')
  204. end
  205.  
  206.  
  207.  
  208. -- Events
  209. for i = 1, #events do
  210. player:registerEvent(events[i])
  211. end
  212.  
  213.  
  214. if player:getStorageValue(Storage.combatProtectionStorage) <= os.time() then
  215. player:setStorageValue(Storage.combatProtectionStorage, os.time() + 10)
  216. onMovementRemoveProtection(playerId, player:getPosition(), 10)
  217. end
  218.  
  219. -- Exp stats
  220. local staminaMinutes = player:getStamina()
  221. local Boost = player:getExpBoostStamina()
  222. if staminaMinutes > 2400 and player:isPremium() and Boost > 0 then
  223. player:setBaseXpGain(200) -- 200 = 1.0x, 200 = 2.0x, ... premium account
  224. elseif staminaMinutes > 2400 and player:isPremium() and Boost <= 0 then
  225. player:setBaseXpGain(150) -- 150 = 1.0x, 150 = 1.5x, ... premium account
  226. elseif staminaMinutes <= 2400 and staminaMinutes > 840 and player:isPremium() and Boost > 0 then
  227. player:setBaseXpGain(150) -- 150 = 1.5x premium account
  228. elseif staminaMinutes > 840 and Boost > 0 then
  229. player:setBaseXpGain(150) -- 150 = 1.5x free account
  230. elseif staminaMinutes <= 840 and Boost > 0 then
  231. player:setBaseXpGain(100) -- 50 = 0.5x all players
  232. elseif staminaMinutes <= 840 then
  233. player:setBaseXpGain(50) -- 50 = 0.5x all players
  234. end
  235.  
  236. return true
  237. end
Add Comment
Please, Sign In to add comment