Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function bonusItem(bonusTable, vnum)
- --Sem Bonus?
- if table.getn(bonusTable) < 1 then
- return
- end
- --Dar e selecionar item
- pc.give_item2_select(vnum)
- --item é equipamento? se não, remover.
- if not (item.get_type() == ITEM_WEAPON or item.get_type() == ITEM_ARMOR or item.get_sub_type() == ARMOR_EAR) then
- item.remove()
- return
- end
- --Cada bonus na tabela, adicionar no item
- for i = 0, table.getn(bonusTable) do
- item.set_value(i, bonusTable[i][1], bonusTable[i][2])
- end
- --Tudo ok, item dado com os bonus desejados ;)
- end
- function bonus_insert(bonusTable, idx, id, qnt)
- --Criar valor de bonus com ID e Quantidade de bonus
- local bonus = { id, qnt }
- --Inserir valor de bonus na table de bonus
- table.insert(bonusTable, idx, bonus)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement