Guest User

Login.lua

a guest
Apr 10th, 2012
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 10.19 KB | None | 0 0
  1. local config = {
  2. loginMessage = getConfigValue('loginMessage'),
  3. useFragHandler = getBooleanFromString(getConfigValue('useFragHandler'))
  4. }
  5.  
  6. local flys = {
  7. ["Moltres"] = {229, 2300}, -- moltres
  8. ["Articuno"] = {230, 2100}, -- artic
  9. ["Zapdos"] = {224, 2600}, -- zapdos
  10. ["Mew"] = {232, 2200}, -- 1000
  11. ["Mewtwo"] = {233, 2200},-- two
  12. ["Dragonite"] = {221, 1300},-- nite
  13. ["Pidgeot"] = {222, 900}, -- geot
  14. ["Fearow"] = {226, 800}, -- fearow
  15. ["Aerodactyl"] = {227, 1100}, -- aero
  16. ["Charizard"] = {216, 1000}, -- chari
  17. ["Porygon"] = {316, 600}, -- porygon
  18. ["Shiny Moltres"] = {229, 2300}, -- Shiny moltres
  19. ["Shiny Articuno"] = {1018, 2100}, -- Shiny artic
  20. ["Shiny Zapdos"] = {1019, 2600}, -- Shiny zapdos
  21. ["Shiny Mew"] = {1022, 2200}, -- Shiny 1000
  22. ["Shiny Mewtwo"] = {1021, 2200},-- Shiny two
  23. ["Shiny Dragonite"] = {1020, 1300},-- Shiny nite
  24. ["Shiny Pidgeot"] = {996, 900}, -- Shiny geot
  25. ["Shiny Fearow"] = {997, 800}, -- Shiny fearow
  26. ["Shiny Aerodactyl"] = {1017, 1100}, -- Shiny aero
  27. ["Shiny Charizard"] = {995, 1000}, -- Shiny chari
  28. ["Shiny Porygon"] = {1016, 600}, -- Shiny porygon
  29. ["Porygon2"] = {648, 890}, -- 2
  30. ["Skarmory"] = {649, 1000}, -- skarmory
  31. ["Crobat"] = {652, 1190}, -- crobat
  32. }
  33.  
  34.  
  35. local rides = {
  36. ["Tauros"] = {128, 580}, -- tauros
  37. ["Ninetales"] = {129, 800}, -- kyuubi
  38. ["Rapidash"] = {130, 800}, -- rapid
  39. ["Ponyta"] = {131, 410}, -- ponyta
  40. ["Rhyhorn"] = {132, 400}, -- rhyhorn
  41. ["Arcanine"] = {12, 900}, -- arcan
  42. ["Onix"] = {126, 450}, -- onix
  43. ["Venusaur"] = {134, 390}, -- venu
  44. ["Dodrio"] = {133, 750}, -- dodrio
  45. ["Doduo"] = {135, 420}, -- doduo
  46. ["Shiny Tauros"] = {1024, 580}, -- tauros
  47. ["Shiny Ninetales"] = {999, 800}, -- kyuubi
  48. ["Shiny Rapidash"] = {1005, 800}, -- rapid
  49. ["Shiny Ponyta"] = {1004, 410}, -- ponyta
  50. ["Shiny Rhyhorn"] = {1023, 400}, -- rhyhorn
  51. ["Shiny Arcanine"] = {1003, 900}, -- arcan
  52. ["Shiny Onix"] = {126, 450}, -- onix
  53. ["Shiny Venusaur"] = {1040, 390}, -- venu
  54. ["Shiny Dodrio"] = {1007, 750}, -- dodrio
  55. ["Shiny Doduo"] = {1006, 420}, -- doduo
  56. ["Crystal Onix"] = {293, 480}, -- cristal onix
  57. ["Steelix"] = {646, 750}, -- steelix
  58. ["Meganium"] = {685, 720}, -- meganium
  59. ["Bayleef"] = {686, 555}, -- bayleef
  60. ["Stantler"] = {687, 595}, -- stantler
  61. ["Houndoom"] = {647, 820}, -- houndoom
  62. ["Piloswine"] = {689, 450}, -- piloswine
  63. ["Mareep"] = {688, 400}, -- marip
  64. }
  65.  
  66. local surf = {
  67. ["Poliwag"] = {lookType=278, speed = 320},
  68. ["Poliwhirl"] = {lookType=137, speed = 480},
  69. ["Seaking"] = {lookType=269, speed = 520},
  70. ["Dewgong"] = {lookType=183, speed = 700},
  71. ["Blastoise"] = {lookType=184, speed = 850},
  72. ["Tentacruel"] = {lookType=185, speed = 750},
  73. ["Lapras"] = {lookType=186, speed = 960},
  74. ["Gyarados"] = {lookType=187, speed = 1050},
  75. ["Omastar"] = {lookType=188, speed = 680},
  76. ["Kabutops"] = {lookType=189, speed = 840},
  77. ["Poliwrath"] = {lookType=190, speed = 680},
  78. ["Vaporeon"] = {lookType=191, speed = 800},
  79. ["Staryu"] = {lookType=266, speed = 385},
  80. ["Starmie"] = {lookType=267, speed = 685},
  81. ["Goldeen"] = {lookType=268, speed = 355},
  82. ["Seadra"] = {lookType=270, speed = 655},
  83. ["Golduck"] = {lookType=271, speed = 760},
  84. ["Squirtle"] = {lookType=273, speed = 365},
  85. ["Wartortle"] = {lookType=275, speed = 605},
  86. ["Tentacool"] = {lookType=277, speed = 340},
  87. ["Snorlax"] = {lookType=300, speed = 500},
  88.  
  89. ["Shiny Poliwag"] = {lookType=1010, speed = 320},
  90. ["Shiny Poliwhirl"] = {lookType=1011, speed = 480},
  91. ["Shiny Seaking"] = {lookType=1027, speed = 520},
  92. ["Shiny Dewgong"] = {lookType=1015, speed = 700},
  93. ["Shiny Blastoise"] = {lookType=1002, speed = 850},
  94. ["Shiny Tentacruel"] = {lookType=1014, speed = 750},
  95. ["Shiny Lapras"] = {lookType=1031, speed = 960},
  96. ["Shiny Gyarados"] = {lookType=1030, speed = 1050},
  97. ["Shiny Omastar"] = {lookType=1033, speed = 680},
  98. ["Shiny Kabutops"] = {lookType=1034, speed = 840},
  99. ["Shiny Poliwrath"] = {lookType=1012, speed = 680},
  100. ["Shiny Vaporeon"] = {lookType=1032, speed = 800},
  101. ["Shiny Staryu"] = {lookType=1028, speed = 385},
  102. ["Shiny Starmie"] = {lookType=1029, speed = 685},
  103. ["Shiny Goldeen"] = {lookType=1026, speed = 355},
  104. ["Shiny Seadra"] = {lookType=1025, speed = 655},
  105. ["Shiny Golduck"] = {lookType=1009, speed = 760},
  106. ["Shiny Squirtle"] = {lookType=1000, speed = 365},
  107. ["Shiny Wartortle"] = {lookType=1001, speed = 605},
  108. ["Shiny Tentacool"] = {lookType=1013, speed = 340},
  109. ["Shiny Snorlax"] = {lookType=1035, speed = 500},
  110.  
  111. ["Mantine"] = {lookType=636, speed = 820},
  112. ["Totodile"] = {lookType=637, speed = 360},
  113. ["Croconow"] = {lookType=638, speed = 590},
  114. ["Feraligatr"] = {lookType=645, speed = 900},
  115. ["Marill"] = {lookType=639, speed = 340},
  116. ["Azumarill"] = {lookType=642, speed = 680},
  117. ["Quagsire"] = {lookType=643, speed = 740},
  118. ["Kingdra"] = {lookType=644, speed = 1020},
  119. ["Octillery"] = {lookType=641, speed = 600},
  120. ["Wooper"] = {lookType=640, speed = 315},
  121. }
  122.  
  123. function onLogin(cid)
  124.  
  125. doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, 100)
  126. doCreatureSetDropLoot(cid, false)
  127.  
  128. local accountManager = getPlayerAccountManager(cid)
  129.  
  130. if(accountManager == MANAGER_NONE) then
  131. local lastLogin, str = getPlayerLastLoginSaved(cid), config.loginMessage
  132. if(lastLogin > 0) then
  133. doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
  134. str = "Your last visit was on " .. os.date("%a %b %d %X %Y", lastLogin) .. "."
  135. else
  136. str = str
  137. end
  138.  
  139. doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
  140.  
  141. elseif(accountManager == MANAGER_NAMELOCK) then
  142. doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, it appears that your character has been namelocked, what would you like as your new name?")
  143. elseif(accountManager == MANAGER_ACCOUNT) then
  144. doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to manage your account and if you want to start over then type 'cancel'.")
  145. else
  146. doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to create an account or type 'recover' to recover an account.")
  147. end
  148.  
  149. if getCreatureName(cid) == "Account Manager" then
  150. local outfit = {}
  151. if accountManagerRandomPokemonOutfit then
  152. outfit = {lookType = getPokemonXMLOutfit(oldpokedex[math.random(151)][1])}
  153. else
  154. outfit = accountManagerOutfit
  155. end
  156.  
  157. doSetCreatureOutfit(cid, outfit, -1)
  158. return true
  159. end
  160.  
  161. if(not isPlayerGhost(cid)) then
  162. doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
  163. end
  164.  
  165. local outfit = {}
  166.  
  167. if getPlayerVocation(cid) == 0 then
  168. doPlayerSetMaxCapacity(cid, 0)
  169. doPlayerSetVocation(cid, 1)
  170. setPlayerStorageValue(cid, 86228, 0)
  171. setPlayerStorageValue(cid, 862281, 0)
  172. setCreatureMaxMana(cid, 6)
  173. doPlayerAddSoul(cid, -getPlayerSoul(cid))
  174. setPlayerStorageValue(cid, 19898, 0)
  175. if getCreatureOutfit(cid).lookType == 128 then
  176. outfit = {lookType = 510, lookHead = math.random(0, 132), lookBody = math.random(0, 132), lookLegs = math.random(0, 132), lookFeet = math.random(0, 132)}
  177. elseif getCreatureOutfit(cid).lookType == 136 then
  178. outfit = {lookType = 511, lookHead = math.random(0, 132), lookBody = math.random(0, 132), lookLegs = math.random(0, 132), lookFeet = math.random(0, 132)}
  179. end
  180. doCreatureChangeOutfit(cid, outfit)
  181. end
  182.  
  183. registerCreatureEvent(cid, "WatchTv")
  184. registerCreatureEvent(cid, "StopWatchingTv")
  185. registerCreatureEvent(cid, "WalkTv")
  186. registerCreatureEvent(cid, "RecordTv")
  187. --registerCreatureEvent(cid, "deadd")
  188. --registerCreatureEvent(cid, "Death")
  189. registerCreatureEvent(cid, "PlayerLogout")
  190. registerCreatureEvent(cid, "WildAttack")
  191. registerCreatureEvent(cid, "Idle")
  192. registerCreatureEvent(cid, "PokemonIdle")
  193. registerCreatureEvent(cid, "EffectOnAdvance")
  194. registerCreatureEvent(cid, "GeneralConfiguration")
  195. registerCreatureEvent(cid, "ReportBug")
  196. registerCreatureEvent(cid, "LookSystem")
  197. registerCreatureEvent(cid, "T1")
  198. registerCreatureEvent(cid, "T2")
  199. registerCreatureEvent(cid, "task_count")
  200.  
  201. if getPlayerStorageValue(cid, 99284) == 1 then
  202. setPlayerStorageValue(cid, 99284, -1)
  203. end
  204.  
  205. doChangeSpeed(cid, -(getCreatureSpeed(cid)))
  206.  
  207. if getPlayerStorageValue(cid, 17000) >= 1 then -- fly
  208.  
  209. local item = getPlayerSlotItem(cid, 8)
  210. local poke = getItemAttribute(item.uid, "poke")
  211. doChangeSpeed(cid, getPlayerStorageValue(cid, 54844))
  212. doRemoveCondition(cid, CONDITION_OUTFIT)
  213. doSetCreatureOutfit(cid, {lookType = flys[poke][1] + 351}, -1)
  214.  
  215. local apos = getFlyingMarkedPos(cid)
  216. apos.stackpos = 0
  217.  
  218. if getTileThingByPos(apos).itemid <= 2 then
  219. doCombatAreaHealth(cid, FIREDAMAGE, getFlyingMarkedPos(cid), 0, 0, 0, CONST_ME_NONE)
  220. doCreateItem(460, 1, getFlyingMarkedPos(cid))
  221. end
  222.  
  223. doTeleportThing(cid, apos, false)
  224.  
  225. local posicao = getTownTemplePosition(getPlayerTown(cid))
  226. markFlyingPos(cid, posicao)
  227.  
  228. elseif getPlayerStorageValue(cid, 63215) >= 1 then -- surf
  229.  
  230. local item = getPlayerSlotItem(cid, 8)
  231. local poke = getItemAttribute(item.uid, "poke")
  232. doSetCreatureOutfit(cid, {lookType = surf[poke].lookType + 351}, -1)
  233. doChangeSpeed(cid, getPlayerStorageValue(cid, 54844))
  234.  
  235. elseif getPlayerStorageValue(cid, 17001) >= 1 then -- ride
  236.  
  237. local item = getPlayerSlotItem(cid, 8)
  238. local poke = getItemAttribute(item.uid, "poke")
  239.  
  240.  
  241. if rides[poke] then
  242. doChangeSpeed(cid, getPlayerStorageValue(cid, 54844))
  243. doRemoveCondition(cid, CONDITION_OUTFIT)
  244. doSetCreatureOutfit(cid, {lookType = rides[poke][1] + 351}, -1)
  245. else
  246. setPlayerStorageValue(cid, 17001, -1)
  247. doChangeSpeed(cid, PlayerSpeed)
  248. end
  249.  
  250. local posicao2 = getTownTemplePosition(getPlayerTown(cid))
  251. markFlyingPos(cid, posicao2)
  252.  
  253. elseif getPlayerStorageValue(cid, 13008) >= 1 then -- dive
  254. if not isInArray({5405, 5406, 5407, 5408, 5409, 5410}, getTileInfo(getThingPos(cid)).itemid) then
  255. setPlayerStorageValue(cid, 13008, 0)
  256. doChangeSpeed(cid, PlayerSpeed)
  257. doRemoveCondition(cid, CONDITION_OUTFIT)
  258. return true
  259. end
  260.  
  261. if getPlayerSex(cid) == 1 then
  262. doSetCreatureOutfit(cid, {lookType = 1034, lookHead = getCreatureOutfit(cid).lookHead, lookBody = getCreatureOutfit(cid).lookBody, lookLegs = getCreatureOutfit(cid).lookLegs, lookFeet = getCreatureOutfit(cid).lookFeet}, -1)
  263. else
  264. doSetCreatureOutfit(cid, {lookType = 1035, lookHead = getCreatureOutfit(cid).lookHead, lookBody = getCreatureOutfit(cid).lookBody, lookLegs = getCreatureOutfit(cid).lookLegs, lookFeet = getCreatureOutfit(cid).lookFeet}, -1)
  265. end
  266. doChangeSpeed(cid, 800)
  267.  
  268. elseif getPlayerGroupId(cid) >= 4 and getPlayerGroupId(cid) <= 7 then
  269. doChangeSpeed(cid, 140*getPlayerGroupId(cid))
  270. else
  271. doChangeSpeed(cid, PlayerSpeed)
  272. end
  273. return true
  274. end
Advertisement
Add Comment
Please, Sign In to add comment