Postado Fevereiro 13, 2015 10 anos Usando rev 3884 - 0.4 - 8.60 Erro acontece qnd eu mato um rat pra testar function autoGP(cid, pos, corpseId) local player = Player(cid) if not player then return end local corpse = Tile(pos):getItemById(corpseId) if corpse then local container = Container(corpse:getUniqueId()) if container then local gold = 0 for i = 1, container:getSize() do local item = container:getItem(i) if item then local id = item:getId() local count = item:getCount() local goldAdded = id == 2148 and count or id == 2152 and count * 100 or id == 2160 and count * 10000 or 0 if goldAdded > 0 then gold = gold + goldAdded item:remove(count) end else break end end player:addMoney(gold) end end end function onKill(creature, target) if target:isPlayer() then return true end local monsterType = MonsterType(target:getName()) addEvent(autoGP, 1, creature:getId(), target:getPosition(), monsterType:getCorpseId()) return true end
Postado Fevereiro 13, 2015 10 anos vc fez usando as funções de tfs 1.1, tem que substituir pelas de 8.6, se eu soube-se como passava pra vc
Postado Fevereiro 13, 2015 10 anos function autoloot(cid, position, corpseID) if not isPlayer(cid) then return end local corpse = getTileItemById(position, corpseID) if corpse and isContainer(corpse.uid) then local gold = 0 for slot = 1, getContainerSize(corpse.uid) do local item = getContainerItem(corpse.uid, slot) local amount = (item.itemid == 2148 and item.type or (item.itemid == 2152 and item.type * 100 or (item.itemid == 2160 and item.type * 10000)) or 0) if item.uid > 0 then if amount > 0 then gold = gold + amount doRemoveItem(item.uid) end else break end end doPlayerAddMoney(cid, gold) end end function onKill(cid, target) if isPlayer(target) then return true end local position = getCreaturePosition(target) local info = getMonsterInfo(getCreatureName(target)) addEvent(autoloot, 3, cid, position, info.lookCorpse) return true end Editado Fevereiro 13, 2015 10 anos por Garou (veja o histórico de edições)
Postado Fevereiro 13, 2015 10 anos Autor function autoloot(cid, position, corpseID) if not isPlayer(cid) then return end local corpse = getTileItemById(position, corpseID) if corpse and isContainer(corpse.uid) then local gold = 0 for slot = 1, getContainerSize(corpse.uid) do local item = getContainerItem(corpse.uid, slot) local amount = (item.itemid == 2148 and item.type or (item.itemid == 2152 and item.type * 100 or (item.itemid == 2160 and item.type * 10000)) or 0) if item.uid > 0 then if amount > 0 then gold = gold + amount doRemoveItem(item.uid) end else break end end doPlayerAddMoney(cid, gold) end end function onKill(cid, target) if isPlayer(target) then return true end local position = getCreaturePosition(target) local info = getMonsterInfo(getCreatureName(target)) addEvent(autoloot, 3, cid, position, info.lookCorpse) return true end Vou te dar 6 reps, sabe o pq alguns loots tão falhando?
Postado Fevereiro 13, 2015 10 anos Me diz o nome dos monstros que o loot falha que eu posso simular e estudar o problema.
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.