Ta,mais como Slicer disse qual é sua duvida?
mano oq exatamente tu ta tentando fazer? eh os baus dos pokes iniciais ms? ou um ball pra uma quest qlqr?
Tem que ser mais direto para te ajudarmos.
By josegremista, 27 de out. de 2012 in Tópicos Sem Resposta
info
Group: Lorde
Joined: 05/06/12
Posts: 2.2k
Reputation: +215
Gender: Masculino

info
Group: Visconde
Joined: 10/09/12
Posts: 476
Reputation: +2
Tibia Character: Esqueci

PAra quets :Pokecial.lua olhe o que tem dentro dele tudo que tem dentro dele foi o @Ghupk
-- Pokes iniciais ---
local starterpokes = {
["Mewtwo"] = {x = 1077, y = 1072, z = 7},
["Caterpie"] = {x = 1070, y = 1070, z = 7},
["Gengar"] = {x = 1073, y = 1070, z = 7}, -- x, y, x é a posição do BAU
}
local btype = "normal" -- pokeball normal
function onUse(cid, item, frompos, item2, topos)
if getPlayerLevel(cid) > 5 then -- o player precisa ser level MAIOR que 5 pra pegar
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
local gender = getRandomGenderByName(pokemon)
local happy = 250
local item = doCreateItemEx(2219)
doItemSetAttribute(item, "poke", pokemon)
doItemSetAttribute(item, "hp", 1)
doItemSetAttribute(item, "happy", happy)
doItemSetAttribute(item, "gender", gender)
doItemSetAttribute(item, "description", "Contains a "..pokemon..".")
doItemSetAttribute(item, "fakedesc", "Contains a "..pokemon..".")
doItemSetAttribute(item, "unique", getCreatureName(cid)) -- Faz seu pokemon FICAR UNIQUE ( NAO D APRA JOGAR FORA OU TROCAR COM ALGUEM )
doPlayerAddItemEx(cid, item, true)
doTransformItem(item, pokeballs[btype].on)
doPlayerSendTextMessage(cid, 27, "Você acabou de ganhar um "..pokemon..")
return TRUE
end
Agora o que eu coloquei em actions.xml
-- BOXES (Quets)
<action itemid="1740" event="script" value="Pokecial.lua"/>
info
Group: Lorde
Joined: 05/06/12
Posts: 2.2k
Reputation: +215
Gender: Masculino

Acho q ja vi o problema, ele copio o starte.lua e n mudou a tag .xml ou seja deve tar com nome Starte.lua que vc tinha mostrado acima, veja se n é isso.
info
Group: Visconde
Joined: 10/09/12
Posts: 476
Reputation: +2
Tibia Character: Esqueci

Como ta o actions.xml
-- BOXES (poke inicial)
<action itemid="1740" event="script" value="Starter.lua"/>
-- BOXES (Quets)
<action itemid="1740" event="script" value="Pokecial.lua"/>
-- POKEMON PRIZE BOXES / RARE CANDY
<action itemid="11638-11641" event="script" value="box.lua"/>
<action itemid="6569" event="script" value="rarecandy.lua" allowfaruse="1"/>
Ah e eu não copiei o Starter o @Cleberadm que fez se vc for lá emcima no do topico se vai ver
Olhemo oe error que acabou de aparecer quando fui abrir o server :
[28/10/2012 19:09:21] [Error - LuaScriptInterface::loadFile] data/actions/scripts/Pokecial.lua:44: unfinished string near '")'
[28/10/2012 19:09:21] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/Pokecial.lua)
[28/10/2012 19:09:21] data/actions/scripts/Pokecial.lua:44: unfinished string near '")'
info
Group: Conde
Joined: 25/04/12
Posts: 752
Reputation: +125
Gender: Masculino

Postado: Hoje, 19:43
PAra quets :Pokecial.lua olhe o que tem dentro dele tudo que tem dentro dele foi o @Ghupk
Sei nao..
TROCA O ID DO BAU ( PEGA OUTRO CHEST.... ) ou coloca as posição e os pokes no starter...
E PORQUE VOCE TIRO AS ASPAS? ESSE É O ERRO MANO, VOCE TIRO AS ASPAS ¬¬
USA ESSE
-- Pokes iniciais ---
local starterpokes = {
["Mewtwo"] = {x = 1077, y = 1072, z = 7},
["Caterpie"] = {x = 1070, y = 1070, z = 7},
["Gengar"] = {x = 1073, y = 1070, z = 7}, -- x, y, x é a posição do BAU
}
local btype = "normal" -- pokeball normal
function onUse(cid, item, frompos, item2, topos)
if getPlayerLevel(cid) > 5 then -- o player precisa ser level MAIOR que 5 pra pegar
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
local gender = getRandomGenderByName(pokemon)
local happy = 250
local item = doCreateItemEx(2219)
doItemSetAttribute(item, "poke", pokemon)
doItemSetAttribute(item, "hp", 1)
doItemSetAttribute(item, "happy", happy)
doItemSetAttribute(item, "gender", gender)
doItemSetAttribute(item, "description", "Contains a "..pokemon..".")
doItemSetAttribute(item, "fakedesc", "Contains a "..pokemon..".")
doItemSetAttribute(item, "unique", getCreatureName(cid)) -- Faz seu pokemon FICAR UNIQUE ( NAO D APRA JOGAR FORA OU TROCAR COM ALGUEM )
doPlayerAddItemEx(cid, item, true)
doTransformItem(item, pokeballs[btype].on)
doPlayerSendTextMessage(cid, 27, "Você acabou de ganhar um "..pokemon.."")
return TRUE
end
Edited Outubro 28 by Cleberadm
info
Group: Visconde
Joined: 10/09/12
Posts: 476
Reputation: +2
Tibia Character: Esqueci

Cara eu tirei as Aspas porque o lek disse que Akele que era o error porque tinha 2 aspas e era para eu apagar 1
info
Group: Conde
Joined: 25/04/12
Posts: 752
Reputation: +125
Gender: Masculino

Cara 1 aspa era pra fecha o texto e a outra era pra fecha o ..pokemon.. ¬¬¬¬
info
Group: Visconde
Joined: 10/09/12
Posts: 476
Reputation: +2
Tibia Character: Esqueci

Ah Cara quando eu for colocar o bau pelo remere's em Actions e utide sla eu tenho que colocar algum numero ou deixar como tá tudo 0
info
Group: Conde
Joined: 25/04/12
Posts: 752
Reputation: +125
Gender: Masculino

Tenta colocar uniqueID 1005
info
Group: Visconde
Joined: 10/09/12
Posts: 476
Reputation: +2
Tibia Character: Esqueci

actions coloco o que ? 0
info
Group: Conde
Joined: 25/04/12
Posts: 752
Reputation: +125
Gender: Masculino

Sim mano, coloca 0, actionid você coloca só se faze o script por action g,g
info
Group: Visconde
Joined: 10/09/12
Posts: 476
Reputation: +2
Tibia Character: Esqueci

Cara já estou ficando doido não estou conseguindo nem a pau.
Pokecial.lua:
-- Pokes iniciais ---
local starterpokes = {
["Mewtwo"] = {x = 1074, y = 1071, z = 7},
["Caterpie"] = {x = 1070, y = 1071, z = 7},
["Gengar"] = {x = 1072, y = 1071, z = 7}, -- x, y, x é a posição do BAU
}
local btype = "normal" -- pokeball normal
function onUse(cid, item, frompos, item2, topos)
if getPlayerLevel(cid) > 5 then -- o player precisa ser level MAIOR que 5 pra pegar
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
local gender = getRandomGenderByName(pokemon)
local happy = 250
local item = doCreateItemEx(2219)
doItemSetAttribute(item, "poke", pokemon)
doItemSetAttribute(item, "hp", 1)
doItemSetAttribute(item, "happy", happy)
doItemSetAttribute(item, "gender", gender)
doItemSetAttribute(item, "description", "Contains a "..pokemon..".")
doItemSetAttribute(item, "fakedesc", "Contains a "..pokemon..".")
doItemSetAttribute(item, "unique", getCreatureName(cid)) -- Faz seu pokemon FICAR UNIQUE ( NAO D APRA JOGAR FORA OU TROCAR COM ALGUEM )
doPlayerAddItemEx(cid, item, true)
doTransformItem(item, pokeballs[btype].on)
doPlayerSendTextMessage(cid, 27, "Você acabou de ganhar um "..pokemon.."")
return TRUE
end
Actions.Xml
-- BOXES (Quets)
<action itemid="1740" event="script" value="Pokecial.lua"/>
Imagem de eu clikando nos Baús :
Cara o id do bau eu coloco qual ? No remere's amostra 1 e no Intem.XML mostra outro qual eu coloco ?
info
Group: Conde
Joined: 25/04/12
Posts: 752
Reputation: +125
Gender: Masculino

Faz assim... sabe o starter.LUA?
coloca isso la junto com os outros pokes...
["Mewtwo"] = {x = 1074, y = 1071, z = 7},
["Caterpie"] = {x = 1070, y = 1071, z = 7},
["Gengar"] = {x = 1072, y = 1071, z = 7},
PRONTO.. ai voce EXCLUI essa tag do ACTIOB.XML
<action itemid="1740" event="script" value="Pokecial.lua"/>
E só deixa a tag do starter.XML...
Depois no RME voce coloca o UNIQUEID no bau..
Se voce for usar mais que 1 bau vc adiciona 1 a mais nos outros baus
Ex:
1° bau = UniqueID 1005
2° bau voce coloca 1006
e continua assim...
Edited Outubro 28 by Cleberadm
info
Group: Visconde
Joined: 10/09/12
Posts: 476
Reputation: +2
Tibia Character: Esqueci

Cara foi exatamente que eu fiz nakeles 3 baus 1 eu coloquei 1005 ou 1006 e outro 1007. e Actions 0 e united esse ai cara e olha que eu fui en actions.xml e olheu se nenhum desse id ae tinha lá e não tinham
info
Group: Visconde
Joined: 10/09/12
Posts: 476
Reputation: +2
Tibia Character: Esqueci
Olhe :