local starterpokes = {
["Entei"] = {x = 390, y = 1022, z = 7},
["Raikou"] = {x = 392, y = 1022, z = 7},
["Suicune"] = {x = 394, y = 1022, z = 7},
}
local btype = "normal"
local storage = 1015 -- storage
function onUse(cid, item, frompos, item2, topos)
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, storage) <= 0 then
addPokeToPlayer(cid, pokemon, level, extrastr, nil, 0, btype, true) --alterado v2.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!")
doSendMagicEffect(getThingPos(cid), 29)
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
doSendMagicEffect(getThingPos(cid), 27)
doSendMagicEffect(getThingPos(cid), 29)
setPlayerStorageValue(cid, storage, 1)
else
doPlayerSendCancel(cid, "Você já fez essa quest!")
end
return TRUE
end







info
Grupo: Campones
Registrado: 29/12/13
Posts: 86
Reputação: +17
Char no Tibia: [ADM] Wolf
Olá Galera, Estou com uma dúvida aki.
Criei uma quest q pode ganhar tres pokemons. Como base do script, usei o starter.lua.
A quest funcionou, mas n tem storage e entao os players podem fazê-las quantas veses quiser...
Entao, alguem experiente poderia me ajudar pf.
Abaixo o Script!
local starterpokes = {
["Entei"] = {x = 390, y = 1022, z = 7},
["Raikou"] = {x = 392, y = 1022, z = 7},
["Suicune"] = {x = 394, y = 1022, z = 7},
}
local btype = "normal"
function onUse(cid, item, frompos, item2, topos)
local pokemon = ""
for a, b in pairs (starterpokes) do
if isPosEqualPos(topos, b) then
pokemon = a
end
end
if pokemon == "" then return true end
addPokeToPlayer(cid, pokemon, level, extrastr, nil, 0, btype, true) --alterado v2.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!")
doSendMagicEffect(getThingPos(cid), 29)
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
doSendMagicEffect(getThingPos(cid), 27)
doSendMagicEffect(getThingPos(cid), 29)
return TRUE
end
é isso se alguem poder me ajudar fico grato!
SÓ QUERO SABER ONDE E COMO COLOCAR A STORAGE NESSE SCRIPT!