Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function doRemoveItemFromPos(position, itemid, count)
- local item = getTileItemById(position, itemid)
- if(item.uid ~= 0)then
- return doRemoveItem(item.uid, count or -1)
- end
- return false
- end
- local tRock = {
- ['geodude'] = {1},
- ['diglett'] = {1},
- ['dugtrio'] = {1},
- ['sandshrew'] = {1},
- ['primeape'] = {1},
- ['graveler'] = {1},
- ['golem'] = {1},
- ['onix'] = {1},
- ['cubone'] = {1},
- ['marowak'] = {1},
- ['rhyhorn'] = {1},
- ['rhydon'] = {1},
- ['kangaskhan'] = {1},
- ['tauros'] = {1},
- ['snorlax'] = {1},
- ['crystal Onix'] = {1},
- }
- local tCut = {
- ['bulbasaur'] = {1},
- ['ivysaur'] = {1},
- ['venusaur'] = {1},
- ['bellsprout'] = {1},
- ['charmeleon'] = {1},
- ['sandshrew'] = {1},
- ['sandslash'] = {1},
- ['gloom'] = {1},
- ['vileplume'] = {1},
- ['paras'] = {1},
- ['parasect'] = {1},
- ['meowth'] = {1},
- ['persian'] = {1},
- ['weepinbell'] = {1},
- ['victreebel'] = {1},
- ['farfetchd'] = {1},
- ['exeggutor'] = {1},
- ['cubone'] = {1},
- ['marowak'] = {1},
- ['scyther'] = {1},
- ['jynx'] = {1},
- ['tangela'] = {1},
- ['pinsir'] = {1},
- ['tangela'] = {1},
- ['pidgeot'] = {1},
- }
- local tDig = {
- ['sandshrew'] = {1},
- ['sandslash'] = {1},
- ['nidoran'] = {1},
- ['nidorina'] = {1},
- ['nidoqueen'] = {1},
- ['nidoranma'] = {1},
- ['nidorino'] = {1},
- ['nidoking'] = {1},
- ['diglett'] = {1},
- ['dugtrio'] = {1},
- ['geodude'] = {1},
- ['graveler'] = {1},
- ['golem'] = {1},
- ['onix'] = {1},
- ['crystal onix'] = {1},
- ['eevee'] = {1},
- }
- local tBuracos = {
- [468] = {469},
- [481] = {482},
- [483] = {484},
- }
- local tLight = {'electabuzz','alakazam','abra','hypno','mr.mime','electrode','magnemite','pikachu','raichu','kadabra','shiny raichu','shiny electrode','shiny voltorb','voltorb','shiny electabuzz','jolteon','porygon','mew','mewtwo', 'flareon'}
- local tRide = {
- ['tauros'] = {128, 200},
- ['ninetales'] = {129, 300},
- ['rapidash'] = {130, 350},
- ['ponyta'] = {131, 200},
- ['rhyhorn'] = {132, 150},
- ['arcanine'] = {12, 500},
- ['shiny arcanine'] = {492, 800},
- ['shiny venusaur'] = {494, 700},
- ['crystal onix'] = {293, 400},
- ['onix'] = {126, 350},
- ['venusaur'] = {134, 350},
- ['dodrio'] = {133, 350},
- ['doduo'] = {135, 250},
- }
- local idballs = {
- [2568] = {"Pokeball"},
- [2538] = {"Superball"},
- [2539] = {"Greatball"},
- [2537] = {"Ultraball"},
- [2542] = {"Masterball"},
- [2195] = {"Masterball"},
- [2532] = {"Pokeball"},
- [2653] = {"Superball"},
- [2652] = {"Greatball"},
- [2654] = {"Ultraball"},
- }
- local tFly = {
- ['moltres'] = {229, 800},
- ['articuno'] = {230, 800},
- ['zapdos'] = {224, 800},
- ['mew'] = {232, 800},
- ['mewtwo'] = {233, 800},
- ['dragonite'] = {221, 300},
- ['pidgeot'] = {222, 350},
- ['fearow'] = {226, 400},
- ['aerodactyl'] = {227, 490},
- ['charizard'] = {216, 590},
- ['elder charizard'] = {295, 800},
- ['porygon'] = {316, 350},
- }
- local tSurf = {
- ["Poliwag"] = {278, 400},
- ["Tentacruel"] = {185, 400},
- ["blastoise"] = {184, 400},
- ["Dewgong"] = {183, 400},
- ["Kabutops"] = {189, 400},
- ["Omastar"] = {188, 400},
- ["Gyarados"] = {187, 400},
- ["Poliwrath"] = {190, 400},
- ["Shiny Gyarados"] = {529, 410},
- ["Shiny Seadra"] = {522, 400},
- ["Shiny Tentacruel"] = {522, 400},
- ["Squirtle"] = {273, 400},
- ["Shiny Blastoise"] = {523, 400},
- ["Wartotle"] = {275, 400},
- ['Tentacool'] = {274, 400},
- ['Staryu'] = {266, 400},
- ['Starmie'] = {267, 400},
- ['Golduck'] = {271, 400},
- ['Poliwhirl'] = {137, 400},
- ['Tentacool'] = {277, 400},
- ['Goldeen'] = {268, 400},
- ['Seaking'] = {269, 400},
- ['Seadra'] = {270, 400},
- ['Snorlax'] = {300, 400},
- ['Vaporeon'] = {191, 400},
- }
- local configs = {
- [4647] = {x = -2, y = 0}, -- 4647 é o id da borda oeste (lado esquerdo do player) ----- Deixa assim
- [4645] = {x = 2, y = 0}, -- 4645 é o id da borda leste (lado direito do player) ----- Deixa assim
- [4646] = {x = 0, y = 2}, -- 4646 é o id da borda sul (abaixo do player) ----- Deixa assim
- [4644] = {x = 0, y = -2}, -- 4644 é o id da borda norte (acima do player) ----- Deixa assim
- }
- local configs2 = {4647, 4645, 4646, 4644}
- function onUse(cid, item, fromPosition, itemEx, toPosition)
- function rockSmach(uid, itemid, toPostion, Pname, sid)
- local pos = getThingPos(itemEx.uid)
- if itemEx.itemid == 1285 and tRock[Pname] then
- if #getCreatureSummons(cid) < 1 then
- return doPlayerSendCancel(cid, "Precisa de um pokemon pra usar Rock Smash!")
- end
- doCreatureSay(cid,""..Pname..", smash it!",1)
- doCreatureWalkTo(sid, toPosition)
- doRemoveItem(itemEx.uid,1)
- doCreateItem(3610,1,toPosition)
- doSendMagicEffect(toPosition, CONST_ME_BLOCKHIT)
- addEvent(doRemoveItemFromPos, 10000, toPosition, 3610)
- addEvent(doCreateItem,10005,1285,1,pos)
- return true
- elseif not tRock[Pname] and itemEx.itemid == 1285 then
- return doPlayerSendCancel(cid, "Este pokemon não pode usar Rock Smach!")
- end
- end
- ---------------------------fim rock------------------------------------
- function doCut(uid, itemid, toPosition, Pname, sid)
- local pos = getThingPos(itemEx.uid)
- if itemEx.itemid == 2767 and tCut[Pname] then
- if #getCreatureSummons(cid) < 1 then
- return doPlayerSendCancel(cid, "Precisa de um pokemon pra usar Cut!")
- end
- doCreatureSay(cid,""..Pname..", cut it!",1)
- doCreatureWalkTo(sid, toPosition)
- doRemoveItem(itemEx.uid,1)
- doCreateItem(6216,1,toPosition)
- doSendMagicEffect(toPosition, CONST_ME_BLOCKHIT)
- addEvent(doRemoveItemFromPos, 10000, toPosition, 6216)
- addEvent(doCreateItem,10005,2767,1,pos)
- return true
- elseif not tCut[Pname] and itemEx.itemid == 2767 then
- return doPlayerSendCancel(cid, "Este pokemon não pode usar Cut!")
- end
- end
- --------------------------fim Cut-----------------------------------------
- function doDig(uid, itemid, toPosition, Pname, sid)
- local pos = getThingPos(itemEx.uid)
- local Buracos = tBuracos[itemEx.itemid]
- if Buracos and tDig[Pname] then
- if #getCreatureSummons(cid) < 1 then
- return doPlayerSendCancel(cid, "Precisa de um pokemon pra usar Dig!")
- end
- doCreatureSay(cid, "Dig it, "..Pname.."",1)
- doCreatureWalkTo(sid, toPosition)
- doRemoveItem(itemEx.uid,1)
- doCreateItem(Buracos[1],1,toPosition)
- doSendMagicEffect(toPosition, CONST_ME_BLOCKHIT)
- addEvent(doRemoveItemFromPos, 10000, toPosition, Buracos[1])
- addEvent(doCreateItem,10005,Buracos[1] - 1,1,pos)
- return true
- elseif not tDig[Pname] and Buracos then
- return doPlayerSendCancel(cid, "Este pokemon não pode usar Dig!")
- end
- end
- ------------------------fim dig-----------------------------------------
- function doLight(uid, time, Pname)
- if isInArray(tLight, Pname) and itemEx.uid == getCreatureSummons(cid)[1] then
- if #getCreatureSummons(cid) < 1 then
- return doPlayerSendCancel(cid, "Precisa de um pokemon pra usar Light!")
- end
- doPlayerSay(cid, ""..Pname..", light!", 1)
- doSetCreatureLight(getCreatureSummons(cid)[1], 10, 210, time*1000)
- return true
- elseif not isInArray(tLight, Pname) and itemEx.uid == getCreatureSummons(cid)[1] then
- return doPlayerSendCancel(cid, "Este pokemon não pode usar Light!")
- end
- end
- -------------------------fim light--------------------------------------
- function doRide(uid, Pname, actionID)
- if getPlayerStorageValue(cid, 18000) == 10 then
- if itemEx.uid == cid and getPlayerStorageValue(cid, 18000) == 10 then
- doChangeSpeed(cid, -(getCreatureSpeed(cid) - getCreatureBaseSpeed(cid)))
- doRemoveCondition(cid, CONDITION_OUTFIT)
- setPlayerStorageValue(cid, 18000, 7)
- setPlayerStorageValue(cid, 25000, 6)
- setPlayerStorageValue(cid,10000,0)
- setPlayerStorageValue(cid,8889,0)
- local monster = doCreateMonster(Pname, getCreaturePosition(cid))
- doConvinceCreature(cid, monster)
- doCreatureAddHealth(monster, -(tonumber(getPokemonMaxLife(Pname) - actionID)))
- doCreatureSay(cid, Pname .. ", I'm tired of riding!", TALKTYPE_SAY)
- return true
- elseif itemEx.uid ~= cid and getPlayerStorageValue(cid, 18000) == 10 then
- return doPlayerSendCancel(cid, "Click em você pra sair do ride!")
- end
- end
- local pokemon = tRide[Pname]
- if itemEx.uid == cid and tRide[Pname] then
- if #getCreatureSummons(cid) < 1 then
- return doPlayerSendCancel(cid, "Precisa de um pokemon pra usar Ride!")
- end
- doChangeSpeed(cid, pokemon[2])
- setPlayerStorageValue(cid, 18000, 10)
- setPlayerStorageValue(cid, 25000, 5)
- doSetCreatureOutfit(cid, {lookType = pokemon[1], lookHead = 0, lookAddons = 0, lookLegs = 0, lookBody = 0, lookFeet = 0}, -1)
- setPlayerStorageValue(cid,10000,pokemon[1])
- setPlayerStorageValue(cid,8889,pokemon[2])
- doItemSetAttribute(getPlayerSlotItem(cid, CONST_SLOT_FEET).uid, "aid", getCreatureHealth(getCreatureSummons(cid)[1]))
- local summons = getCreatureSummons(cid)
- function getPokemonId(summons)
- for _, pid in ipairs(summons) do
- return pid
- end
- end
- doRemoveCreature(getPokemonId(summons))
- doCreatureSay(cid, Pname .. ", Let's go RIDE!", TALKTYPE_SAY)
- end
- end
- ----------------------------------fim ride--------------------------------------------
- function doFly(uid, Pname, actionID)
- if getPlayerStorageValue(cid, 17000) == 10 then
- if getSqmId(getCreaturePosition(cid)).itemid == CONST_FLYVOID then
- return doPlayerSendCancel(cid,"Desça antes de sair do fly")
- end
- if itemEx.uid == cid and getPlayerStorageValue(cid, 17000) == 10 then
- doChangeSpeed(cid, -(getCreatureSpeed(cid) - getCreatureBaseSpeed(cid)))
- doRemoveCondition(cid, CONDITION_OUTFIT)
- setPlayerStorageValue(cid, 17000, 7)
- setPlayerStorageValue(cid, 23000, 6)
- local monster2 = doCreateMonster(Pname, getCreaturePosition(cid))
- doConvinceCreature(cid, monster2)
- doCreatureAddHealth(monster2, -(tonumber(getPokemonMaxLife(Pname) - actionID)))
- doPlayerSay(cid, Pname .. ", I'm tired of flying!", TALKTYPE_SAY)
- setPlayerStorageValue(cid, 9999,-1)
- setPlayerStorageValue(cid, 8888,-1)
- return true
- elseif itemEx.uid ~= cid and getPlayerStorageValue(cid, 17000) == 10 then
- return doPlayerSendCancel(cid, "Click em você pra sair do fly!")
- end
- end
- local pokemon2 = tFly[Pname]
- if itemEx.uid == cid and tFly[Pname] then
- if #getCreatureSummons(cid) < 1 then
- return doPlayerSendCancel(cid, "Precisa de um pokemon pra usar Fly!")
- end
- doChangeSpeed(cid, pokemon2[2])
- setPlayerStorageValue(cid, 17000, 10)
- setPlayerStorageValue(cid, 23000, 5)
- doSetCreatureOutfit(cid, {lookType = pokemon2[1], lookHead = 0, lookAddons = 0, lookLegs = 0, lookBody = 0, lookFeet = 0}, -1)
- setPlayerStorageValue(cid,9999,pokemon2[1])
- setPlayerStorageValue(cid,8888,pokemon2[2])
- doItemSetAttribute(getPlayerSlotItem(cid, CONST_SLOT_FEET).uid, "aid", getCreatureHealth(getCreatureSummons(cid)[1]))
- local summons = getCreatureSummons(cid)
- function getPokemonId(summons)
- for _, pid in ipairs(summons) do
- return pid
- end
- end
- doRemoveCreature(getPokemonId(summons))
- doPlayerSay(cid, Pname .. ", Vamos voar!", TALKTYPE_SAY)
- doPlayerSendTextMessage(cid,27,'Fale \'up\' para subir e \'down\' para descer!.' )
- end
- if fly.using(cid) then
- local p = getCreaturePosition(cid)
- p.stackpos = 0
- local f = getTileThingByPos(p)
- if fly.del(cid) then
- if f.itemid ~= 0 and f.itemid ~= 1 and f.itemid ~= CONST_FLYVOID then
- return true
- else
- setPlayerStorageValue(cid,10941,1)
- local p = getCreaturePosition(cid)
- setPlayerStorageValue(cid, 102011,p.x)
- setPlayerStorageValue(cid, 102012,p.y)
- setPlayerStorageValue(cid, 102013,p.z)
- return true
- end
- else
- doPlayerSendTextMessage(cid,27,'Você não pode voar neste local.')
- end
- end
- end
- --------------------------------------fim fly-------------------------------------------------
- function doSurf(uid, Pname, actionID)
- local playerpos = getCreaturePosition(cid)
- if isInArray(configs2, itemEx.itemid) and getPlayerStorageValue(cid, 63215) == 10 then
- doTeleportThing(cid, {x=playerpos.x-configs[itemEx.itemid].x, y=playerpos.y-configs[itemEx.itemid].y, z=playerpos.z})
- setPlayerStorageValue(cid, 63215, 0)
- setPlayerStorageValue(cid, 27000, 0)
- doRemoveCondition(cid, CONDITION_OUTFIT)
- local monster = doCreateMonster(Pname, getCreaturePosition(cid))
- doConvinceCreature(cid, monster)
- doCreatureAddHealth(monster, -(tonumber(getPokemonMaxLife(Pname) - actionID)))
- doCreatureSay(cid, "Im tired of surf, "..Pname, TALKTYPE_SAY)
- doChangeSpeed(cid, getCreatureBaseSpeed(cid)-getCreatureSpeed(cid))
- return true
- elseif not isInArray(configs2, itemEx.itemid) and getPlayerStorageValue(cid, 63215) == 10 then
- return doPlayerSendCancel(cid, "Click na borda pra sair do Surf!")
- end
- local pokemon = tSurf[Pname]
- if isInArray(configs2, itemEx.itemid) and tSurf[Pname] then
- if #getCreatureSummons(cid) < 1 then
- return doPlayerSendCancel(cid, "Precisa de um pokemon pra usar Surf!")
- end
- doTeleportThing(cid, {x=playerpos.x+configs[itemEx.itemid].x, y=playerpos.y+configs[itemEx.itemid].y, z=playerpos.z})
- setPlayerStorageValue(cid, 63215, 10)
- setPlayerStorageValue(cid, 27000, 5)
- doSetCreatureOutfit(cid, {lookType = pokemon[1], lookHead = 0, lookAddons = 0, lookLegs = 0, lookBody = 0, lookFeet = 0}, -1)
- setPlayerStorageValue(cid,61209,pokemon[1])
- setPlayerStorageValue(cid,61210,pokemon[2])
- doItemSetAttribute(getPlayerSlotItem(cid, CONST_SLOT_FEET).uid, "aid", getCreatureHealth(getCreatureSummons(cid)[1]))
- local summons = getCreatureSummons(cid)
- function getPokemonId(summons)
- for _, pid in ipairs(summons) do
- return pid
- end
- end
- doRemoveCreature(getPokemonId(summons))
- doCreatureSay(cid, "Let's surf, "..Pname, TALKTYPE_SAY)
- end
- end
- -----------------------------------------fim surf---------------------------------------
- local function doMove(uid, sid, Pname)
- if itemEx.uid ~= cid then
- doCreatureWalkTo(sid, toPosition)
- doCreatureSay(cid, Pname ..", Move!", TALKTYPE_SAY)
- return doCreatureSetNoMove(sid, false)
- end
- end
- ----------------------------------------fim Move-----------------------------------------
- local itemid = itemEx.itemid
- local time = 300
- local actionID = getItemAttribute(getPlayerSlotItem(cid, CONST_SLOT_FEET).uid, "aid")local old_speed = getCreatureBaseSpeed(cid)
- local nome = getItemName(getPlayerSlotItem(cid, CONST_SLOT_FEET).uid)
- local balls = idballs[getPlayerSlotItem(cid,8).itemid]
- local Pname = nome:match('(.-) '..balls[1])
- local sid = getCreatureSummons(cid)[1]
- if rockSmach(cid, 1285, toPosition, Pname, sid) == true then
- return true
- end
- if doCut(cid, 2767, toPosition, Pname, sid) == true then
- return true
- end
- if doDig(cid, tBuracos[itemEx.itemid], toPosition, Pname, sid) == true then
- return true
- end
- if doLight(cid, time, Pname) == true then
- return true
- end
- if doRide(cid, Pname, actionID) == true then
- return true
- end
- if doFly(cid, Pname, actionID) == true then
- return true
- end
- if doSurf(cid, Pname, actionID) == true then
- return true
- end
- if doMove(cid, sid, Pname) == true then
- return true
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment