Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local config = {
- loginMessage = getConfigValue('loginMessage'),
- useFragHandler = getBooleanFromString(getConfigValue('useFragHandler'))
- }
- local balls = {
- [2222] = { b = 2223 },
- [2224] = { b = 2223 },
- [11438] = { b = 11439 },
- [11440] = { b = 11439 },
- [11442] = { b = 11443 },
- [11444] = { b = 11443 },
- [2220] = { b = 2221 },
- [2227] = { b = 2221 },
- [11446] = { b = 11447 },
- [11447] = { b = 11447 },
- [11448] = { b = 11447 },
- [11449] = { b = 11450 },
- [11450] = { b = 11450 },
- [11451] = { b = 11450 },
- [11452] = { b = 11453 },
- [11453] = { b = 11453 },
- [11454] = { b = 11453 },
- [11455] = { b = 11456 },
- [11456] = { b = 11456 },
- [11457] = { b = 11456 },
- [11458] = { b = 11458 },
- [11459] = { b = 11458 },
- [11460] = { b = 11458 },
- }
- function onLogin(cid)
- doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, 0) (getPlayerLevel(cid)*2))
- doCreatureSetDropLoot(cid, false)
- if getPlayerStorageValue(cid, 100001) <= 0 then
- local bags = getPlayerSlotItem(cid, 5)
- local insig2 = doAddContainerItem(bags.uid, 2307, 1)
- local insig3 = doAddContainerItem(bags.uid, 2308, 1)
- local insig4 = doAddContainerItem(bags.uid, 2309, 1)
- local insig1 = doAddContainerItem(bags.uid, 2310, 1)
- local insig5 = doAddContainerItem(bags.uid, 2311, 1)
- local insig6 = doAddContainerItem(bags.uid, 2312, 1)
- local insig7 = doAddContainerItem(bags.uid, 2313, 1)
- local insig8 = doAddContainerItem(bags.uid, 2314, 1)
- setPlayerStorageValue(cid, 100001, 1)
- end
- local accountManager = getPlayerAccountManager(cid)
- if getPlayerStorageValue(cid, 23254) < 0 then
- setPlayerStorageValue(cid, 23254, 0)
- end
- if(accountManager == MANAGER_NONE) then
- local lastLogin, str = getPlayerLastLoginSaved(cid), config.loginMessage
- if(lastLogin > 0) then
- doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
- str = "Your last visit was on " .. os.date("%a %b %d %X %Y", lastLogin) .. "."
- else
- str = str .. " Have fun! "
- end
- doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
- elseif(accountManager == MANAGER_NAMELOCK) then
- doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, it appears that your character has been namelocked, what would you like as your new name?")
- elseif(accountManager == MANAGER_ACCOUNT) then
- doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to manage your account and if you want to start over then type 'cancel'.")
- else
- doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to create an account or type 'recover' to recover an account.")
- end
- if(not isPlayerGhost(cid)) then
- doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
- end
- local flys = {
- ['Moltres'] = {229, 2300},
- ['Articuno'] = {230, 2100},
- ['Zapdos'] = {224, 2600},
- ['Mew'] = {232, 2200},
- ['Mewtwo'] = {233, 2200},
- ['Dragonite'] = {221, 1300},
- ['Pidgeot'] = {222, 900},
- ['Fearow'] = {226, 800},
- ['Aerodactyl'] = {227, 1100},
- ['Charizard'] = {216, 1000},
- ['Porygon'] = {316, 600},
- ['Elder Charizard'] = {295, 350},
- ['Shiny Pidgeot'] = {178, 350}
- }
- local rides = {
- ["Tauros"] = {128, 780, 400}, -- tauros
- ["Ninetales"] = {129, 800, 375}, -- kyuubi
- ["Rapidash"] = {130, 800, 395}, -- rapid
- ["Ponyta"] = {131, 410, 500}, -- ponyta
- ["Rhyhorn"] = {132, 400, 510}, -- rhyhorn
- ["Arcanine"] = {12, 900, 390}, -- arcan
- ["Shiny Arcanine"] = {492, 1000, 360}, -- shiny arca
- ["Shiny Venusaur"] = {494, 420, 420}, -- shiny vneu
- ["Crystal Onix"] = {293, 480, 430}, -- cristal onix
- ["Onix"] = {126, 450, 450}, -- onix
- ["Venusaur"] = {134, 390, 450}, -- venu
- ["Dodrio"] = {133, 750, 380}, -- dodrio
- ["Doduo"] = {135, 420, 500}, -- doduo
- ["Shiny Arcanine"] = {336, 500},
- ["Shiny Venusaur"] = {338, 500}
- }
- local surfs = {
- ["Poliwag"] = {lookType=278, speed = 320},
- ["Poliwhirl"] = {lookType=137, speed = 480},
- ["Seaking"] = {lookType=269, speed = 520},
- ["Dewgong"] = {lookType=183, speed = 700},
- ["Blastoise"] = {lookType=184, speed = 850},
- ["Tentacruel"] = {lookType=185, speed = 750},
- ["Lapras"] = {lookType=186, speed = 960},
- ["Gyarados"] = {lookType=187, speed = 1050},
- ["Omastar"] = {lookType=188, speed = 680},
- ["Kabutops"] = {lookType=189, speed = 840},
- ["Poliwrath"] = {lookType=190, speed = 680},
- ["Vaporeon"] = {lookType=191, speed = 800},
- ["Staryu"] = {lookType=266, speed = 385},
- ["Starmie"] = {lookType=267, speed = 685},
- ["Goldeen"] = {lookType=268, speed = 355},
- ["Seadra"] = {lookType=270, speed = 655},
- ["Golduck"] = {lookType=271, speed = 760},
- ["Squirtle"] = {lookType=273, speed = 365},
- ["Wartortle"] = {lookType=275, speed = 605},
- ["Tentacool"] = {lookType=277, speed = 340},
- ["Snorlax"] = {lookType=300, speed = 500},
- ["Shiny Blastoise"] = {lookType=205, speed = 350},
- ["Shiny Gyarados"] = {lookType = 225, speed = 380},
- ["Shiny Tentacool"] = {lookType = 347, speed = 150},
- ["Shiny Tentacruel"] = {lookType = 334, speed = 320},
- ["Shiny Vaporeon"] = {lookType = 308, speed = 300}
- }
- registerCreatureEvent(cid, "GuildMotd")
- registerCreatureEvent(cid, "NoTrade")
- registerCreatureEvent(cid, "PlayerPokeDeath")
- registerCreatureEvent(cid, "LogoutPoke")
- registerCreatureEvent(cid, "WildAttack")
- registerCreatureEvent(cid, "Idle")
- registerCreatureEvent(cid, "Tele")
- registerCreatureEvent(cid, "Exp")
- registerCreatureEvent(cid, "Alook")
- registerCreatureEvent(cid, "GymBrock")
- registerCreatureEvent(cid, "BrockGym")
- registerCreatureEvent(cid, "Logout")
- tmp = getPlayerStorageValue(cid, 19000)
- qtdMorto = getPlayerStorageValue(cid, 19002)
- if tmp ~= nil and qtdMorto < 100 then
- registerCreatureEvent(cid, "Promote")
- elseif tmp ~= nil and qtdMorto == 100 then
- doPlayerSetVocation(cid, promoVoc[tmp].id)
- end
- tmp = getPlayerStorageValue(cid, 19001)
- if getPlayerStorageValue(cid, 61207) >= 1 then
- setPlayerStorageValue(cid, 61207, 0)
- if getPlayerSlotItem(cid, 8).itemid == 2223 or getPlayerSlotItem(cid, 8).itemid == 2221 then
- doTransformItem(getPlayerSlotItem(cid, 8).uid, getPlayerSlotItem(cid, 8).itemid-1)
- end
- local item = getPlayerSlotItem(cid, 8)
- doItemSetAttribute(item.uid, "poke", getItemAttribute(item.uid, "poke") .. " HP = ["..getPlayerStorageValue(cid, 61205).."/"..getPlayerStorageValue(cid, 61206).."]")
- end
- 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
- local item = getPlayerItemById(cid, TRUE, pokeout)
- doTransformItem(item.uid, pokein)
- doItemSetAttribute(item.uid, "poke", getItemAttribute(item.uid, "poke") .. " HP = ["..getPlayerStorageValue(cid, 61205).."/"..getPlayerStorageValue(cid, 61206).."]")
- end
- 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
- local item = getPlayerItemById(cid, TRUE, ultrapokeout)
- doTransformItem(item.uid, ultrapokein)
- doItemSetAttribute(item.uid, "poke", getItemAttribute(item.uid, "poke") .. " HP = ["..getPlayerStorageValue(cid, 61205).."/"..getPlayerStorageValue(cid, 61206).."]")
- end
- 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
- local item = getPlayerItemById(cid, TRUE, greatpokeout)
- doTransformItem(item.uid, greatpokein)
- doItemSetAttribute(item.uid, "poke", getItemAttribute(item.uid, "poke") .. " HP = ["..getPlayerStorageValue(cid, 61205).."/"..getPlayerStorageValue(cid, 61206).."]")
- end
- 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
- local item = getPlayerItemById(cid, TRUE, superpokeout)
- doTransformItem(item.uid, superpokein)
- doItemSetAttribute(item.uid, "poke", getItemAttribute(item.uid, "poke") .. " HP = ["..getPlayerStorageValue(cid, 61205).."/"..getPlayerStorageValue(cid, 61206).."]")
- end
- 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
- local item = getPlayerItemById(cid, TRUE, safaripokeout)
- doTransformItem(item.uid, safaripokein)
- doItemSetAttribute(item.uid, "poke", getItemAttribute(item.uid, "poke") .. " HP = ["..getPlayerStorageValue(cid, 61205).."/"..getPlayerStorageValue(cid, 61206).."]")
- end
- 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
- local item = getPlayerItemById(cid, TRUE, lovepokeout)
- doTransformItem(item.uid, lovepokein)
- doItemSetAttribute(item.uid, "poke", getItemAttribute(item.uid, "poke") .. " HP = ["..getPlayerStorageValue(cid, 61205).."/"..getPlayerStorageValue(cid, 61206).."]")
- end
- 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
- local item = getPlayerItemById(cid, TRUE, goldenpokeout)
- doTransformItem(item.uid, goldenpokein)
- doItemSetAttribute(item.uid, "poke", getItemAttribute(item.uid, "poke") .. " HP = ["..getPlayerStorageValue(cid, 61205).."/"..getPlayerStorageValue(cid, 61206).."]")
- end
- 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
- local item = getPlayerItemById(cid, TRUE, freshpokeout)
- doTransformItem(item.uid, freshpokein)
- doItemSetAttribute(item.uid, "poke", getItemAttribute(item.uid, "poke") .. " HP = ["..getPlayerStorageValue(cid, 61205).."/"..getPlayerStorageValue(cid, 61206).."]")
- end
- 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
- local item = getPlayerItemById(cid, TRUE, darkpokeout)
- doTransformItem(item.uid, darkpokein)
- doItemSetAttribute(item.uid, "poke", getItemAttribute(item.uid, "poke") .. " HP = ["..getPlayerStorageValue(cid, 61205).."/"..getPlayerStorageValue(cid, 61206).."]")
- end
- doChangeSpeed(cid, -(getCreatureSpeed(cid)))
- if getPlayerStorageValue(cid, 7778) == 4 then
- posi = {x=getPlayerStorageValue(cid, 7775),y=getPlayerStorageValue(cid, 7776),z=getPlayerStorageValue(cid, 7777)}
- posa = posi
- if posi.z <= 6 then
- if getTileThingByPos(posi).itemid ~= 460 then
- if getTileThingByPos(posa).itemid == 0 then
- doCombatAreaHealth(cid, 0, posa, 0, 0, 0, CONST_ME_NONE)
- doCreateItem(460, 1, posa)
- end
- doTeleportThing(cid,posa)
- elseif getTileThingByPos(posi).itemid == 0 then
- if getTileThingByPos(posa).itemid == 0 then
- doCombatAreaHealth(cid, 0, posa, 0, 0, 0, CONST_ME_NONE)
- doCreateItem(460, 1, posa)
- end
- end
- end
- doTeleportThing(cid,posa)
- item = getPlayerSlotItem(cid, 8)
- poke = getItemAttribute(item.uid, "poke"):match("This is (.-)'s pokeball.")
- doChangeSpeed(cid, flys[poke][2])
- registerCreatureEvent(cid, "Flying")
- doRemoveCondition(cid, CONDITION_OUTFIT)
- doSetCreatureOutfit(cid, {lookType = flys[poke][1], lookHead = 0, lookAddons = 0, lookLegs = 0, lookBody = 0, lookFeet = 0}, -1)
- ballOk = balls[item.itemid]
- if ballOk ~= nil then
- doTransformItem(item.uid, ballOk.b)
- end
- elseif getPlayerStorageValue(cid, 7778) == 3 then
- posi = {x=getPlayerStorageValue(cid, 7775),y=getPlayerStorageValue(cid, 7776),z=7}
- doTeleportThing(cid,posi)
- item = getPlayerSlotItem(cid, 8)
- poke = getItemAttribute(item.uid, "poke"):match("This is (.-)'s pokeball.")
- doChangeSpeed(cid, surfs[poke].speed)
- doRemoveCondition(cid, CONDITION_OUTFIT)
- doSetCreatureOutfit(cid, {lookType = surfs[poke].lookType, lookHead = 0, lookAddons = 0, lookLegs = 0, lookBody = 0, lookFeet = 0}, -1)
- ballOk = balls[item.itemid]
- if ballOk ~= nil then
- doPlayerSendCancel(cid,ballOk.b)
- doTransformItem(item.uid, ballOk.b)
- end
- elseif getPlayerStorageValue(cid, 63215) >= 1 then
- item = getPlayerSlotItem(cid, 8)
- poke = getItemAttribute(item.uid, "poke"):match("This is (.-)'s pokeball.")
- doSetCreatureOutfit(cid, surf[poke], -1)
- doChangeSpeed(cid, surf[poke].speed)
- elseif getPlayerStorageValue(cid, 17001) >= 1 then
- item = getPlayerSlotItem(cid, 8)
- poke = getItemAttribute(item.uid, "poke"):match("This is (.-)'s pokeball.")
- doChangeSpeed(cid, rides[poke][2])
- doRemoveCondition(cid, CONDITION_OUTFIT)
- doSetCreatureOutfit(cid, {lookType = rides[poke][1], lookHead = 0, lookAddons = 0, lookLegs = 0, lookBody = 0, lookFeet = 0}, -1)
- else
- if getPlayerGroupId(cid) >= 2 and getPlayerGroupId(cid) <= 7 then
- doChangeSpeed(cid, 400*getPlayerGroupId(cid))
- else
- doChangeSpeed(cid, 250)
- end
- end
- if getPlayerVocation(cid) == getPlayerVocation(cid) then
- setCreatureMaxMana(cid, 6)
- setPlayerStorageValue(cid, 19898, 0)
- doPlayerSetVocation(cid, getPlayerVocation(cid))
- end
- if getCreatureOutfit(cid).lookType == 128 then
- outfit = {lookType = 159}
- doCreatureChangeOutfit(cid, outfit)
- elseif getCreatureOutfit(cid).lookType == 136 then
- outfit = {lookType = 160}
- doCreatureChangeOutfit(cid, outfit)
- end
- if getPlayerStorageValue(cid, 99998) ~= 1 then
- doPlayerSetMaxCapacity(cid,6.1)
- doPlayerAddSoul(cid,-getPlayerSoul(cid))
- capturados = getPlayerStorageValue(cid, 54842)
- if capturados ~= nil then
- doPlayerAddSoul(cid,string.count(capturados,","))
- end
- setPlayerStorageValue(cid, 99999, 1)
- end
- registerCreatureEvent(cid, "ReportBug")
- registerCreatureEvent(cid, "AdvanceSave")
- return true
- end
Add Comment
Please, Sign In to add comment