Guest User

Untitled

a guest
Feb 18th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 14.15 KB | None | 0 0
  1. local config = {
  2.     loginMessage = getConfigValue('loginMessage'),
  3.     useFragHandler = getBooleanFromString(getConfigValue('useFragHandler'))
  4. }
  5.  
  6. local balls = {
  7.         [2222]  = { b = 2223 },
  8.         [2224]  = { b = 2223 },
  9.        
  10.         [11438] = { b = 11439 },
  11.         [11440] = { b = 11439 },
  12.        
  13.         [11442] = { b = 11443 },
  14.         [11444] = { b = 11443 },
  15.        
  16.         [2220]  = { b = 2221 },
  17.         [2227]  = { b = 2221 },
  18.        
  19.         [11446] = { b = 11447 },
  20.         [11447] = { b = 11447 },
  21.         [11448] = { b = 11447 },
  22.        
  23.         [11449] = { b = 11450 },
  24.         [11450] = { b = 11450 },
  25.         [11451] = { b = 11450 },
  26.        
  27.         [11452] = { b = 11453 },
  28.         [11453] = { b = 11453 },
  29.         [11454] = { b = 11453 },
  30.        
  31.         [11455] = { b = 11456 },
  32.         [11456] = { b = 11456 },
  33.         [11457] = { b = 11456 },
  34.        
  35.         [11458] = { b = 11458 },
  36.         [11459] = { b = 11458 },
  37.         [11460] = { b = 11458 },
  38. }
  39.  
  40. function onLogin(cid)
  41.  
  42.     doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, 0) (getPlayerLevel(cid)*2))
  43.     doCreatureSetDropLoot(cid, false)
  44.    
  45.     if getPlayerStorageValue(cid, 100001) <= 0 then
  46.        
  47.             local bags = getPlayerSlotItem(cid, 5)
  48.            
  49.             local insig2 = doAddContainerItem(bags.uid, 2307, 1)
  50.             local insig3 = doAddContainerItem(bags.uid, 2308, 1)
  51.             local insig4 = doAddContainerItem(bags.uid, 2309, 1)
  52.             local insig1 = doAddContainerItem(bags.uid, 2310, 1)
  53.             local insig5 = doAddContainerItem(bags.uid, 2311, 1)
  54.             local insig6 = doAddContainerItem(bags.uid, 2312, 1)
  55.             local insig7 = doAddContainerItem(bags.uid, 2313, 1)
  56.             local insig8 = doAddContainerItem(bags.uid, 2314, 1)       
  57.             setPlayerStorageValue(cid, 100001, 1)
  58.            
  59.     end
  60.    
  61.     local accountManager = getPlayerAccountManager(cid)
  62.    
  63.     if getPlayerStorageValue(cid, 23254) < 0 then
  64.             setPlayerStorageValue(cid, 23254, 0)
  65.     end
  66.    
  67.     if(accountManager == MANAGER_NONE) then
  68.         local lastLogin, str = getPlayerLastLoginSaved(cid), config.loginMessage
  69.         if(lastLogin > 0) then
  70.             doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
  71.             str = "Your last visit was on " .. os.date("%a %b %d %X %Y", lastLogin) .. "."
  72.         else
  73.             str = str .. " Have fun! "
  74.         end
  75.  
  76.         doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
  77.     elseif(accountManager == MANAGER_NAMELOCK) then
  78.         doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, it appears that your character has been namelocked, what would you like as your new name?")
  79.     elseif(accountManager == MANAGER_ACCOUNT) then
  80.         doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to manage your account and if you want to start over then type 'cancel'.")
  81.     else
  82.         doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to create an account or type 'recover' to recover an account.")
  83.     end
  84.  
  85.     if(not isPlayerGhost(cid)) then
  86.         doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
  87.     end
  88.     local flys = {
  89. ['Moltres'] = {229, 2300},
  90. ['Articuno'] = {230, 2100},
  91. ['Zapdos'] = {224, 2600},
  92. ['Mew'] = {232, 2200},
  93. ['Mewtwo'] = {233, 2200},
  94. ['Dragonite'] = {221, 1300},
  95. ['Pidgeot'] = {222, 900},
  96. ['Fearow'] = {226, 800},
  97. ['Aerodactyl'] = {227, 1100},
  98. ['Charizard'] = {216, 1000},
  99. ['Porygon'] = {316, 600},
  100. ['Elder Charizard'] = {295, 350},
  101. ['Shiny Pidgeot'] = {178, 350}
  102. }
  103.  
  104. local rides = {
  105. ["Tauros"] = {128, 780, 400}, -- tauros
  106. ["Ninetales"] = {129, 800, 375}, -- kyuubi
  107. ["Rapidash"] = {130, 800, 395}, -- rapid
  108. ["Ponyta"] = {131, 410, 500}, -- ponyta
  109. ["Rhyhorn"] = {132, 400, 510}, -- rhyhorn
  110. ["Arcanine"] = {12, 900, 390}, -- arcan
  111. ["Shiny Arcanine"] = {492, 1000, 360}, -- shiny arca
  112. ["Shiny Venusaur"] = {494, 420, 420}, -- shiny vneu
  113. ["Crystal Onix"] = {293, 480, 430}, -- cristal onix
  114. ["Onix"] = {126, 450, 450}, -- onix
  115. ["Venusaur"] = {134, 390, 450}, -- venu
  116. ["Dodrio"] = {133, 750, 380}, -- dodrio
  117. ["Doduo"] = {135, 420, 500}, -- doduo
  118. ["Shiny Arcanine"] = {336, 500},
  119. ["Shiny Venusaur"] = {338, 500}
  120. }
  121.  
  122.     local surfs = {
  123. ["Poliwag"] = {lookType=278, speed = 320},
  124. ["Poliwhirl"] = {lookType=137, speed = 480},
  125. ["Seaking"] = {lookType=269, speed = 520},
  126. ["Dewgong"] = {lookType=183, speed = 700},
  127. ["Blastoise"] = {lookType=184, speed = 850},
  128. ["Tentacruel"] = {lookType=185, speed = 750},
  129. ["Lapras"] = {lookType=186, speed = 960},
  130. ["Gyarados"] = {lookType=187, speed = 1050},
  131. ["Omastar"] = {lookType=188, speed = 680},
  132. ["Kabutops"] = {lookType=189, speed = 840},
  133. ["Poliwrath"] = {lookType=190, speed = 680},
  134. ["Vaporeon"] = {lookType=191, speed = 800},
  135. ["Staryu"] = {lookType=266, speed = 385},
  136. ["Starmie"] = {lookType=267, speed = 685},
  137. ["Goldeen"] = {lookType=268, speed = 355},
  138. ["Seadra"] = {lookType=270, speed = 655},
  139. ["Golduck"] = {lookType=271, speed = 760},
  140. ["Squirtle"] = {lookType=273, speed = 365},
  141. ["Wartortle"] = {lookType=275, speed = 605},
  142. ["Tentacool"] = {lookType=277, speed = 340},
  143. ["Snorlax"] = {lookType=300, speed = 500},
  144. ["Shiny Blastoise"] = {lookType=205, speed = 350},
  145. ["Shiny Gyarados"] = {lookType = 225, speed = 380},
  146. ["Shiny Tentacool"] = {lookType = 347, speed = 150},
  147. ["Shiny Tentacruel"] = {lookType = 334, speed = 320},
  148. ["Shiny Vaporeon"] = {lookType = 308, speed = 300}
  149. }
  150.  
  151.     registerCreatureEvent(cid, "GuildMotd")
  152.     registerCreatureEvent(cid, "NoTrade")
  153.     registerCreatureEvent(cid, "PlayerPokeDeath")
  154.     registerCreatureEvent(cid, "LogoutPoke")
  155.     registerCreatureEvent(cid, "WildAttack")
  156.     registerCreatureEvent(cid, "Idle")
  157.     registerCreatureEvent(cid, "Tele")
  158.     registerCreatureEvent(cid, "Exp")
  159.     registerCreatureEvent(cid, "Alook")
  160.     registerCreatureEvent(cid, "GymBrock")
  161.     registerCreatureEvent(cid, "BrockGym")
  162.     registerCreatureEvent(cid, "Logout")
  163.    
  164.     tmp = getPlayerStorageValue(cid, 19000)
  165.     qtdMorto = getPlayerStorageValue(cid, 19002)
  166.    
  167.     if tmp ~= nil and qtdMorto < 100 then
  168.         registerCreatureEvent(cid, "Promote")
  169.     elseif tmp ~= nil and qtdMorto == 100 then
  170.         doPlayerSetVocation(cid, promoVoc[tmp].id)
  171.     end
  172.    
  173.     tmp = getPlayerStorageValue(cid, 19001)
  174.     if getPlayerStorageValue(cid, 61207) >= 1 then
  175.     setPlayerStorageValue(cid, 61207, 0)
  176.     if getPlayerSlotItem(cid, 8).itemid == 2223 or getPlayerSlotItem(cid, 8).itemid == 2221 then
  177.     doTransformItem(getPlayerSlotItem(cid, 8).uid, getPlayerSlotItem(cid, 8).itemid-1)
  178.     end
  179.     local item = getPlayerSlotItem(cid, 8)
  180.     doItemSetAttribute(item.uid, "poke", getItemAttribute(item.uid, "poke") .. " HP = ["..getPlayerStorageValue(cid, 61205).."/"..getPlayerStorageValue(cid, 61206).."]")
  181.     end
  182.     if getPlayerItemCount(cid, pokeout) >= 1 and getPlayerStorageValue(cid, 61207) <= 0 and getPlayerStorageValue(cid, 17001) <= 0 and getPlayerStorageValue(cid, 17000) <= 0 and getPlayerStorageValue(cid, 63215) <= 0 then
  183.     local item = getPlayerItemById(cid, TRUE, pokeout)
  184.     doTransformItem(item.uid, pokein)
  185.     doItemSetAttribute(item.uid, "poke", getItemAttribute(item.uid, "poke") .. " HP = ["..getPlayerStorageValue(cid, 61205).."/"..getPlayerStorageValue(cid, 61206).."]")
  186.     end
  187.     if getPlayerItemCount(cid, ultrapokeout) >= 1 and getPlayerStorageValue(cid, 61207) <= 0 and getPlayerStorageValue(cid, 17001) <= 0 and getPlayerStorageValue(cid, 17000) <= 0 and getPlayerStorageValue(cid, 63215) <= 0 then
  188.     local item = getPlayerItemById(cid, TRUE, ultrapokeout)
  189.     doTransformItem(item.uid, ultrapokein)
  190.     doItemSetAttribute(item.uid, "poke", getItemAttribute(item.uid, "poke") .. " HP = ["..getPlayerStorageValue(cid, 61205).."/"..getPlayerStorageValue(cid, 61206).."]")
  191.     end
  192.     if getPlayerItemCount(cid, greatpokeout) >= 1 and getPlayerStorageValue(cid, 61207) <= 0 and getPlayerStorageValue(cid, 17001) <= 0 and getPlayerStorageValue(cid, 17000) <= 0 and getPlayerStorageValue(cid, 63215) <= 0 then
  193.     local item = getPlayerItemById(cid, TRUE, greatpokeout)
  194.     doTransformItem(item.uid, greatpokein)
  195.     doItemSetAttribute(item.uid, "poke", getItemAttribute(item.uid, "poke") .. " HP = ["..getPlayerStorageValue(cid, 61205).."/"..getPlayerStorageValue(cid, 61206).."]")
  196.     end
  197.     if getPlayerItemCount(cid, superpokeout) >= 1 and getPlayerStorageValue(cid, 61207) <= 0 and getPlayerStorageValue(cid, 17001) <= 0 and getPlayerStorageValue(cid, 17000) <= 0 and getPlayerStorageValue(cid, 63215) <= 0 then
  198.     local item = getPlayerItemById(cid, TRUE, superpokeout)
  199.     doTransformItem(item.uid, superpokein)
  200.     doItemSetAttribute(item.uid, "poke", getItemAttribute(item.uid, "poke") .. " HP = ["..getPlayerStorageValue(cid, 61205).."/"..getPlayerStorageValue(cid, 61206).."]")
  201.     end
  202.     if getPlayerItemCount(cid, safaripokeout) >= 1 and getPlayerStorageValue(cid, 61207) <= 0 and getPlayerStorageValue(cid, 17001) <= 0 and getPlayerStorageValue(cid, 17000) <= 0 and getPlayerStorageValue(cid, 63215) <= 0 then
  203.     local item = getPlayerItemById(cid, TRUE, safaripokeout)
  204.     doTransformItem(item.uid, safaripokein)
  205.     doItemSetAttribute(item.uid, "poke", getItemAttribute(item.uid, "poke") .. " HP = ["..getPlayerStorageValue(cid, 61205).."/"..getPlayerStorageValue(cid, 61206).."]")
  206.     end
  207.     if getPlayerItemCount(cid, lovepokeout) >= 1 and getPlayerStorageValue(cid, 61207) <= 0 and getPlayerStorageValue(cid, 17001) <= 0 and getPlayerStorageValue(cid, 17000) <= 0 and getPlayerStorageValue(cid, 63215) <= 0 then
  208.     local item = getPlayerItemById(cid, TRUE, lovepokeout)
  209.     doTransformItem(item.uid, lovepokein)
  210.     doItemSetAttribute(item.uid, "poke", getItemAttribute(item.uid, "poke") .. " HP = ["..getPlayerStorageValue(cid, 61205).."/"..getPlayerStorageValue(cid, 61206).."]")
  211.     end
  212.     if getPlayerItemCount(cid, goldenpokeout) >= 1 and getPlayerStorageValue(cid, 61207) <= 0 and getPlayerStorageValue(cid, 17001) <= 0 and getPlayerStorageValue(cid, 17000) <= 0 and getPlayerStorageValue(cid, 63215) <= 0 then
  213.     local item = getPlayerItemById(cid, TRUE, goldenpokeout)
  214.     doTransformItem(item.uid, goldenpokein)
  215.     doItemSetAttribute(item.uid, "poke", getItemAttribute(item.uid, "poke") .. " HP = ["..getPlayerStorageValue(cid, 61205).."/"..getPlayerStorageValue(cid, 61206).."]")
  216.     end
  217.     if getPlayerItemCount(cid, freshpokeout) >= 1 and getPlayerStorageValue(cid, 61207) <= 0 and getPlayerStorageValue(cid, 17001) <= 0 and getPlayerStorageValue(cid, 17000) <= 0 and getPlayerStorageValue(cid, 63215) <= 0 then
  218.     local item = getPlayerItemById(cid, TRUE, freshpokeout)
  219.     doTransformItem(item.uid, freshpokein)
  220.     doItemSetAttribute(item.uid, "poke", getItemAttribute(item.uid, "poke") .. " HP = ["..getPlayerStorageValue(cid, 61205).."/"..getPlayerStorageValue(cid, 61206).."]")
  221.     end
  222.     if getPlayerItemCount(cid, darkpokeout) >= 1 and getPlayerStorageValue(cid, 61207) <= 0 and getPlayerStorageValue(cid, 17001) <= 0 and getPlayerStorageValue(cid, 17000) <= 0 and getPlayerStorageValue(cid, 63215) <= 0 then
  223.     local item = getPlayerItemById(cid, TRUE, darkpokeout)
  224.     doTransformItem(item.uid, darkpokein)
  225.     doItemSetAttribute(item.uid, "poke", getItemAttribute(item.uid, "poke") .. " HP = ["..getPlayerStorageValue(cid, 61205).."/"..getPlayerStorageValue(cid, 61206).."]")
  226.     end
  227.  
  228.     doChangeSpeed(cid, -(getCreatureSpeed(cid)))
  229.     if getPlayerStorageValue(cid, 7778) == 4 then
  230.             posi = {x=getPlayerStorageValue(cid, 7775),y=getPlayerStorageValue(cid, 7776),z=getPlayerStorageValue(cid, 7777)}
  231.            
  232.             posa = posi
  233.             if posi.z <= 6 then
  234.            
  235.                    
  236.                     if getTileThingByPos(posi).itemid ~= 460 then
  237.                                 if getTileThingByPos(posa).itemid == 0 then
  238.                                     doCombatAreaHealth(cid, 0, posa, 0, 0, 0, CONST_ME_NONE)
  239.                                     doCreateItem(460, 1, posa)
  240.                                 end
  241.                                 doTeleportThing(cid,posa)
  242.                     elseif getTileThingByPos(posi).itemid == 0 then
  243.                             if getTileThingByPos(posa).itemid == 0 then
  244.                                 doCombatAreaHealth(cid, 0, posa, 0, 0, 0, CONST_ME_NONE)
  245.                                 doCreateItem(460, 1, posa)
  246.                             end
  247.                            
  248.                     end
  249.             end
  250.             doTeleportThing(cid,posa)
  251.             item = getPlayerSlotItem(cid, 8)
  252.             poke = getItemAttribute(item.uid, "poke"):match("This is (.-)'s pokeball.")
  253.             doChangeSpeed(cid, flys[poke][2])
  254.             registerCreatureEvent(cid, "Flying")
  255.             doRemoveCondition(cid, CONDITION_OUTFIT)
  256.             doSetCreatureOutfit(cid, {lookType = flys[poke][1], lookHead = 0, lookAddons = 0, lookLegs = 0, lookBody = 0, lookFeet = 0}, -1)
  257.             ballOk = balls[item.itemid]
  258.             if ballOk ~= nil then
  259.                 doTransformItem(item.uid, ballOk.b)
  260.             end
  261.     elseif getPlayerStorageValue(cid, 7778) == 3 then
  262.            
  263.             posi = {x=getPlayerStorageValue(cid, 7775),y=getPlayerStorageValue(cid, 7776),z=7}
  264.            
  265.             doTeleportThing(cid,posi)
  266.    
  267.             item = getPlayerSlotItem(cid, 8)
  268.             poke = getItemAttribute(item.uid, "poke"):match("This is (.-)'s pokeball.")
  269.             doChangeSpeed(cid, surfs[poke].speed)
  270.             doRemoveCondition(cid, CONDITION_OUTFIT)
  271.             doSetCreatureOutfit(cid, {lookType = surfs[poke].lookType, lookHead = 0, lookAddons = 0, lookLegs = 0, lookBody = 0, lookFeet = 0}, -1)
  272.             ballOk = balls[item.itemid]
  273.             if ballOk ~= nil then
  274.                 doPlayerSendCancel(cid,ballOk.b)
  275.                 doTransformItem(item.uid, ballOk.b)
  276.             end
  277.     elseif getPlayerStorageValue(cid, 63215) >= 1 then
  278.     item = getPlayerSlotItem(cid, 8)
  279.     poke = getItemAttribute(item.uid, "poke"):match("This is (.-)'s pokeball.")
  280.     doSetCreatureOutfit(cid, surf[poke], -1)
  281.     doChangeSpeed(cid, surf[poke].speed)
  282.     elseif getPlayerStorageValue(cid, 17001) >= 1 then
  283.     item = getPlayerSlotItem(cid, 8)
  284.     poke = getItemAttribute(item.uid, "poke"):match("This is (.-)'s pokeball.")
  285.     doChangeSpeed(cid, rides[poke][2])
  286.     doRemoveCondition(cid, CONDITION_OUTFIT)
  287.     doSetCreatureOutfit(cid, {lookType = rides[poke][1], lookHead = 0, lookAddons = 0, lookLegs = 0, lookBody = 0, lookFeet = 0}, -1)
  288.     else
  289.     if getPlayerGroupId(cid) >= 2 and getPlayerGroupId(cid) <= 7 then
  290.     doChangeSpeed(cid, 400*getPlayerGroupId(cid))
  291.     else
  292.     doChangeSpeed(cid, 250)
  293.     end
  294.     end
  295.     if getPlayerVocation(cid) == getPlayerVocation(cid) then
  296.         setCreatureMaxMana(cid, 6)
  297.         setPlayerStorageValue(cid, 19898, 0)
  298.         doPlayerSetVocation(cid, getPlayerVocation(cid))
  299.     end
  300.     if getCreatureOutfit(cid).lookType == 128 then
  301.     outfit = {lookType = 159}
  302.     doCreatureChangeOutfit(cid, outfit)
  303.     elseif getCreatureOutfit(cid).lookType == 136 then
  304.     outfit = {lookType = 160}
  305.     doCreatureChangeOutfit(cid, outfit)
  306.     end
  307.    
  308.     if getPlayerStorageValue(cid, 99998) ~= 1 then
  309.         doPlayerSetMaxCapacity(cid,6.1)
  310.         doPlayerAddSoul(cid,-getPlayerSoul(cid))
  311.         capturados = getPlayerStorageValue(cid, 54842)
  312.         if capturados ~= nil then
  313.             doPlayerAddSoul(cid,string.count(capturados,","))
  314.         end
  315.         setPlayerStorageValue(cid, 99999, 1)
  316.     end
  317.    
  318.     registerCreatureEvent(cid, "ReportBug")
  319.     registerCreatureEvent(cid, "AdvanceSave")
  320.     return true
  321. end
Add Comment
Please, Sign In to add comment