Ir para conteúdo
  • 0

Tile Que Dá Pokémon


FlamesAdmin

Pergunta

Peço ajuda a vocês com esse script movement.

O script é como se fosse o starter.lua por action, pois esse o player passa no tile e ganha tal Pokémon.

Se o player não tiver falado com Npc antes, aparecerá essa mensagem com a storage

if getPlayerStorageValue(cid, 9658754) ~= 1 then              
      sendMsgToPlayer(cid, 27, "Talk to Prof. Robert for choose your city first!")
       return true
    end      

Rep+ pela ajuda.

Link para o comentário
Compartilhar em outros sites

7 respostass a esta questão

Posts Recomendados

  • 0

 

local p = {
    --[actionid] = "pokemon_name",
    --Ex.:
    [9282] = "Charmander",
    --etc,
}
function onStepIn(cid, item, position, fromPosition)
    local poke = p[item.actionid]
    if poke then
        if not isPlayer(cid) then
            return true
        elseif getPlayerStorageValue(cid, 9658754) ~= 1 then              
            return sendMsgToPlayer(cid, 27, "Talk to Prof. Robert for choose your city first!") and doTeleportThing(cid, fromPosition)
        elseif getPlayerStorageValue(cid, 49191) > -1 then
            return doPlayerSendCancel(cid, "You already got your pokemon.") and doTeleportThing(cid, fromPosition)
        end      
        doPlayerSendTextMessage(cid, 27, "You got your first pokemon! You also received some pokeballs to help you in your way.")
        doPlayerSendTextMessage(cid, 27, "Don't forget to use your pokedex on every undiscovered pokemon!")
        addPokeToPlayer(cid, poke, 0, nil, "normal", true)
        doPlayerAddItem(cid, 2394, 10)
        doSendMagicEffect(getThingPos(cid), 29)
        doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
        doSendMagicEffect(getThingPos(cid), 27)
        doSendMagicEffect(getThingPos(cid), 29)
        setPlayerStorageValue(cid, 49191, 1)
    end
    return true
end
Link para o comentário
Compartilhar em outros sites

  • 0


 

local starterpokes = {

["Weedle"] = {x = 53, y = 70, z = 7},

["Rattata"] = {x = 51, y = 70, z = 7},

["Caterpie"] = {x = 49, y = 70, z = 7},

["Bellsprout"] = {x = 43, y = 70, z = 7},

["Oddish"] = {x = 45, y = 70, z = 7},

["Sunkern"] = {x = 47, y = 70, z = 7},

["Pidgey"] = {x = 55, y = 70, z = 7},

}

 

 

local btype = "normal"

 

 

function onStepIn(cid, item, position, fromPosition)

 

 

if getPlayerLevel(cid) > 5 then

return true

end

 

 

local pokemon = ""

 

 

for a, b in pairs (starterpokes) do

if isPosEqualPos(topos, b) then

pokemon = a

end

end

if pokemon == "" then return true end

 

 

if getPlayerStorageValue(cid, 9658754) ~= 1 then

sendMsgToPlayer(cid, 27, "Talk to the Prof. Robert to choose your beginner city first!")

return true

end --alterado v1.9 \/

 

 

doPlayerSendTextMessage(cid, 27, "You got your first pokemon! You also received some pokeballs to help you in your way.")

doPlayerSendTextMessage(cid, 27, "Don't forget to use your pokedex on every undiscovered pokemon!")

 

 

addPokeToPlayer(cid, pokemon, 0, nil, btype, true)

doPlayerAddItem(cid, 2394, 10)

 

 

doSendMagicEffect(getThingPos(cid), 29)

doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))

doSendMagicEffect(getThingPos(cid), 27)

doSendMagicEffect(getThingPos(cid), 29)

 

 

 

 

return TRUE

end

 

function onStepOut(cid, item, position, fromPosition)

return false

end

 

Link para o comentário
Compartilhar em outros sites

  • 0

Quando eu coloco StepOut na tag do movements.xml, nada acontece, quando eu coloco StepIn da esse erro:


[14/06/2015 18:20:15] [Error - MoveEvents Interface] 
[14/06/2015 18:20:15] data/movements/scripts/Inicial.lua:onStepIn
[14/06/2015 18:20:15] Description: 
[14/06/2015 18:20:15] data/lib/some functions.lua:1224: attempt to index local 'pos1' (a nil value)
[14/06/2015 18:20:15] stack traceback:
[14/06/2015 18:20:15] 	data/lib/some functions.lua:1224: in function 'isPosEqualPos'
[14/06/2015 18:20:15] 	data/movements/scripts/Inicial.lua:26: in function <data/movements/scripts/Inicial.lua:14>

Poderia postar sua tag do movements.xml?

Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...