Ir para conteúdo

Featured Replies

Postado

Nos dois scripts?

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

Atenciosamente,

Daniel.

Abraços!

  • Respostas 29
  • Visualizações 947
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • Tente: function onDeath(cid)     aol = 2173     slot = getPlayerSlotItem(cid, CONST_SLOT_NECKLACE)          if slot.itemid == aol and getItemAttribute(slot.uid, 'charges') == 1 then         doRemove

  • Testei desse modo. As charges bugaram e deixaram o item infinito, por isso não indiquei essas tags.

  • vdd, testei no otx nao bugou, ate que chegou na ultima charge, perdao pelo post

Postado

Putz... Burrei, acabei de reler o 2° script e vi que eu declarei a table errada, uma table inexistente.

local stor = {}

function onDeath(cid, corpse, deathList, lastHitKiller, mostDamageKiller)
if isPlayer(cid) == TRUE then
if (getPlayerSlotItem(cid, 2).itemid == 2173) then
doCreatureSetDropLoot(cid, false)
doPlayerSetLossSkill(cid, false)
doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, 10)
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_HOLYAREA)
if #stor < 30 then
table.insert(stor, (#stor + 1))
else
for k in pairs(stor) do
    stor[k] = nil
end
end
end
end
return TRUE
end

Tenta agora.

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!

Postado

Faz um bom tempo que não scripteio, mas pelo que entendi da sua descrição, isso talvez baste. E eu não sei como esse AoL funciona (não jogo Tibia). Na verdade, só li o código do danihcv e tirei minha conclusão sobre.

Como ele quer que o item tenha 30 cargas, basta usar atributos. Fica mais fácil.

function onDeath(cid, corpse, deathList, lastHitKiller, mostDamageKiller)
    if isPlayer(cid) then
        if getPlayerSlotItem(cid, 2).itemid == 2173 then
            local v = getItemAttribute(getPlayerSlotItem(cid, 2).uid, "charges") or 0
            if v < 29 then  
                doCreatureSetDropLoot(cid, false)
                doPlayerSetLossSkill(cid, false)
                doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, 10)
                doSendMagicEffect(getCreaturePosition(cid), CONST_ME_HOLYAREA)
                doItemSetAttribute(getPlayerSlotItem(cid, 2).uid, "charges", v + 1)                
            else
                doRemoveItem(getPlayerSlotItem(cid, 2).uid)
            end
        end
    end
    return true
end

não respondo pms solicitando suporte em programação/scripting

Postado

Faz um bom tempo que não scripteio, mas pelo que entendi da sua descrição, isso talvez baste. E eu não sei como esse AoL funciona (não jogo Tibia). Na verdade, só li o código do danihcv e tirei minha conclusão sobre.

Como ele quer que o item tenha 30 cargas, basta usar atributos. Fica mais fácil.

function onDeath(cid, corpse, deathList, lastHitKiller, mostDamageKiller)
    if isPlayer(cid) then
        if getPlayerSlotItem(cid, 2).itemid == 2173 then
            local v = getItemAttribute(getPlayerSlotItem(cid, 2).uid, "charges") or 0
            if v < 29 then  
                doCreatureSetDropLoot(cid, false)
                doPlayerSetLossSkill(cid, false)
                doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, 10)
                doSendMagicEffect(getCreaturePosition(cid), CONST_ME_HOLYAREA)
                doItemSetAttribute(getPlayerSlotItem(cid, 2).uid, "charges", v + 1)                
            else
                doRemoveItem(getPlayerSlotItem(cid, 2).uid)
            end
        end
    end
    return true
end

O certo não seria isso ?

 

function onDeath(cid, corpse, deathList, lastHitKiller, mostDamageKiller)
    if isPlayer(cid) then
        if getPlayerSlotItem(cid, 2).itemid == 2173 then
            local v = getItemAttribute(getPlayerSlotItem(cid, 2).uid, "charges") or 0
            if v >= 1 then  
                doCreatureSetDropLoot(cid, false)
                --[[doPlayerSetLossSkill(cid, false) < não precisa pois aol não salva skill]]
                doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, 10)
                doSendMagicEffect(getCreaturePosition(cid), CONST_ME_HOLYAREA)
                doItemSetAttribute(getPlayerSlotItem(cid, 2).uid, "charges", v - 1)                
            else
                doRemoveItem(getPlayerSlotItem(cid, 2).uid)
            end
        end
    end
    return true
end
/\ Não sei se estou certo, mas, pode ser uma possibilidade pois não testei nada.

@Edit

Meu deus, odeio quando os Quote buga.

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

                              _
                          .-'` `}
                  _./)   /       }
                .'o   \ |       }
                '.___.'`.\    {`
                /`\_/  , `.    }                                      ME DA UMA NOZ!
                \=' .-'   _`\  {
                 `'`;/      `,  }
                    _\   @   ;  }
                   /__`;-...'--'

Cluck!

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

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.7k

Informação Importante

Confirmação de Termo