mano seria melhor vc copia o script da que tem no teu server é so modificar as coisas que vc quer parceiro
- Fórum
- OTServ
- Suporte
- Tópicos Sem Resposta
- [Encerrado] Como Fazer uma Box?
[Encerrado] Como Fazer uma Box?
Por wreymar, 24 de nov. de 2013 em Tópicos Sem Resposta
info
Grupo: Banidos
Registrado: 13/06/13
Posts: 156
Reputação: +30
Char no Tibia: Nunca Tive

Não ajudou
info
Grupo: Cavaleiro
Registrado: 27/09/12
Posts: 160
Reputação: +13
Char no Tibia: Não tenho mais

Passa a seu arquivo box.lua do seu servidor para mim ver e um ID para que seja uma box que vejo oque eu posso fazer =)
Em data/actions/scripts crie um arquivo chamado boxnova.lua e coloque isto dentro:
local a = {[11638] = {level = {5, 10}, balltype = "normal", ballid = 11826,pokemons = {"Slowpoke", "Magnemite", "Doduo", "Seel", "Grimer", "Gastly", "Drowzee", "Voltorb", "Cubone", "Koffing","Goldeen", "Vulpix", "Tentacool", "Bulbasaur", "Charmander", "Squirtle", "Butterfree", "Beedrill", "Metapod", "Kakuna","Raticate", "Spearow", "Ekans", "Abra", "Mankey", "Psyduck", "Pikachu", "Sandshrew", "Nidoran Female","Nidoran Male", "Zubat", "Diglett", "Venonat", "Meowth", "Poliwag", "Growlithe", "Machop", "Ponyta", "Geodude"}},}local extrastrength = 1.1function onUse(cid, item, frompos, item2, topos)local b = a[item.itemid]if not b then return true endlocal pokemon = b.pokemons[math.random(#b.pokemons)]local pokeinfo = getPokemonStatus(pokemon)if not pokeinfo then return true endlocal btype = b.balltypeif not pokeballs[btype] then return true endlocal gender = getRandomGenderByName(pokemon)local level = math.random(b.level[1], b.level[2])local offense = pokeinfo.off * level * extrastrengthlocal defense = pokeinfo.def * level * extrastrengthlocal agility = pokeinfo.agi * level * extrastrengthlocal spatk = pokeinfo.spatk * level * extrastrengthlocal vit = pokeinfo.vit * level * extrastrengthlocal happy = 180local leveltable = getPokemonExperienceTable(pokemon)local ball = 0local sendToDepot = false --alterado v2.6if getCreatureMana(cid) >= 6 or not hasSpaceInContainer(getPlayerSlotItem(cid, 3).uid) thensendToDepot = trueball = doCreateItemEx(b.ballid) --alterado v1.5elseball = item.uidenddoItemSetAttribute(ball, "poke", pokemon)doItemSetAttribute(ball, "hp", 1)doItemSetAttribute(ball, "level", level)doItemSetAttribute(ball, "exp", leveltable[level])doItemSetAttribute(ball, "nextlevelexp", leveltable[level+1] - leveltable[level])doItemSetAttribute(ball, "offense", offense)doItemSetAttribute(ball, "defense", defense)doItemSetAttribute(ball, "speed", agility)doItemSetAttribute(ball, "vitality", vit)doItemSetAttribute(ball, "specialattack", spatk)doItemSetAttribute(ball, "happy", happy)doItemSetAttribute(ball, "gender", gender)if pokemon == "Hitmonchan" or pokemon == "Shiny Hitmonchan" thendoItemSetAttribute(ball, "hands", 0)enddoItemSetAttribute(ball, "description", "Contains a "..pokemon..".")doItemSetAttribute(ball, "fakedesc", "Contains a "..pokemon..".")doPlayerSendTextMessage(cid, 27, "You opened a pokemon prize box +"..item.itemid - (11637).."!")doPlayerSendTextMessage(cid, 27, "The prize pokemon was a "..pokemon.." (level "..level.."), congratulations!")if sendToDepot then --alterado v1.5doPlayerSendMailByName(getCreatureName(cid), ball, 1)doPlayerSendTextMessage(cid, 27, "You are already holding six pokemons, so your new pokemon was sent to your depot.")doRemoveItem(item.uid)elsedoTransformItem(ball, pokeballs[btype].on)enddoSendMagicEffect(getThingPos(cid), 29)return trueend
Vermelho - Pokemons que podem vir na box.
Azul - Level mínimo que o pokemon pode vir.
Verde - Level máximo que o pokemon pode vir.
Roxo - Nome da ball que o pokemon virá.
Cinza - ID dá ball quando tem um pokemon vivo. (Para pegar o ID dela, crie um pokemon ou capture, de look na ball, e veja lá o ID)
Rosa - ID da box.
Após em data/actions/actions.xml adicione está tag:
<action itemid="11638" event="script" value="boxnova.lua"/>
Laranja = ID da box. (Mesmo ID que a cor Rosa no script anterior)
Marrom = Nome do script da box que você colocou na pasta script.
PS: Este é para server que os pokemons têm level, caso o seu seja sem me avise que eu edito! uashuashuas'
Editado Novembro 25 por GuhPk
info
Grupo: Banidos
Registrado: 13/06/13
Posts: 156
Reputação: +30
Char no Tibia: Nunca Tive

Em data/actions/scripts crie um arquivo chamado boxnova.lua e coloque isto dentro:
local a = {[11638] = {level = {5, 10}, balltype = "normal", ballid = 11826,pokemons = {"Slowpoke", "Magnemite", "Doduo", "Seel", "Grimer", "Gastly", "Drowzee", "Voltorb", "Cubone", "Koffing","Goldeen", "Vulpix", "Tentacool", "Bulbasaur", "Charmander", "Squirtle", "Butterfree", "Beedrill", "Metapod", "Kakuna","Raticate", "Spearow", "Ekans", "Abra", "Mankey", "Psyduck", "Pikachu", "Sandshrew", "Nidoran Female","Nidoran Male", "Zubat", "Diglett", "Venonat", "Meowth", "Poliwag", "Growlithe", "Machop", "Ponyta", "Geodude"}},}local extrastrength = 1.1function onUse(cid, item, frompos, item2, topos)local b = a[item.itemid]if not b then return true endlocal pokemon = b.pokemons[math.random(#b.pokemons)]local pokeinfo = getPokemonStatus(pokemon)if not pokeinfo then return true endlocal btype = b.balltypeif not pokeballs[btype] then return true endlocal gender = getRandomGenderByName(pokemon)local level = math.random(b.level[1], b.level[2])local offense = pokeinfo.off * level * extrastrengthlocal defense = pokeinfo.def * level * extrastrengthlocal agility = pokeinfo.agi * level * extrastrengthlocal spatk = pokeinfo.spatk * level * extrastrengthlocal vit = pokeinfo.vit * level * extrastrengthlocal happy = 180local leveltable = getPokemonExperienceTable(pokemon)local ball = 0local sendToDepot = false --alterado v2.6if getCreatureMana(cid) >= 6 or not hasSpaceInContainer(getPlayerSlotItem(cid, 3).uid) thensendToDepot = trueball = doCreateItemEx(b.ballid) --alterado v1.5elseball = item.uidenddoItemSetAttribute(ball, "poke", pokemon)doItemSetAttribute(ball, "hp", 1)doItemSetAttribute(ball, "level", level)doItemSetAttribute(ball, "exp", leveltable[level])doItemSetAttribute(ball, "nextlevelexp", leveltable[level+1] - leveltable[level])doItemSetAttribute(ball, "offense", offense)doItemSetAttribute(ball, "defense", defense)doItemSetAttribute(ball, "speed", agility)doItemSetAttribute(ball, "vitality", vit)doItemSetAttribute(ball, "specialattack", spatk)doItemSetAttribute(ball, "happy", happy)doItemSetAttribute(ball, "gender", gender)if pokemon == "Hitmonchan" or pokemon == "Shiny Hitmonchan" thendoItemSetAttribute(ball, "hands", 0)enddoItemSetAttribute(ball, "description", "Contains a "..pokemon..".")doItemSetAttribute(ball, "fakedesc", "Contains a "..pokemon..".")doPlayerSendTextMessage(cid, 27, "You opened a pokemon prize box +"..item.itemid - (11637).."!")doPlayerSendTextMessage(cid, 27, "The prize pokemon was a "..pokemon.." (level "..level.."), congratulations!")if sendToDepot then --alterado v1.5doPlayerSendMailByName(getCreatureName(cid), ball, 1)doPlayerSendTextMessage(cid, 27, "You are already holding six pokemons, so your new pokemon was sent to your depot.")doRemoveItem(item.uid)elsedoTransformItem(ball, pokeballs[btype].on)enddoSendMagicEffect(getThingPos(cid), 29)return trueendVermelho - Pokemons que podem vir na box.
Azul - Level mínimo que o pokemon pode vir.
Verde - Level máximo que o pokemon pode vir.
Roxo - Nome da ball que o pokemon virá.
Cinza - ID dá ball quando tem um pokemon vivo. (Para pegar o ID dela, crie um pokemon ou capture, de look na ball, e veja lá o ID)
Rosa - ID da box.
Após em data/actions/actions.xml adicione está tag:
<action itemid="11638" event="script" value="boxnova.lua"/>
Laranja = ID da box. (Mesmo ID que a cor Rosa no script anterior)
Marrom = Nome do script da box que você colocou na pasta script.
PS: Este é para server que os pokemons têm level, caso o seu seja sem me avise que eu edito! uashuashuas'
Guhpk Assim meu server é base o server do Bolz tem uma boz sombrando ai queria adicionar nela ajudar ae base sem level
Se puder me mandar o ID dela no OtItemEditor e os pokemons que você quer nela eu posso fazer pra você...
Porém, se não tiver ela no OtItemEditor, você terá que adicionar, aqui no fórum mesmo tem vários tutoriais de como configurar itens no Items.otb.
Obs: No OtItemEditor a única caixinha que tem que estar marcada é a "Pickable".
Obs²: No Dat Editor tem que estar também só a caixinha "Pickable".
info
Grupo: Marquês
Registrado: 16/06/07
Posts: 1.2k
Reputação: +377
Gênero: Masculino
Char no Tibia: Nenhum

Tópico na seção errada, favor prestar mais atenção da próxima vez.
Movido para pedidos e dúvidas - servidores derivados.
info
Grupo: Banidos
Registrado: 13/06/13
Posts: 156
Reputação: +30
Char no Tibia: Nunca Tive

Se puder me mandar o ID dela no OtItemEditor e os pokemons que você quer nela eu posso fazer pra você...
Porém, se não tiver ela no OtItemEditor, você terá que adicionar, aqui no fórum mesmo tem vários tutoriais de como configurar itens no Items.otb.
Obs: No OtItemEditor a única caixinha que tem que estar marcada é a "Pickable".
Obs²: No Dat Editor tem que estar também só a caixinha "Pickable".
GuhPk o Id Dela >>> 13078 os pokemons que quero >>>> Moltres,articuno,zapdos,entei,raikou,suicune,mew,mewtwo,lugia,ho-oh,celebi,ancient blastoise
Em data/actions/scripts/boxnova.lua coloque:
local a = {
[11638] = {level = {5, 10}, balltype = "normal", ballid = 11826,
pokemons = {"Moltres", "Articuno", "Zapdos", "Entei", "Raikou", "Mew", "Mewtwo", "Lugia", "Ho-oh", "Celebi",
"Ancient Blastoise"}},
}
local extrastrength = 1.1
function onUse(cid, item, frompos, item2, topos)
local b = a[item.itemid]
if not b then return true end
local pokemon = b.pokemons[math.random(#b.pokemons)]
local pokeinfo = getPokemonStatus(pokemon)
if not pokeinfo then return true end
local btype = b.balltype
if not pokeballs[btype] then return true end
local gender = getRandomGenderByName(pokemon)
local level = math.random(b.level[1], b.level[2])
local offense = pokeinfo.off * level * extrastrength
local defense = pokeinfo.def * level * extrastrength
local agility = pokeinfo.agi * level * extrastrength
local spatk = pokeinfo.spatk * level * extrastrength
local vit = pokeinfo.vit * level * extrastrength
local happy = 180
local leveltable = getPokemonExperienceTable(pokemon)
local ball = 0
local sendToDepot = false --alterado v2.6
if getCreatureMana(cid) >= 6 or not hasSpaceInContainer(getPlayerSlotItem(cid, 3).uid) then
sendToDepot = true
ball = doCreateItemEx(b.ballid) --alterado v1.5
else
ball = item.uid
end
doItemSetAttribute(ball, "poke", pokemon)
doItemSetAttribute(ball, "hp", 1)
doItemSetAttribute(ball, "level", level)
doItemSetAttribute(ball, "exp", leveltable[level])
doItemSetAttribute(ball, "nextlevelexp", leveltable[level+1] - leveltable[level])
doItemSetAttribute(ball, "offense", offense)
doItemSetAttribute(ball, "defense", defense)
doItemSetAttribute(ball, "speed", agility)
doItemSetAttribute(ball, "vitality", vit)
doItemSetAttribute(ball, "specialattack", spatk)
doItemSetAttribute(ball, "happy", happy)
doItemSetAttribute(ball, "gender", gender)
doItemSetAttribute(ball, "description", "Contains a "..pokemon..".")
doItemSetAttribute(ball, "fakedesc", "Contains a "..pokemon..".")
doPlayerSendTextMessage(cid, 27, "You opened a pokemon prize box +"..item.itemid - (11637).."!")
doPlayerSendTextMessage(cid, 27, "The prize pokemon was a "..pokemon.." (level "..level.."), congratulations!")
if sendToDepot then --alterado v1.5
doPlayerSendMailByName(getCreatureName(cid), ball, 1)
doPlayerSendTextMessage(cid, 27, "You are already holding six pokemons, so your new pokemon was sent to your depot.")
doRemoveItem(item.uid)
else
doTransformItem(ball, pokeballs[btype].on)
end
doSendMagicEffect(getThingPos(cid), 29)
return true
end
Em data/actions/actions.xml coloque:
<action itemid="13078" event="script" value="boxnova.lua"/>
Se o pda by bolz for sem lv nos pokémons, tenta assim: (primeiramente, veja se seu servidor possue a função addPokeToPlayer)
local box = {balltype = "normal", ballid = 11826, pokemons = {"Moltres", "Articuno", "Zapdos", "Entei", "Raikou", "Mew", "Mewtwo", "Lugia", "Ho-oh", "Celebi",
"Ancient Blastoise"}}
local happy = 220
function onUse(cid, item, frompos, item2, topos)
local pokemon = box.pokemons[math.random(#box.pokemons)]
local btype = box.balltype
doPlayerSendTextMessage(cid, 27, "Você abriu uma PokeBox e recebeu um "..pokemon..".")
doSendMagicEffect(getThingPos(cid), 29)
addPokeToPlayer(cid, pokemon, 0, nil, btype)
doRemoveItem(item.uid, 1)
return true
end
Editado Novembro 25 por zipter98
info
Grupo: Banidos
Registrado: 13/06/13
Posts: 156
Reputação: +30
Char no Tibia: Nunca Tive

Desculpa ae vcs ajudaram de mais quando meu rep+ voltar do para vc Guhpk Vlw manin Topico resolvido
Em data/actions/scripts/boxnova.lua coloque:
local a = { [11638] = {level = {5, 10}, balltype = "normal", ballid = 11826, pokemons = {"Moltres", "Articuno", "Zapdos", "Entei", "Raikou", "Mew", "Mewtwo", "Lugia", "Ho-oh", "Celebi", "Ancient Blastoise"}}, } local extrastrength = 1.1 function onUse(cid, item, frompos, item2, topos) local b = a[item.itemid] if not b then return true end local pokemon = b.pokemons[math.random(#b.pokemons)] local pokeinfo = getPokemonStatus(pokemon) if not pokeinfo then return true end local btype = b.balltype if not pokeballs[btype] then return true end local gender = getRandomGenderByName(pokemon) local level = math.random(b.level[1], b.level[2]) local offense = pokeinfo.off * level * extrastrength local defense = pokeinfo.def * level * extrastrength local agility = pokeinfo.agi * level * extrastrength local spatk = pokeinfo.spatk * level * extrastrength local vit = pokeinfo.vit * level * extrastrength local happy = 180 local leveltable = getPokemonExperienceTable(pokemon) local ball = 0 local sendToDepot = false --alterado v2.6 if getCreatureMana(cid) >= 6 or not hasSpaceInContainer(getPlayerSlotItem(cid, 3).uid) then sendToDepot = true ball = doCreateItemEx(b.ballid) --alterado v1.5 else ball = item.uid end doItemSetAttribute(ball, "poke", pokemon) doItemSetAttribute(ball, "hp", 1) doItemSetAttribute(ball, "level", level) doItemSetAttribute(ball, "exp", leveltable[level]) doItemSetAttribute(ball, "nextlevelexp", leveltable[level+1] - leveltable[level]) doItemSetAttribute(ball, "offense", offense) doItemSetAttribute(ball, "defense", defense) doItemSetAttribute(ball, "speed", agility) doItemSetAttribute(ball, "vitality", vit) doItemSetAttribute(ball, "specialattack", spatk) doItemSetAttribute(ball, "happy", happy) doItemSetAttribute(ball, "gender", gender) doItemSetAttribute(ball, "description", "Contains a "..pokemon..".") doItemSetAttribute(ball, "fakedesc", "Contains a "..pokemon..".") doPlayerSendTextMessage(cid, 27, "You opened a pokemon prize box +"..item.itemid - (11637).."!") doPlayerSendTextMessage(cid, 27, "The prize pokemon was a "..pokemon.." (level "..level.."), congratulations!") if sendToDepot then --alterado v1.5 doPlayerSendMailByName(getCreatureName(cid), ball, 1) doPlayerSendTextMessage(cid, 27, "You are already holding six pokemons, so your new pokemon was sent to your depot.") doRemoveItem(item.uid) else doTransformItem(ball, pokeballs[btype].on) end doSendMagicEffect(getThingPos(cid), 29) return true endEm data/actions/actions.xml coloque:
<action itemid="13078" event="script" value="boxnova.lua"/>
GuhPk Outra duvida ali Onde ta la em cima
local a = {
[11638] = {level = {5, 10}, balltype = "normal", ballid = 11826,
pokemons = {"Moltres", "Articuno", "Zapdos", "Entei", "Raikou", "Mew", "Mewtwo", "Lugia", "Ho-oh", "Celebi",
"Ancient Blastoise"}},
onde ta aquele numero verde não era para ta o id da box não?
Editado Novembro 25 por wreymar
Opa, desculpa o meu erro! >.<
É sim! suahasuhasus'
info
Grupo: Banidos
Registrado: 13/06/13
Posts: 156
Reputação: +30
Char no Tibia: Nunca Tive

Mas eu fiz isso mas quando eu fasso ela que aperto com o botão direito do mouse não vai pq?
Seu servidor é sem lv nos pokémons? Tentou o meu?
obs: não se esqueça de verificar se no seu servidor têm a função addPokeToPlayer (ela se encontra em data/lib/some functions.lua).
Editado Novembro 25 por zipter98








info
Grupo: Banidos
Registrado: 13/06/13
Posts: 156
Reputação: +30
Char no Tibia: Nunca Tive
Pessoal Tou aqui de Novo com Mas Duvida Queria fazer uma box apara meu server de Pokemon BASE PDA
queria que alguem aew Mim ajudasse mim dizendo ou fazendor tutorial para mim adiconar um Box no meu Server de Pokemon