Advertisement
Guest User

Untitled

a guest
Mar 2nd, 2017
228
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.34 KB | None | 0 0
  1. local config = {
  2. loginMessage = getConfigValue('loginMessage'),
  3. useFragHandler = getBooleanFromString(getConfigValue('useFragHandler'))
  4. }
  5.  
  6. function onLogin(cid)
  7.  
  8. local accountManager = getPlayerAccountManager(cid)
  9. if getPlayerLevel(cid) >= 1 and getPlayerLevel(cid) <= 80 then
  10. doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, 90)
  11. doCreatureSetDropLoot(cid, false)
  12. end
  13. if getPlayerLevel(cid) >= 81 and getPlayerLevel(cid) <= 149 then
  14. doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, 80)
  15. doCreatureSetDropLoot(cid, false)
  16. end
  17. if getPlayerLevel(cid) >= 150 then
  18. doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, 75)
  19. doCreatureSetDropLoot(cid, false)
  20. end
  21.  
  22. if getPlayerStorageValue(cid, 32001) == 1 then
  23.  
  24. local speed = 700 --- A mesma velocidade do script.
  25. setPlayerStorageValue(cid, 32001, 0)
  26. doRemoveCondition(cid, CONDITION_OUTFIT)
  27. doChangeSpeed(cid, getCreatureSpeed(cid)-speed)
  28. end
  29.  
  30. if(accountManager == MANAGER_NONE) then
  31. local lastLogin, str = getPlayerLastLoginSaved(cid), config.loginMessage
  32. if(lastLogin > 0) then
  33. doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
  34. str = "Your last visit was on " .. os.date("%a %b %d %X %Y", lastLogin) .. "."
  35. else
  36. str = str
  37. end
  38.  
  39. doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
  40.  
  41. elseif(accountManager == MANAGER_NAMELOCK) then
  42. doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, it appears that your character has been namelocked, what would you like as your new name?")
  43. elseif(accountManager == MANAGER_ACCOUNT) then
  44. doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to manage your account and if you want to start over then type 'cancel'.")
  45. else
  46. doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to create an account or type 'recover' to recover an account.")
  47. end
  48.  
  49. if getCreatureName(cid) == "Account Manager" then
  50. local outfit = {}
  51. if accountManagerRandomPokemonOutfit then
  52. outfit = {lookType = getPokemonXMLOutfit(oldpokedex[math.random(151)][1])}
  53. else
  54. outfit = accountManagerOutfit
  55. end
  56.  
  57. doSetCreatureOutfit(cid, outfit, -1)
  58. return true
  59. end
  60.  
  61. if(not isPlayerGhost(cid)) then
  62. doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
  63. end
  64.  
  65. local outfit = {}
  66.  
  67. if getPlayerVocation(cid) == 0 then
  68. doPlayerSetMaxCapacity(cid, 0)
  69. doPlayerSetVocation(cid, 1)
  70. setCreatureMaxMana(cid, 6)
  71. doPlayerAddSoul(cid, -getPlayerSoul(cid))
  72. setPlayerStorageValue(cid, 19898, 0)
  73. if getCreatureOutfit(cid).lookType == 128 then
  74. outfit = {lookType = 510, lookHead = math.random(0, 132), lookBody = math.random(0, 132), lookLegs = math.random(0, 132), lookFeet = math.random(0, 132)}
  75. elseif getCreatureOutfit(cid).lookType == 136 then
  76. outfit = {lookType = 511, lookHead = math.random(0, 132), lookBody = math.random(0, 132), lookLegs = math.random(0, 132), lookFeet = math.random(0, 132)}
  77. end
  78. doCreatureChangeOutfit(cid, outfit)
  79. end
  80.  
  81. registerCreatureEvent(cid, "dropStone")
  82. registerCreatureEvent(cid, "ShowPokedex") --alterado v1.6
  83. registerCreatureEvent(cid, "ClosePokedex") --alterado v1.6
  84. registerCreatureEvent(cid, "WatchTv")
  85. registerCreatureEvent(cid, "StopWatchingTv")
  86. registerCreatureEvent(cid, "WalkTv")
  87. registerCreatureEvent(cid, "RecordTv")
  88. registerCreatureEvent(cid, "PlayerLogout")
  89. registerCreatureEvent(cid, "WildAttack")
  90. registerCreatureEvent(cid, "Idle")
  91. registerCreatureEvent(cid, "PokemonIdle")
  92. registerCreatureEvent(cid, "EffectOnAdvance")
  93. registerCreatureEvent(cid, "GeneralConfiguration")
  94. registerCreatureEvent(cid, "ReportBug")
  95. registerCreatureEvent(cid, "LookSystem")
  96. registerCreatureEvent(cid, "T1")
  97. registerCreatureEvent(cid, "T2")
  98. registerCreatureEvent(cid, "task_count")
  99. registerCreatureEvent(cid, "pokemons")
  100. registerCreatureEvent(cid, "Ilha")
  101. registerCreatureEvent(cid, "aloot_kill")
  102. registerCreatureEvent(cid, "UpAbsolute")
  103.  
  104. addEvent(doSendAnimatedText, 500, getThingPosWithDebug(cid), "Bem Vindo!!", COLOR_BURN)
  105.  
  106. if getPlayerStorageValue(cid, 99284) == 1 then
  107. setPlayerStorageValue(cid, 99284, -1)
  108. end
  109.  
  110. if getPlayerStorageValue(cid, 6598754) >= 1 or getPlayerStorageValue(cid, 6598755) >= 1 then
  111. setPlayerStorageValue(cid, 6598754, -1)
  112. setPlayerStorageValue(cid, 6598755, -1)
  113. doRemoveCondition(cid, CONDITION_OUTFIT) --alterado v1.9 \/
  114. doTeleportThing(cid, posBackPVP, false)
  115. doCreatureAddHealth(cid, getCreatureMaxHealth(cid))
  116. end
  117.  
  118. doChangeSpeed(cid, -(getCreatureSpeed(cid)))
  119.  
  120. --///////////////////////////////////////////////////////////////////////////--
  121. local storages = {17000, 63215, 17001, 13008, 5700}
  122. for s = 1, #storages do
  123. if not tonumber(getPlayerStorageValue(cid, storages[s])) then
  124. if s == 3 then
  125. setPlayerStorageValue(cid, storages[s], 1)
  126. elseif s == 4 then
  127. setPlayerStorageValue(cid, storages[s], -1)
  128. else
  129. if isBeingUsed(getPlayerSlotItem(cid, 8).itemid) then
  130. setPlayerStorageValue(cid, storages[s], 1)
  131. else
  132. setPlayerStorageValue(cid, storages[s], -1)
  133. end
  134. end
  135. doPlayerSendTextMessage(cid, 27, "Sorry, but a problem occurred on the server, but now it's alright")
  136. end
  137. end
  138. --/////////////////////////////////////////////////////////////////////////--
  139. if getPlayerStorageValue(cid, 17000) >= 1 then -- fly
  140.  
  141. local item = getPlayerSlotItem(cid, 8)
  142. local poke = getItemAttribute(item.uid, "poke")
  143. doChangeSpeed(cid, getPlayerStorageValue(cid, 54844))
  144. doRemoveCondition(cid, CONDITION_OUTFIT)
  145. doSetCreatureOutfit(cid, {lookType = flys[poke][1] + 351}, -1)
  146.  
  147. local apos = getFlyingMarkedPos(cid)
  148. apos.stackpos = 0
  149.  
  150. if getTileThingByPos(apos).itemid <= 2 then
  151. doCombatAreaHealth(cid, FIREDAMAGE, getFlyingMarkedPos(cid), 0, 0, 0, CONST_ME_NONE)
  152. doCreateItem(460, 1, getFlyingMarkedPos(cid))
  153. end
  154.  
  155. doTeleportThing(cid, apos, false)
  156. if getItemAttribute(item.uid, "boost") and getItemAttribute(item.uid, "boost") >= 50 and getPlayerStorageValue(cid, 42368) >= 1 then
  157. sendAuraEffect(cid, auraSyst[getItemAttribute(item.uid, "aura")]) --alterado v1.8
  158. end
  159.  
  160. local posicao = getTownTemplePosition(getPlayerTown(cid))
  161. markFlyingPos(cid, posicao)
  162.  
  163. elseif getPlayerStorageValue(cid, 63215) >= 1 then -- surf
  164.  
  165. local item = getPlayerSlotItem(cid, 8)
  166. local poke = getItemAttribute(item.uid, "poke")
  167. doSetCreatureOutfit(cid, {lookType = surfs[poke].lookType + 351}, -1) --alterado v1.6
  168. doChangeSpeed(cid, getPlayerStorageValue(cid, 54844))
  169. if getItemAttribute(item.uid, "boost") and getItemAttribute(item.uid, "boost") >= 50 and getPlayerStorageValue(cid, 42368) >= 1 then
  170. sendAuraEffect(cid, auraSyst[getItemAttribute(item.uid, "aura")]) --alterado v1.8
  171. end
  172.  
  173. elseif getPlayerStorageValue(cid, 17001) >= 1 then -- ride
  174.  
  175. local item = getPlayerSlotItem(cid, 8)
  176. local poke = getItemAttribute(item.uid, "poke")
  177.  
  178.  
  179. if rides[poke] then
  180. doChangeSpeed(cid, getPlayerStorageValue(cid, 54844))
  181. doRemoveCondition(cid, CONDITION_OUTFIT)
  182. doSetCreatureOutfit(cid, {lookType = rides[poke][1] + 351}, -1)
  183. if getItemAttribute(item.uid, "boost") and getItemAttribute(item.uid, "boost") >= 50 and getPlayerStorageValue(cid, 42368) >= 1 then
  184. sendAuraEffect(cid, auraSyst[getItemAttribute(item.uid, "aura")]) --alterado v1.8
  185. end
  186. else
  187. setPlayerStorageValue(cid, 17001, -1)
  188. doRegainSpeed(cid)
  189. end
  190.  
  191. local posicao2 = getTownTemplePosition(getPlayerTown(cid))
  192. markFlyingPos(cid, posicao2)
  193.  
  194. elseif getPlayerStorageValue(cid, 13008) >= 1 then -- dive
  195. if not isInArray({5405, 5406, 5407, 5408, 5409, 5410}, getTileInfo(getThingPos(cid)).itemid) then
  196. setPlayerStorageValue(cid, 13008, 0)
  197. doRegainSpeed(cid)
  198. doRemoveCondition(cid, CONDITION_OUTFIT)
  199. return true
  200. end
  201.  
  202. if getPlayerSex(cid) == 1 then
  203. doSetCreatureOutfit(cid, {lookType = 1034, lookHead = getCreatureOutfit(cid).lookHead, lookBody = getCreatureOutfit(cid).lookBody, lookLegs = getCreatureOutfit(cid).lookLegs, lookFeet = getCreatureOutfit(cid).lookFeet}, -1)
  204. else
  205. doSetCreatureOutfit(cid, {lookType = 1035, lookHead = getCreatureOutfit(cid).lookHead, lookBody = getCreatureOutfit(cid).lookBody, lookLegs = getCreatureOutfit(cid).lookLegs, lookFeet = getCreatureOutfit(cid).lookFeet}, -1)
  206. end
  207. doChangeSpeed(cid, 800)
  208.  
  209. elseif getPlayerStorageValue(cid, 5700) > 0 then --bike
  210. doChangeSpeed(cid, -getCreatureSpeed(cid))
  211. doChangeSpeed(cid, getPlayerStorageValue(cid, 5700)) --alterado v1.8
  212. if getPlayerSex(cid) == 1 then
  213. doSetCreatureOutfit(cid, {lookType = 1394}, -1)
  214. else
  215. doSetCreatureOutfit(cid, {lookType = 1393}, -1)
  216. end
  217.  
  218. elseif getPlayerStorageValue(cid, 75846) >= 1 then --alterado v1.9 \/
  219. doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), false)
  220. setPlayerStorageValue(cid, 75846, -1)
  221. sendMsgToPlayer(cid, 20, "You have been moved to your town!")
  222. else
  223. doRegainSpeed(cid)
  224. end
  225.  
  226. if getPlayerStorageValue(cid, 22545) >= 1 then
  227. setPlayerStorageValue(cid, 22545, -1)
  228. doTeleportThing(cid, getClosestFreeTile(cid, posBackGolden), false)
  229. setPlayerRecordWaves(cid)
  230. end
  231.  
  232. if useKpdoDlls then
  233. doUpdateMoves(cid)
  234. doUpdatePokemonsBar(cid)
  235. onPokeHealthChange(cid)
  236. end
  237.  
  238. return true
  239. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement