SA
action

Só entra se estiver sem balls, Action para portal

Por samlecter, 28 de jan. de 2016 em Scripts

doggy style
help
pokeaction
script
suporte
sem balls
anal giratorio
pokemon
portal
8
1.2k
samlecterS
28 de janeiro de 2016 às 15:10

Olá, preciso de uma Action para por em 1 portal, quando o player tentar entrar no portal, só conseguirá caso ele não tenha nenhuma ball na bag, caso ele tenha balls, aparece uma mensagem somente para ele, dizendo que só pode entrar sem ball.

 

Caso não saibam os ids das balls, não tem problema, faz com qualquer id que eu edito e coloco os ids da ball, é só pegar os ids no npc do saffari ou da main quest

zipter98Z
28 de janeiro de 2016 às 17:27

Moveevent (data/movements/scripts):

local config = {
    toPosition = {x = x, y = y, z = z},                --Para onde o jogador será teleportado.
    pokeball_IDs = {itemid, itemid, itemid, ...}       --IDs das pokeballs.
}

function onStepIn(cid, item, position, fromPosition)
    if not isPlayer(cid) then return true end
    
    for i = 1, #config.pokeball_IDs do
        if getPlayerItemCount(cid, config.pokeball_IDs[i]) > 0 then
            doPlayerSendCancel(cid, "You can't carry any pokeballs with you.")
            doTeleportThing(cid, fromPosition)
            return true
        end
    end
    
    doTeleportThing(cid, config.toPosition)
    return true
end
samlecterS
29 de janeiro de 2016 às 01:17

 

Moveevent (data/movements/scripts):

local config = {
    toPosition = {x = x, y = y, z = z},                --Para onde o jogador será teleportado.
    pokeball_IDs = {itemid, itemid, itemid, ...}       --IDs das pokeballs.
}

function onStepIn(cid, item, position, fromPosition)
    if not isPlayer(cid) then return true end
    
    for i = 1, #config.pokeball_IDs do
        if getPlayerItemCount(cid, config.pokeball_IDs[i]) > 0 then
            doPlayerSendCancel(cid, "You can't carry any pokeballs with you.")
            doTeleportThing(cid, fromPosition)
            return true
        end
    end
    
    doTeleportThing(cid, config.toPosition)
    return true
end

 

Tem como adaptar para além da checagem das balls, fazer outra checagem e impedir que entre no portal com alguns pokemons? isso serviria pra evitar que entre em algumas quests com pokemons que ficam ivuneraveis como steelix, muk etc...

 

zipter98Z
29 de janeiro de 2016 às 01:22

É possível, mas antes eu preciso saber qual a base que você está usando.

samlecterS
29 de janeiro de 2016 às 13:52

É possível, mas antes eu preciso saber qual a base que você está usando.

Pda, base cyan 8.54 , acho q seria algo como:

if isInArray({"Shiny Metagross", "Bronzong", "Steelix", "Muk", "Shiny Shiny Onix", "Xatu",
 "Slowking", "Shiny Xatu",}, getSubName(cid, target)) then

Dai não sei o que colocar para "falhar" ou seja ele não entrar no portal, seria return false ? não manjo de script só faço o basico do basico com uns if elseif then...

Editado Janeiro 29 por samlecter

zipter98Z
29 de janeiro de 2016 às 20:33


local config = {

toPosition = {x = x, y = y, z = z}, --Para onde o jogador será teleportado.

pokeball_IDs = {itemid, itemid, itemid, ...}, --IDs das pokeballs.

blocked_poke = {"Steelix", "Muk", "Xatu", ...} --Pokémons bloqueados na quest.

}

 

function onStepIn(cid, item, position, fromPosition)

if not isPlayer(cid) then return true end

 

for i = 1, #config.pokeball_IDs do

if getPlayerItemCount(cid, config.pokeball_IDs) > 0 then

doPlayerSendCancel(cid, "You can't carry any pokeballs with you.")

doTeleportThing(cid, fromPosition)

return true

end

end

 

local player_pokeballs = getPokeballsInContainer(getPlayerSlotItem(cid, 3).uid)

 

if isInArray(config.blocked_poke, getItemAttribute(getPlayerSlotItem(cid, 8).uid, "poke")) then

doPlayerSendCancel(cid, "You have a blocked pokemon for this quest in your team.")

doTeleportThing(cid, fromPosition)

return true

end

if #player_pokeballs > 0 then

for i = 1, #player_pokeballs do

local poke = getItemAttribute(player_pokeballs, "poke")

 

if isInArray(config.blocked_poke, poke) then

doPlayerSendCancel(cid, "You have a blocked pokemon for this quest in your team.")

doTeleportThing(cid, fromPosition)

return true

end

end

end

 

doTeleportThing(cid, config.toPosition)

return true

end

 

samlecterS
29 de janeiro de 2016 às 23:35

@@zipter98

 

Como ficaria a tag ?

zipter98Z
30 de janeiro de 2016 às 05:14


<movevent type="StepIn" actionid="xxx" event="script" value="nome_do_arquivo.lua"/>