Ir para conteúdo

GustavaoTibia

Campones
  • Total de itens

    30
  • Registro em

  • Última visita

Histórico de Reputação

  1. Upvote
    GustavaoTibia deu reputação a Eskylo em Bag Reward Chest 1.x   
    function onKill(cid, target)local killer = Creature(cid)if not killer:isPlayer() then return trueendtarget = Monster(target) if (target ~= nil) then local mt = MonsterType(target:getName()) if mt:useRewardChest() then local loot = BossLoot:new(target) if loot then local corpse = Item(doCreateItem(MonsterType(target:getName()):getCorpseId(), 1, target:getPosition())) doDecayItem() target:setDropLoot(false) loot:updateDamage() loot:setRewards() loot:addRewards() corpse:setAttribute('aid', 21584) end end end return trueend Coloquei uma verificação na onkill, mas não tenho certeza se o problema está aqui mesmo. O script de 1 bag por boss deu certo?
  2. Upvote
    GustavaoTibia deu reputação a Eskylo em Bag Reward Chest 1.x   
    O script é comprido, então não li ele todo, mas acho que posso ajudar...
     
    for i, lootTable in ipairs(playertab[3]) do local item = player:addItemRewardBag(lootTable[1].itemId, math.ceil(lootTable[2])) if item then str = str .. item:getNameDescription() .. ", " end end Você tem que criar a bag antes desse loop for, e durante o loop for você adiciona os itens na bag e depois do end você envia a bag ao player.
     
    Se ainda tiver dificuldade explica passo a passo o que tá acontecendo, e o que você quer que aconteça, exemplo a bag deve ir pro dp do jogador?
  3. Upvote
    GustavaoTibia deu reputação a Eskylo em Bag Reward Chest 1.x   
    local bagId = 2000 -- coloque o id da bagfunction BossLoot:addRewards() if self.players and self.players[1] and self.players[1][3] then for i, playertab in ipairs(self.players) do local player = Player(playertab[1]) if player then local str = "The following items are available in your reward chest: " local bagUid = Game.createItem(bagId, 1) for i, lootTable in ipairs(playertab[3]) do local item = bagUid:addItem(lootTable[1].itemId, math.ceil(lootTable[2])) if item then str = str .. item:getNameDescription() .. ", " end end player:addItemRewardBag(bagUid) str = str:sub(1, #str-2) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, str) end end else error("Error") endend function Player:addItemRewardBag(item)local rewardbag = self:getDepotChest(99, true) return rewardbag:addItemEx(item)end substitui essas 2 funções
     
    faz muito tempo que não mexo com tfs 1.x então pode ser que dê algum erro, mas tentei
  • Quem Está Navegando   0 membros estão online

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