Ir para conteúdo

Demonbholder

Infante
  • Total de itens

    1551
  • Registro em

  • Última visita

  • Dias Ganhos

    24

Tudo que Demonbholder postou

  1. contra fatos não há argumentos, mkalo.
  2. não, sai daqui, obrigado.
  3. onde que está fácil de editar? não tem uma variável sequer.
  4. Quanto a memória, uma simples modificação na função do kydrai resolveria o problema: function getItemsInContainerById(container, tab) -- Function By Kydrai local items = {} if isContainer(container) and getContainerSize(container) > 0 then for slot=0, (getContainerSize(container)-1) do local item = getContainerItem(container, slot) if isContainer(item.uid) then local itemsbag = getItemsInContainerById(item.uid, tab) for i=0, #itemsbag do table.insert(items, itemsbag[i]) end else if table.find(tab, item.itemid) then table.insert(items, item.uid) end end end end return items end e assim, utilizar a função deste jeito: getItemsInContainerById(cont, {2148, 2152, 2160}) até.
  5. Talkaction: function onSay(cid, words, param) local stats = getPlayerStorageValue(cid, 45600) == -1 and "ativado." or "desativado." doPlayerSendTextMessage(cid, 25, "O sistema de captura de gold foi " .. stats) setPlayerStorageValue(cid, 45600, stats == "ativado." and 1 or -1) end Tag: <talkaction words="/autogold" script="NomeDoArquivo.lua" /> Creaturescripts: function onKill(cid, target, lastHit) if getPlayerStorageValue(cid, 45600) == 1 then addEvent(check, 1000, cid, getThingPos(target)) end return true end function check(cid, pos) local cont = getThingFromPos(pos).uid if isCorpse(cont) then if isContainer(cont) then doPlayerAddCoin(cid, getItemsInContainerById(cont, 2148)) doPlayerAddCoin(cid, getItemsInContainerById(cont, 2152)) doPlayerAddCoin(cid, getItemsInContainerById(cont, 2160)) end end end function doPlayerAddCoin(cid, tab) for _, uids in pairs(tab) do doPlayerAddItem(cid, getThing(uids).itemid, getThing(uids).type) doRemoveItem(uids) end end function getItemsInContainerById(container, itemid) -- Function By Kydrai local items = {} if isContainer(container) and getContainerSize(container) > 0 then for slot=0, (getContainerSize(container)-1) do local item = getContainerItem(container, slot) if isContainer(item.uid) then local itemsbag = getItemsInContainerById(item.uid, itemid) for i=0, #itemsbag do table.insert(items, itemsbag[i]) end else if itemid == item.itemid then table.insert(items, item.uid) end end end end return items end login.lua: registerCreatureEvent(cid, "Autogold") Tag: <event type="kill" name="Autogold" event="script" value="NomeDoArquivo.lua"/>
  6. Entrei para falar o mesmo que o Oneshot já disse, acho que o melhor jeito de fazer o seu script interpretar os itens na ordem inversa seria este: function getItens(pos, recipe) local f = nil for a = 1, #recipe do s = nil for i = 1, 255 do pos.stackpos = i if s ~= a then if getThingFromPos(pos).itemid == recipe[a].id and getThingFromPos(pos).type >= recipe[a].count then f = f and f+1 or 1 s = a end end end end return f == #recipe end
  7. Agradeço todos os comentários. @Nyco É complicado fazer um sistema desses todos os dias rs.
  8. Eskylo, seu script poderia ficar melhor se você utilizasse apenas uma tabela e nos valores desta inserir uma tabela com o nome do monstro e a porcentagem. E não entendi por que o uso de uma variável que soma as chances, considerando que é uma certa chance pra cada monstro, não uma soma de todas. Acho que o script que ele falava era algo parecido com isso: ----Edited2x_by_eskylo <<<<<<<<<<<<<<<<<<< ---------BY MULIZEU------------------ function onUse(cid, item, position, toposition) remover_item = "yes" --Troque para "no" se quiser quantidade_de_monsters = 3 --Número de monsters q o script vai sumonar local M = { [1] = {"Demon", 25}, [2] = {"Morgaroth", 5}, [3] = {"Dog", 70}, } local storage = 12122 local time = 5 if getPlayerStorageValue(cid, storage) >= os.time() then return false end for i = 1, quantidade_de_monsters do for index, tab in pairs(M) do if math.random(1,100) <= tab[2] then doCreateMonster(tab[1], {x=getPlayerPosition(cid).x - 1, y=getPlayerPosition(cid).y, z=getPlayerPosition(cid).z}) end end end if remover_item == "yes" then doRemoveItem(item.uid, 1) end doCreatureSay(cid, "Oh! my God", 19) doSendMagicEffect(getPlayerPosition(cid), 36) setPlayerStorageValue(cid, storage, os.time()+time) return true end Corrija-me se eu estiver errado.
  9. Legal, você fez o sistema?
  10. Não, eu fiz o sistema inteiro sozinho.
  11. Achei um script extremamente medíocre, desculpe.
  12. Verifique se o item encontrado nesta posição: x=32716, y=32345, z=7 é algum destes : 8288, 8289, 8290, 8291. No aguardo.
  13. Parabéns, bom script.
  14. Um aviso, se você colocar, por exemplo print({1} == {1}) vai retornar false, pois não se iguala tabelas. Vc teria que comparar todos os valores, no caso, pos.x, pos.y, pos.z, ou como fez o usuário acima, comparar o uid no local indicado pela posição. Até.
  15. Troca a função spawnNewZombie na lib por essa: function spawnNewZombie() local posx = {} local posy = {} local posz = {} local pir = {} for i=1, 5 do local posx_tmp = math.random(math.min(ZE_spawnFromPosition.x ,ZE_spawnToPosition.x), math.max(ZE_spawnFromPosition.x ,ZE_spawnToPosition.x)) local posy_tmp = math.random(math.min(ZE_spawnFromPosition.y ,ZE_spawnToPosition.y), math.max(ZE_spawnFromPosition.y ,ZE_spawnToPosition.y)) local posz_tmp = math.random(math.min(ZE_spawnFromPosition.z ,ZE_spawnToPosition.z), math.max(ZE_spawnFromPosition.z ,ZE_spawnToPosition.z)) local pir_tmp = 0 local spec = getSpectators({x=posx_tmp, y=posy_tmp, z=posz_tmp}, 3, 3, false) if(spec and #spec > 0) then for z, pid in pairs(spec) do if(isPlayer(pid)) then pir_tmp = pir_tmp + 1 end end end posx[i] = posx_tmp posy[i] = posy_tmp posz[i] = posz_tmp pir[i] = pir_tmp end local lowest_i = 1 for i=2, 5 do if(pir[i] < pir[lowest_i]) then lowest_i = i end end local ret = (type(doCreateMonster("Zombie Event", {x=posx[lowest_i], y=posy[lowest_i], z=posz[lowest_i]}, false)) == 'number') if(ret) then addZombiesCount() end return ret end
  16. O script é esse: local function vipPushBack(cid, position, fromPosition, displayMessage) doTeleportThing(cid, fromPosition, true) doSendMagicEffect(position, CONST_ME_MAGIC_BLUE) if(displayMessage) then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Está zona so jogadores VIP podem entrar.") end end function onStepIn(cid, item, position, fromPosition) domodlib('Vip_Libs') if (isVip(cid) == false) then vipPushBack(cid, position, fromPosition, true) end end Me parece correto, aparece algum erro no distro?
  17. eu garanto que funciona. é possível usando as bibliotecas em c.
  18. Esse é muito bom: gesiorbr.blogspot.com É um blog de um amigo que edita o gesior e posta lá, ele tem parceria com o TFS e tem alguns ots pra baixar lá também.
  • Quem Está Navegando   0 membros estão online

    • Nenhum usuário registrado visualizando esta página.
×
×
  • Criar Novo...