Ir para conteúdo
  • Cadastre-se

Posts Recomendados

Galera essa é uma script de uma quest quero saber como faço para alterar o valor da quantia que o player vai receber.

 

Nessa script tem 3 quest o que eu quero mudar é do item 884 e deixar que os player façam essa quest quando quiserem.Pra que ele consigam abrir o bau todas as vezes.

 

 

Script:

 

function onUse(cid, item, fromPosition, itemEx, toPosition)

if item.uid > 1000 and item.uid < 13000 then
local itemWeight = getItemWeightById(item.uid, 1)
local playerCap = getPlayerFreeCap(cid)
if getPlayerStorageValue(cid, item.uid) == -1 then
if playerCap >= itemWeight then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have found a ' .. getItemNameById(item.uid) .. '.')
doPlayerAddItem(cid, item.uid ,1)
setPlayerStorageValue(cid, item.uid, 1)
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have found a ' .. getItemNameById(item.uid) .. ' weighing ' .. itemWeight .. ' oz it\'s too heavy.')
end
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "It is empty.")
end
else
return false
end
return true

end                        884884884884

                                                       

 

 

                                                                                           5e1fc80227b414e178a2f7de00379363.jpg.fb527fa5863cba1c20b81b6ea6841da0.jpg                                                                                                  

Link para o post
Compartilhar em outros sites
function onUse(cid, item, fromPosition, itemEx, toPosition)
if item.uid > 1000 and item.uid < 13000 then
local itemWeight = getItemWeightById(item.uid, 1)
local playerCap = getPlayerFreeCap(cid)
if getPlayerStorageValue(cid, item.uid) == -1 then
if playerCap >= itemWeight then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have found a ' .. getItemNameById(item.uid) .. '.')
doPlayerAddItem(cid, item.uid ,1)
setPlayerStorageValue(cid, item.uid, 1)
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have found a ' .. getItemNameById(item.uid) .. ' weighing ' .. itemWeight .. ' oz it\'s too heavy.')
end
else
return false
end
return true
end                        

z_WL63_Tt.png

Link para o post
Compartilhar em outros sites

Continua a mesma quantidade e não da pra pegar mais de uma vez

                                                       

 

 

                                                                                           5e1fc80227b414e178a2f7de00379363.jpg.fb527fa5863cba1c20b81b6ea6841da0.jpg                                                                                                  

Link para o post
Compartilhar em outros sites

Como assim tem 3 quests aí dentro?

 

@Edit:

tenta ae:

local qnt = QUANTIDADE_QUE_VC_QR 

function onUse(cid, item, fromPosition, itemEx, toPosition)

if item.uid > 1000 and item.uid < 13000 then
local itemWeight = getItemWeightById(item.uid, 1)
local playerCap = getPlayerFreeCap(cid)
if playerCap >= itemWeight then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have found a ' .. getItemNameById(item.uid) .. '.')
doPlayerAddItem(cid, item.uid , qnt)
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have found a ' .. getItemNameById(item.uid) .. ' weighing ' .. itemWeight .. ' oz it\'s too heavy.')
end
else
return false
end
return true

end

Obs: não esquece de colocar a quantidade que vc qr q o player ganhe:


local qnt = QUANTIDADE_QUE_VC_QR

Editado por danihcv (veja o histórico de edições)

Te ajudei?? REP + e ficamos quites... <ahttp://www.tibiaking.com/forum/uploads/emoticons/default_happyy.png' alt=';D'>

Atenciosamente,

Daniel.

Abraços!

Link para o post
Compartilhar em outros sites
function onUse(cid, item, fromPosition, itemEx, toPosition)
if item.uid > 1000 and item.uid < 13000 then
local itemWeight = getItemWeightById(item.uid, 1)
local playerCap = getPlayerFreeCap(cid)

if playerCap >= itemWeight then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have found a ' .. getItemNameById(item.uid) .. '.')
doPlayerAddItem(cid, item.uid ,1)
setPlayerStorageValue(cid, item.uid, 1)
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have found a ' .. getItemNameById(item.uid) .. ' weighing ' .. itemWeight .. ' oz it\'s too heavy.')
end
else
return false
end
return true
end   

z_WL63_Tt.png

Link para o post
Compartilhar em outros sites

É porque a tag no XML ta assim:

 

<action itemid="1740;1747-1749" event="script" value="quests.lua"/>

                                                       

 

 

                                                                                           5e1fc80227b414e178a2f7de00379363.jpg.fb527fa5863cba1c20b81b6ea6841da0.jpg                                                                                                  

Link para o post
Compartilhar em outros sites

Tenta lá, o que script que eu coloquei, eu editei o meu ultimo post.

 

@Edit:

 

@Ka zuza, é desnecessário "setar" a storage do player, se o script ñ vai precisar verificar no futuro...

 

setPlayerStorageValue(cid, item.uid, 1)

Editado por danihcv (veja o histórico de edições)

Te ajudei?? REP + e ficamos quites... <ahttp://www.tibiaking.com/forum/uploads/emoticons/default_happyy.png' alt=';D'>

Atenciosamente,

Daniel.

Abraços!

Link para o post
Compartilhar em outros sites
function onUse(cid, item, fromPosition, itemEx, toPosition)
if item.uid > 1000 and item.uid < 13000 then
local itemWeight = getItemWeightById(item.uid, 1)
local playerCap = getPlayerFreeCap(cid)

if playerCap >= itemWeight then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have found a ' .. getItemNameById(item.uid) .. '.')
doPlayerAddItem(cid, item.uid ,1)
setPlayerStorageValue(cid, item.uid, 1)
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have found a ' .. getItemNameById(item.uid) .. ' weighing ' .. itemWeight .. ' oz it\'s too heavy.')
end
else
return false
end
return true
end   

Tá a mesma coisa amigo

                                                       

 

 

                                                                                           5e1fc80227b414e178a2f7de00379363.jpg.fb527fa5863cba1c20b81b6ea6841da0.jpg                                                                                                  

Link para o post
Compartilhar em outros sites

@reglachek, tenta o meu:

local qnt = 1 --QUANTIDADE_QUE_VC_QR 

function onUse(cid, item, fromPosition, itemEx, toPosition)

if item.uid > 1000 and item.uid < 13000 then
local itemWeight = getItemWeightById(item.uid, 1)
local playerCap = getPlayerFreeCap(cid)
if playerCap >= itemWeight then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have found a ' .. getItemNameById(item.uid) .. '.')
doPlayerAddItem(cid, item.uid , qnt)
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have found a ' .. getItemNameById(item.uid) .. ' weighing ' .. itemWeight .. ' oz it\'s too heavy.')
end
else
return false
end
return true

end
Editado por danihcv (veja o histórico de edições)

Te ajudei?? REP + e ficamos quites... <ahttp://www.tibiaking.com/forum/uploads/emoticons/default_happyy.png' alt=';D'>

Atenciosamente,

Daniel.

Abraços!

Link para o post
Compartilhar em outros sites

 

@reglachek, tenta o meu:

local qnt = 1 --QUANTIDADE_QUE_VC_QR 

function onUse(cid, item, fromPosition, itemEx, toPosition)

if item.uid > 1000 and item.uid < 13000 then
local itemWeight = getItemWeightById(item.uid, 1)
local playerCap = getPlayerFreeCap(cid)
if playerCap >= itemWeight then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have found a ' .. getItemNameById(item.uid) .. '.')
doPlayerAddItem(cid, item.uid , qnt)
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have found a ' .. getItemNameById(item.uid) .. ' weighing ' .. itemWeight .. ' oz it\'s too heavy.')
end
else
return false
end
return true

end

Eu tentei mas não ganha mais do que 1

                                                       

 

 

                                                                                           5e1fc80227b414e178a2f7de00379363.jpg.fb527fa5863cba1c20b81b6ea6841da0.jpg                                                                                                  

Link para o post
Compartilhar em outros sites

Vc precisa configurar onde tem:

 

local qnt = 1 --QUANTIDADE_QUE_VC_QR

 Logo na primeira linha.
Onde tem 1 vc coloca a quantidade que vc qr que o player ganhe.

 

Se ajudei, REP+ ^^

Te ajudei?? REP + e ficamos quites... <ahttp://www.tibiaking.com/forum/uploads/emoticons/default_happyy.png' alt=';D'>

Atenciosamente,

Daniel.

Abraços!

Link para o post
Compartilhar em outros sites

Eu editei mas não vai mais do que 1

                                                       

 

 

                                                                                           5e1fc80227b414e178a2f7de00379363.jpg.fb527fa5863cba1c20b81b6ea6841da0.jpg                                                                                                  

Link para o post
Compartilhar em outros sites
local qnt = 1 --QUANTIDADE_QUE_VC_QR 

function onUse(cid, item, fromPosition, itemEx, toPosition)

if item.uid > 1000 and item.uid < 13000 then
local itemWeight = getItemWeightById(item.uid, qnt)
local playerCap = getPlayerFreeCap(cid)
if playerCap >= itemWeight then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have found a ' .. getItemNameById(item.uid) .. '.')
doPlayerAddItem(cid, item.uid , qnt)
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have found a ' .. getItemNameById(item.uid) .. ' weighing ' .. itemWeight .. ' oz it\'s too heavy.')
end
else
return false
end
return true

end

Ve agr...

Te ajudei?? REP + e ficamos quites... <ahttp://www.tibiaking.com/forum/uploads/emoticons/default_happyy.png' alt=';D'>

Atenciosamente,

Daniel.

Abraços!

Link para o post
Compartilhar em outros sites

Não testei.

local items = {
    [1740] = {ammount = 5},
    [1747} = {ammount = 5},
    [1748] = {ammount = 10},
    [1749] = {ammount = 2},
}

function onUse(cid, item)
    local i = items[item.uid]
    
    if i then
        if getPlayerFreeCap(cid) >= getItemWeightById(item.uid, i.ammount) then
            for a = 1, i.ammount do
                
                doPlayerAddItem(cid, item.uid)
            end
            
            doPlayerSendTextMessage(cid, 27, "Voce ganhou "..i.ammount.."x "..getItemNameById(item.uid))
            return true
        end
        
        doPlayerSendCancel(cid, "Voce precisa de "..getItemWeightById(item.uid, i.ammount).." de cap para fazer esta quest.")
        return true
    end
end
Editado por Orochi Elf (veja o histórico de edições)

Tony Araújo  ;D 

 

Link para o post
Compartilhar em outros sites

Não vai :/

                                                       

 

 

                                                                                           5e1fc80227b414e178a2f7de00379363.jpg.fb527fa5863cba1c20b81b6ea6841da0.jpg                                                                                                  

Link para o post
Compartilhar em outros sites

Tenho certeza então que você não está configurando tudo certinho.

Pois vários métodos acima, estão funcionais.

 

@Edit

Com qual item você está testando?

Editado por Orochi Elf (veja o histórico de edições)

Tony Araújo  ;D 

 

Link para o post
Compartilhar em outros sites

Estou tentando com um baú.

                                                       

 

 

                                                                                           5e1fc80227b414e178a2f7de00379363.jpg.fb527fa5863cba1c20b81b6ea6841da0.jpg                                                                                                  

Link para o post
Compartilhar em outros sites

Nto points que é para comprar ums itens vip o id é 884...

                                                       

 

 

                                                                                           5e1fc80227b414e178a2f7de00379363.jpg.fb527fa5863cba1c20b81b6ea6841da0.jpg                                                                                                  

Link para o post
Compartilhar em outros sites

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo