Ir para conteúdo

feipedorp

Membro
  • Registro em

  • Última visita

Tudo que feipedorp postou

  1. Alguem tem esse script atualizado passo a passo pra instalar? e link funcional por favor.
  2. tem esse script pras versoes 12x... tfs 1.3? tem esse script pra versao atual 12x... tfs 1.3?
  3. aqui esta liberada somente a 1, gostaria de liberar a segunda tambem como faço?
  4. .Qual servidor ou website você utiliza como base? ot manager tfs 1.3 Qual o motivo deste tópico? TENHO SISTEMA DE RECOMPENSA DIARIA, DOU O SERVER SAVE MANUALMENTE TODO DIA AS 6H DA AMNHA MAIS O PLAYER N CONSEGUE PEGAR A RECOMPENSA, OQUE PRECISO ARRUMAR NO SCRPIT ABAIXO? Está surgindo algum erro? Se sim coloque-o aqui. Você tem o código disponível? Se tiver publique-o aqui: DailyRewardSystem = { Developer = "Westwol", Version = "1.1", lastUpdate = "04/06/2019 - 01:00" } local ServerPackets = { ShowDialog = 0xED, -- universal DailyRewardCollectionState = 0xDE, -- undone OpenRewardWall = 0xE2, -- Done CloseRewardWall = 0xE3, -- is it necessary? DailyRewardBasic = 0xE4, -- Done DailyRewardHistory = 0xE5, -- Done RestingAreaState = 0xA9 -- unodne } local ClientPackets = { OpenRewardWall = 0xD8, OpenRewardHistory = 0xD9, SelectReward = 0xDA, } --[[-- Constants Please do not edit any of the next constants: ]] --[[ Overall ]]-- local DAILY_REWARD_COUNT = 7 local REWARD_FROM_SHRINE = 0 local REWARD_FROM_PANEL = 1 --[[ Bonuses ]] -- local DAILY_REWARD_NONE = 1 local DAILY_REWARD_HP_REGENERATION = 2 local DAILY_REWARD_MP_REGENERATION = 3 local DAILY_REWARD_STAMINA_REGENERATION = 4 local DAILY_REWARD_DOUBLE_HP_REGENERATION = 5 local DAILY_REWARD_DOUBLE_MP_REGENERATION = 6 local DAILY_REWARD_SOUL_REGENERATION = 7 --[[ Reward Types ]] -- -- Server Types local DAILY_REWARD_TYPE_ITEM = 1 local DAILY_REWARD_TYPE_STORAGE = 2 local DAILY_REWARD_TYPE_PREY_REROLL = 3 local DAILY_REWARD_TYPE_XP_BOOST = 4 -- Client Types local DAILY_REWARD_SYSTEM_SKIP = 1 local DAILY_REWARD_SYSTEM_TYPE_ONE = 1 local DAILY_REWARD_SYSTEM_TYPE_TWO = 2 local DAILY_REWARD_SYSTEM_TYPE_OTHER = 1 local DAILY_REWARD_SYSTEM_TYPE_PREY_REROLL = 2 local DAILY_REWARD_SYSTEM_TYPE_XP_BOOST = 3 --[[ Account Status ]] -- local DAILY_REWARD_STATUS_FREE = 1 DailyReward = { testMode = false, serverTimeThreshold = (1 * 60), -- Counting down 24hours from last server save storages = { -- Player currentDayStreak = 14897, currentStreakLevel = 14898, nextRewardTime = 14899, collectionTokens = 14901, staminaBonus = 14902, -- Global lastServerSave = 14110, avoidDouble = 13412, notifyReset = 13413 }, strikeBonuses = { -- day [1] = {text = "No bonus for first day"}, [2] = {text = "Allow Hit Point Regeneration"}, [3] = {text = "Allow Mana Regeneration"}, [4] = {text = "Stamina Regeneration"}, [5] = {text = "Double Hit Point Regeneration"}, [6] = {text = "Double Mana Regeneration"}, [7] = {text = "Soul Points Regeneration"} }, rewards = { -- day [1] = { type = DAILY_REWARD_TYPE_ITEM, systemType = DAILY_REWARD_SYSTEM_TYPE_ONE, freeAccount = { items = {7618, 7588, 7620, 7589, 8472, 2290, 2266, 2310, 2277, 2301, 2265}, itemsToPick = 5 }, premiumAccount = { items = {7618, 7588, 7620, 7589, 8472, 2290, 2266, 2310, 2277, 2301, 2265}, itemsToPick = 10 } }, [2] = { type = DAILY_REWARD_TYPE_ITEM, systemType = DAILY_REWARD_SYSTEM_TYPE_ONE, freeAccount = { items = {7618, 7588, 7620, 7589, 8472, 2290, 2266, 2310, 2277, 2301, 2265}, itemsToPick = 5 }, premiumAccount = { items = {7618, 7588, 7620, 7589, 8472, 2290, 2266, 2310, 2277, 2301, 2265}, itemsToPick = 10 } }, [3] = { type = DAILY_REWARD_TYPE_PREY_REROLL, systemType = DAILY_REWARD_SYSTEM_TYPE_TWO, freeAccount = { rerollCount = 1 }, premiumAccount = { rerollCount = 2 } }, [4] = { type = DAILY_REWARD_TYPE_ITEM, systemType = DAILY_REWARD_SYSTEM_TYPE_ONE, freeAccount = { items = {7618, 7588, 7620, 7589, 8472, 2290, 2266, 2310, 2277, 2301, 2265}, itemsToPick = 10 }, premiumAccount = { items = {7618, 7588, 7620, 7589, 8472, 2290, 2266, 2310, 2277, 2301, 2265}, itemsToPick = 20 } }, [5] = { type = DAILY_REWARD_TYPE_PREY_REROLL, systemType = DAILY_REWARD_SYSTEM_TYPE_TWO, freeAccount = { rerollCount = 1 }, premiumAccount = { rerollCount = 2 } }, [6] = { type = DAILY_REWARD_TYPE_ITEM, systemType = DAILY_REWARD_SYSTEM_TYPE_ONE, freeAccount = { items = {32124, 32125, 32126, 32127, 32128, 32129}, itemsToPick = 1 }, premiumAccount = { items = {32124, 32125, 32126, 32127, 32128, 32129}, itemsToPick = 2 }, itemCharges = 50 }, [7] = { type = DAILY_REWARD_TYPE_XP_BOOST, systemType = DAILY_REWARD_SYSTEM_TYPE_TWO, freeAccount = { xpminutes = 10 }, premiumAccount = { xpminutes = 30 } } -- Storage reward template --[[[5] = { type = DAILY_REWARD_TYPE_STORAGE, systemType = DAILY_REWARD_SYSTEM_TYPE_TWO, freeCount = 1, premiumCount = 2, freeAccount = { things = { [1] = { name = "task boost", id = 1, -- this number can't be repeated quantity = 1, storages = { {storageId = 23454, value = 1}, {storageId = 45141, value = 2}, {storageId = 45141, value = 3} } } } }, premiumAccount = { things = { [1] = { name = "task boostss", id = 2, -- this number can't be repeated quantity = 1, storages = { {storageId = 23454, value = 1} } }, [2] = { name = "another task boost", id = 3, -- this number can't be repeated quantity = 2, storages = { {storageId = 23454, value = 1}, {storageId = 45141, value = 2}, {storageId = 45141, value = 3} } } } } },]] } } function onRecvbyte(player, msg, byte) if (byte == ClientPackets.OpenRewardWall) then DailyReward.loadDailyReward(player:getId(), REWARD_FROM_PANEL) elseif (byte == ClientPackets.OpenRewardHistory) then player:sendRewardHistory() elseif (byte == ClientPackets.SelectReward) then player:selectDailyReward(msg) end end -- Core functions DailyReward.insertHistory = function(playerId, dayStreak, description) return db.query(string.format("INSERT INTO `daily_reward_history`(`player_id`, `daystreak`, `timestamp`, \z `description`) VALUES (%s, %s, %s, %s)", playerId, dayStreak, os.time(), db.escapeString(description))) end DailyReward.retrieveHistoryEntries = function(playerId) local player = Player(playerId) if not player then return false end local entries = {} local resultId = db.storeQuery("SELECT * FROM `daily_reward_history` WHERE `player_id` = \z " .. player:getGuid() .. " ORDER BY `timestamp` DESC LIMIT 15;") if resultId ~= false then repeat local entry = { description = result.getDataString(resultId, "description"), timestamp = result.getDataInt(resultId, "timestamp"), daystreak = result.getDataInt(resultId, "daystreak"), } table.insert(entries, entry) until not result.next(resultId) result.free(resultId) end return entries end DailyReward.loadDailyReward = function(playerId, source) local player = Player(playerId) if not player then return false end if source ~= 0 then source = REWARD_FROM_SHRINE else source = REWARD_FROM_PANEL end if player:getClient().os == CLIENTOS_NEW_WINDOWS then player:sendCollectionResource(player:getCollectionTokens()) player:sendDailyReward() player:sendOpenRewardWall(source) player:sendDailyRewardCollectionState(false) else player:sendCancelMessage("The current client does not have support, download the latest version.") end return true end DailyReward.pickedReward = function(playerId) local player = Player(playerId) if not player then return false end -- Reset day streak to 0 when reaches last reward if player:getDayStreak() ~= 6 then player:setDayStreak(player:getDayStreak() + 1) else player:setDayStreak(0) end player:setStreakLevel(player:getStreakLevel() + 1) player:setStorageValue(DailyReward.storages.avoidDouble, Game.getLastServerSave()) player:setNextRewardTime(Game.getLastServerSave() + DailyReward.serverTimeThreshold) player:getPosition():sendMagicEffect(CONST_ME_FIREWORK_YELLOW) return true end DailyReward.isShrine = function(source) if source ~= 0 then return false else return true end end function Player.iterateTest(self) local dailyTable = DailyReward.rewards[5] local reward = dailyTable.freeAccount for i = 1, #reward.things do for j = 1, #reward.things[i].storages do self:setStorageValue(reward.things[i].storages[j].storageId, reward.things[i].storages[j].value) end end end DailyReward.isRewardTaken = function(playerId) local player = Player(playerId) if not player then return false end local playerStorage = player:getStorageValue(DailyReward.storages.avoidDouble) if playerStorage == Game.getLastServerSave() then return true end return false end DailyReward.updateDailyRewardStats = function(playerId, zone) local player = Player(playerId) if not player then return false end local normal, protected = 0, 1 local disabled, active = 0, 1 if player:getTile():hasFlag(TILESTATE_PROTECTIONZONE) then if player:isRestingAreaBonusActive() then player:loadDailyRewardBonuses() --print(string.format("> %s loaded daily reward bonuses.", player:getName())) player:sendRestingAreaState(protected, active) else player:sendRestingAreaState(protected, disabled) end else player:disableDailyRewardBonuses() player:sendRestingAreaState(normal, player:isRestingAreaBonusActive()) end end DailyReward.init = function(playerId) local player = Player(playerId) if not player then return false end local rewardTime = player:getNextRewardTime() + DailyReward.serverTimeThreshold + 60 -- 1 minutes timegrace local nextServerSave = Game.getLastServerSave() + DailyReward.serverTimeThreshold if rewardTime < nextServerSave then if player:getStorageValue(DailyReward.storages.notifyReset) ~= Game.getLastServerSave() then player:setStreakLevel(0) player:setStorageValue(DailyReward.storages.notifyReset, Game.getLastServerSave()) if player:getLastLoginSaved() > 0 then -- message wont appear at first character login player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You just lost your daily reward streak.") end end end DailyReward.updateDailyRewardStats(playerId) end DailyReward.processReward = function(playerId, source) DailyReward.pickedReward(playerId) DailyReward.loadDailyReward(playerId, source) DailyReward.updateDailyRewardStats(playerId) return true end function Player.sendOpenRewardWall(self, shrine) local msg = NetworkMessage() msg:addByte(ServerPackets.OpenRewardWall) -- initial packet msg:addByte(shrine) -- isPlayer taking bonus from reward shrine (1) - taking it from a instant bonus reward (0) if DailyReward.testMode then msg:addU32(0) else msg:addU32(self:getNextRewardTime()) end msg:addByte(self:getDayStreak()) -- current reward? day = 0, day 1, ... this should be resetted to 0 every week imo local dailyReward_taken = 0 -- 0 / 1 / 2 msg:addByte(dailyReward_taken) -- state (player already took reward? but just make sure noone wpe) if dailyReward_taken ~= 0 then msg:addString("Sorry, you have already taken your daily reward or you are unable to collect it.") end msg:addU32(0) --timeLeft to pickUp reward without loosing streak//this should be 0 if reward has been already picked msg:addU16(self:getStreakLevel()) -- day strike msg:addU16(24) -- unknown msg:sendToPlayer(self) end function Player.sendCollectionResource(self, value) local msg = NetworkMessage() msg:addByte(0xEE) -- resource byte msg:addByte(0x14) msg:addU64(value) msg:sendToPlayer(self) end function Player.selectDailyReward(self, msg) local playerId = self:getId() if DailyReward.isRewardTaken(playerId) and not DailyReward.testMode then self:sendError("You have already collected your daily reward.") return false end local source = msg:getByte() -- 1 -> shrine / 0 -> tibia panel if not DailyReward.isShrine(source) then if self:getCollectionTokens() < 1 then self:sendError("You do not have enough collection tokens to proceed.") return false end self:setCollectionTokens(self:getCollectionTokens() - 1) end local dailyTable = DailyReward.rewards[self:getDayStreak() + 1] if not dailyTable then self:sendError("Something went wrong and we cannot process this request.") return false end -- Items as reward if (dailyTable.type == DAILY_REWARD_TYPE_ITEM) then local items = {} -- Creating items table local columnsPicked = msg:getByte() -- Columns picked for i = 1, columnsPicked do local spriteId = msg:getU16() local count = msg:getByte() items[i] = {spriteId = spriteId, count = count} end -- Verifying if items if player is picking the correct amount local counter = 0 for k, v in ipairs(items) do counter = counter + v.count end if self:isPremium() then count = dailyTable.premiumAccount.itemsToPick else count = dailyTable.freeAccount.itemsToPick end if counter > count then self:sendError("Something went wrong here, please restart this dialog.") return false end -- Adding items to store inbox local inbox = self:getSlotItem(CONST_SLOT_STORE_INBOX) if inbox and inbox:getEmptySlots() < columnsPicked then self:sendError("You do not have enough space in your store inbox.") return false end local description = "" for k, v in ipairs(items) do local item = Game.getItemIdByClientId(v.spriteId) if dailyTable.itemCharges then for i = 1, v.count do inbox:addItem(item:getId(), dailyTable.itemCharges) -- adding charges for each item end else inbox:addItem(item:getId(), v.count) -- adding single item w/o charges end if k ~= columnsPicked then description = description .. "" .. v.count .. "x " .. getItemName(item:getId()) .. ", " else description = description .. "" .. v.count .. "x " .. getItemName(item:getId()) .. "." end end -- Registering history DailyReward.insertHistory(self:getGuid(), self:getDayStreak(), "Claimed reward no. \z " .. self:getDayStreak() + 1 .. ". Picked items: " .. description) DailyReward.processReward(playerId, source) end local reward = nil if self:isPremium() then reward = dailyTable.premiumAccount else reward = dailyTable.freeAccount end if (dailyTable.type == DAILY_REWARD_TYPE_STORAGE) then local description = "" for i = 1, #reward.things do for j = 1, #reward.things[i].storages do self:setStorageValue(reward.things[i].storages[j].storageId, reward.things[i].storages[j].value) end if i ~= #reward.things then description = description .. reward.things[i].name .. ", " else description = description .. reward.things[i].name .. "." end end DailyReward.insertHistory(self:getGuid(), self:getDayStreak(), "Claimed reward no. \z " .. self:getDayStreak() + 1 .. ". Picked reward: " .. description) DailyReward.processReward(playerId, source) end if (dailyTable.type == DAILY_REWARD_TYPE_XP_BOOST) then --[[local window = ModalWindow { title = 'Warning', message = 'You still have 20 minutes XP Boost from a previous daily reward left. \z If you claim your daily reward now, you will lose this remaining time.' } window:addButton('Ok', function(button, choice) DailyReward.insertHistory(self:getGuid(), self:getDayStreak(), "Claimed reward no. \z " .. self:getDayStreak() + 1 .. ". Picked reward: XP Bonus for " .. reward.xpminutes .. " minutes.") DailyReward.processReward(playerId, source) end) window:addButton('Cancel') window:sendToPlayer(self)]] self:setExpBoostStamina(self:getExpBoostStamina() + (reward.xpminutes * 60)) self:setStoreXpBoost(50) DailyReward.insertHistory(self:getGuid(), self:getDayStreak(), "Claimed reward no. \z " .. self:getDayStreak() + 1 .. ". Picked reward: XP Bonus for " .. reward.xpminutes .. " minutes.") DailyReward.processReward(playerId, source) end if (dailyTable.type == DAILY_REWARD_TYPE_PREY_REROLL) then self:setPreyBonusRerolls(self:getPreyBonusRerolls() + reward.rerollCount) DailyReward.insertHistory(self:getGuid(), self:getDayStreak(), "Claimed reward no. \z " .. self:getDayStreak() + 1 .. ". Picked reward: " .. reward.rerollCount .. "x Prey bonus reroll(s)") DailyReward.processReward(playerId, source) end return true end function Player.sendError(self, error) local msg = NetworkMessage() msg:addByte(ServerPackets.ShowDialog) msg:addByte(0x14) msg:addString(error) msg:sendToPlayer(self) end function Player.sendRestingAreaState(self, zone, state) local msg = NetworkMessage() if self:getClient().os == CLIENTOS_NEW_WINDOWS then msg:addByte(ServerPackets.RestingAreaState) msg:addByte(zone) -- [1 if protection zone, 0 if not] msg:addByte(state) -- [inactive = 0, active = 1] if state == 1 then msg:addString("Within Resting Area") else msg:addString("Resting Area (no active bonus)") end msg:sendToPlayer(self) end end function Player.sendDailyRewardCollectionState(self, state) local msg = NetworkMessage() msg:addByte(ServerPackets.DailyRewardCollectionState) msg:addByte(state) msg:sendToPlayer(self) end function Player.sendRewardHistory(self) local msg = NetworkMessage() msg:addByte(ServerPackets.DailyRewardHistory) local entries = DailyReward.retrieveHistoryEntries(self:getId()) if #entries == 0 then self:sendError("You don't have any entries yet.") return false end msg:addByte(#entries) for k, entry in ipairs(entries) do msg:addU32(entry.timestamp) msg:addByte(0) -- (self:isPremium() and 0 or 0) msg:addString(entry.description) msg:addU16(entry.daystreak + 1) end msg:sendToPlayer(self) end function Player.readDailyReward(self, msg, currentDay, state) local dailyTable = DailyReward.rewards[currentDay] local type, systemType = dailyTable.type, dailyTable.systemType local rewards = nil if (state == DAILY_REWARD_STATUS_FREE) then rewards = dailyTable.freeAccount else rewards = dailyTable.premiumAccount end msg:addByte(systemType) if (systemType == 1) then if (type == DAILY_REWARD_TYPE_ITEM) then msg:addByte(rewards.itemsToPick) msg:addByte(#rewards.items) for i = 1, #rewards.items do local itemId = rewards.items[i] local itemType = ItemType(itemId) local itemName = itemType:getArticle() .. " " .. getItemName(itemId) local itemWeight = itemType:getWeight() msg:addItemId(itemId) msg:addString(itemName) msg:addU32(itemWeight) end end elseif (systemType == 2) then if (type == DAILY_REWARD_TYPE_STORAGE) then msg:addByte(#rewards.things) for i = 1, #rewards.things do msg:addByte(DAILY_REWARD_SYSTEM_TYPE_OTHER) -- type msg:addU16(rewards.things[i].id * 100) msg:addString(rewards.things[i].name) msg:addByte(rewards.things[i].quantity) end elseif (type == DAILY_REWARD_TYPE_PREY_REROLL) then msg:addByte(DAILY_REWARD_SYSTEM_SKIP) msg:addByte(DAILY_REWARD_SYSTEM_TYPE_PREY_REROLL) msg:addByte(rewards.rerollCount) elseif (type == DAILY_REWARD_TYPE_XP_BOOST) then msg:addByte(DAILY_REWARD_SYSTEM_SKIP) msg:addByte(DAILY_REWARD_SYSTEM_TYPE_XP_BOOST) msg:addU16(rewards.xpminutes) end end end function Player.sendDailyReward(self) local msg = NetworkMessage() msg:addByte(ServerPackets.DailyRewardBasic) msg:addByte(DAILY_REWARD_COUNT) for currentDay = 1, DAILY_REWARD_COUNT do self:readDailyReward(msg, currentDay, DAILY_REWARD_STATUS_FREE) -- Free rewards self:readDailyReward(msg, currentDay, DAILY_REWARD_STATUS_PREMIUM) -- Premium rewards end -- Resting area bonuses local maxBonus = 7 msg:addByte(maxBonus - 1) for i = 2, maxBonus do msg:addString(DailyReward.strikeBonuses[i].text) msg:addByte(i) end msg:addByte(1) -- Unknown msg:sendToPlayer(self) end local items = {} local function sendItemChoose(player, items, current) local playerId = player:getId() local dailyTable = DailyReward.rewards[player:getDayStreak() + 1] if not dailyTable then self:sendError("Something went wrong and we cannot process this request.") return false end if player:isPremium() then rewards = dailyTable.premiumAccount else rewards = dailyTable.freeAccount end local window = ModalWindow { title = 'Daily Reward Wall', message = 'Please choose '.. rewards.itemsToPick ..' items of the list.' } if not items.table then items.table = {} -- empty table for i = 1, #rewards.items do local itemId = rewards.items[i] local itemType = ItemType(itemId) local itemName = itemType:getArticle() .. " " .. getItemName(itemId) items.table[i] = { id = i, itemId = itemId, itemName = itemName, amount = 0 } end else items.table = items.table end -- Adding choices for i = 1, #items.table do local id = items.table[i].itemId local name = items.table[i].itemName local itemId = items.table[i].id local amount = items.table[i].amount local choice = window:addChoice(name .. " : " .. amount) choice.id = id end local currentCount = 0 for i = 1, #items.table do local count = items.table[i].amount currentCount = currentCount + count end local remainingItems = rewards.itemsToPick - currentCount window:addButton('<', function(button, choice) items.table[choice.id].amount = math.max(0, items.table[choice.id].amount - 1) sendItemChoose(player, items, choice) end) window:addButton('|>>', function(button, choice) items.table[choice.id].amount = math.max(0, items.table[choice.id].amount + remainingItems) sendItemChoose(player, items, choice) end) window:addButton('Confirm', function(button, choice) if currentCount ~= rewards.itemsToPick then sendItemChoose(player, items, choice) return false end local descount, totalCap = 0, 0 for i = 1, #items.table do local item = items.table[i] local count = item.amount if count ~= 0 then descount = descount + 1 totalCap = totalCap + ItemType(item.itemId):getWeight(count) end end if player:getFreeCapacity() < totalCap then player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You do not have enough capacity to claim the reward.") return false end local inbox = player:getSlotItem(CONST_SLOT_STORE_INBOX) if inbox and inbox:getEmptySlots() < descount then player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Please make sure you have free slots in your store inbox.") return false end local description = "" local j = 1 for i = 1, #items.table do local item = items.table[i] local count = item.amount if count ~= 0 then inbox:addItem(item.itemId, count) if j ~= descount then description = description .. "" .. item.amount .. "x " .. getItemName(item.itemId) .. ", " else description = description .. "" .. item.amount .. "x " .. getItemName(item.itemId) .. "." end j = j + 1 end end player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have claimed " .. description) DailyReward.insertHistory(player:getGuid(), player:getDayStreak(), "Claimed reward no. \z " .. player:getDayStreak() + 1 .. ". Picked items: " .. description) DailyReward.pickedReward(playerId) end) window:addButton('Abort') window:sendToPlayer(player) end Você tem alguma imagem que possa auxiliar no problema? Se sim, coloque-a aqui.
  5. Eu quero deixar o sistema como atual igual global, para gerenciamento de backpackys e itens, porem o meu autoloot não pega o loot sozinho tem que abrir o bixo, gostaria que somente ao matar coletasse sozinho o loot.
  6. desculpe reviver o topico, como deixo o comando !autoloot pra ativar o sistema e o restante pra gerenciar pelo (manager loot containers) Meu é tfs 1.3 versao 12.3
  7. voce tem como enviar o tutoria completo de como add o auto loot, tambem na tfss 1.3 v12+ queriaum que nao precisa cicar no bixo ee auto envia pra bp
  8. conseguiu fazer isso amigo?
  9. feipedorp postou uma resposta no tópico em Suporte Tibia OTServer
    .Qual servidor ou website você utiliza como base? OT MANAGER TSFS 1.3 V 12+ Qual o motivo deste tópico? O quick loot, funciona somente no bixo de cima, exempo matei um bixo ele morreu, e matei outro no mesmo sqm so consigo pegar o de cima o de baixo não pega, e tambem somente funciona se clicar no bixo, nao pega sozinho. como arrumo? Está surgindo algum erro? Se sim coloque-o aqui. Você tem o código disponível? Se tiver publique-o aqui: QuickLootSystem = { Developer = "Ticardo (Rick), lBaah, dudantas, gpedro, DudZ", Version = "1.0", lastUpdate = "29/03/2020 - 12:00" } --[[ missing features: - autowalk if corpse is far (+1sqm) - better loot messages - update container to refresh quickLootFlags after save quickloot backpacks ]]-- local ClientPackets = { ManageItemList = 0x91, SelectBackpack = 0x90, LootCorpse = 0x8F } local ServerPackets = { SendBackpack = 0xC0 } -- TODO: check a better storage no local StorageQuickLoot = { ItemsToLoot = "831831", LootMode = 832832, MainContainerFallback = 833833, } local QUICKLOOT_CATEGORY_ATTRIBUTE = "quickLootCategory" local QUICKLOOT_MODE_BLACKLIST = 0 local QUICKLOOT_MODE_WHITELIST = 1 local QuickLootCategory = { UnassignedLoot = 31, Gold = 30, Armors = 1, Amulets = 2, Boots = 3, Containers = 4, CreatureProducts = 24, Decoration = 5, Food = 6, Helmets = 7, Legs = 8, Others = 9, Potions = 10, Rings = 11, Runes = 12, Shields = 13, Tools = 14, Valuables = 15, WeaponsAmmo = 16, WeaponsAxe = 17, WeaponsClubs = 18, WeaponsDistance = 19 , WeaponsSwords = 20, WeaponsWands = 21, StashRetrieve = 27, } local QuickLootReturn = { ITEM_LOOTED = { looted = true, id = 1, message = ""}, ITEM_WITH_NO_CATEGORY = {looted = false, id = 2, message = "Couldn't find the category for this item."}, PLAYER_HAS_NO_BP_AND_FALLBACK_DISABLED = {looted = false, id = 3, message = "Couldn't find any of the loot containers defined for this item."}, COULD_NOT_FIND_ANY_BP = {looted = false, id = 4, message = "Couldn't find any of the loot containers defined for this item."}, NO_FREE_SLOTS_LEFT = {looted = false, id = 5, message = "There is no empty slots left in the loot containers defined."}, NO_CAPACITY ={looted = false, id = 6, message = "You don't have enough capacity."} } function onRecvbyte(player, msg, byte) setupDatabase() if byte == ClientPackets.ManageItemList then local lootMode = msg:getByte() local itemCount = msg:getU16() local itemList = {} if itemCount >= 1 then local item = nil for i = 1, itemCount do item = Game.getItemIdByClientId(msg:getU16()) if item then table.insert(itemList, item:getId()) end end end player:setQuickLootMode(lootMode) player:setQuickLootItems(itemList) player:sendLootBackpacks() elseif byte == ClientPackets.LootCorpse then -- TODO add spam protection local position = msg:getPosition() local itemId = msg:getU16() local stackPos = msg:getByte() local lootMode = player:getQuickLootMode() local lootList = player:getQuickLootItems() local quickLootBackpacks = player:getQuickLootBackpacks() if position.x == CONTAINER_POSITION then local container = player:getContainerById(position.y - 64) if container then local item = container:getItem(position.z) if item then local itemLooted = lootItem(player, quickLootBackpacks, item) if not itemLooted.looted then player:sendCancelMessage(itemLooted.message) else player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You looted " .. item:getCount().. "x "..item:getName() .. ".") end return end end end local itemTile = Tile(position) if not itemTile then return end if player:getPosition():getDistance(position) > 1 then return end local thing = itemTile:getThing(stackPos) if thing then local corpseOwner = thing:getCorpseOwner() if corpseOwner ~= 0 and not player:canOpenCorpse(corpseOwner) then player:sendCancelMessage("You are not the owner.") return end if thing:isContainer() then local itemsBefore = getContainerItems(thing) if #itemsBefore == 0 then player:sendTextMessage(MESSAGE_LOOT, "No loot.") return end lootContainer(player, quickLootBackpacks, thing, lootMode, lootList) local itemsAfter = getContainerItems(thing) local lootedItems = {} local notLootedItemsFromList = {} local notLootedItemsAtAll = {} for i, k in pairs(itemsBefore) do local itemStr = k:getCount().. "x "..k:getName() if not table.contains(itemsAfter, k) then table.insert(lootedItems, itemStr) player:updateLootTracker(k) elseif canLootItem(k.itemid, lootMode, lootList) then table.insert(notLootedItemsFromList, itemStr) else table.insert(notLootedItemsAtAll, itemStr) end end if #lootedItems > 0 then player:sendTextMessage(MESSAGE_LOOT, "You looted " .. table.concat(lootedItems, ", ") .. ".") else player:sendTextMessage(MESSAGE_LOOT, "You looted none of the dropped items.") end if #notLootedItemsFromList > 0 then player:sendCancelMessage("Could not loot " .. table.concat(notLootedItemsFromList, ", ") .. ".") end elseif thing:isItem() and canLootItem(thing.itemid, lootMode, lootList) then local itemType = thing:getType() if itemType:isCorpse() then return end local itemLooted = lootItem(player, quickLootBackpacks, thing) if not itemLooted.looted then player:sendCancelMessage(itemLooted.message) else player:sendTextMessage(MESSAGE_LOOT, "You looted " .. item:getCount().. "x "..item:getName() .. ".") end end end elseif byte == ClientPackets.SelectBackpack then local action = msg:getByte() if action == 0 then local category = msg:getByte() local containerType = msg:getU16() local containerSlot = msg:getU16() local containerPosition = msg:getByte() local containerId = msg:getU16() player:setQuickLootBackpack(category, containerSlot, containerPosition, containerId) player:sendLootBackpacks() player:updateQuickLootContainers() elseif action == 1 then local category = msg:getByte() player:setQuickLootBackpack(category, nil) player:sendLootBackpacks() player:updateQuickLootContainers() elseif action == 2 then local categoryId = msg:getByte() local quickLootBackpacks = player:getQuickLootBackpacks() if quickLootBackpacks[categoryId] then local category = quickLootBackpacks[categoryId] local container = getContainerByQuickLootCategory(player, categoryId, category.sid) if container then player:sendContainer(container) end end elseif action == 3 then local bpFallback = player:getQuickLootMainContainerFallback() if bpFallback ~= nil then player:setQuickLootMainContainerFallback((bpFallback == 1) and 0 or 1) else player:setQuickLootMainContainerFallback(1) end player:sendLootBackpacks() end end end -- Helpers Methods function getContainerItems(container) local rtn = {} for i = 0, container:getSize() do local item = container:getItem(i) if item then table.insert(rtn, item) if item:isContainer() then thisItems = getContainerItems(item) for i,k in pairs(thisItems) do table.insert(rtn, k) end end end end return rtn end function canLootItem(itemId, lootMode, lootList) if lootMode == QUICKLOOT_MODE_BLACKLIST then return not table.contains(lootList, itemId) end if lootMode == QUICKLOOT_MODE_WHITELIST then return table.contains(lootList, itemId) end return false end function lootContainer(player, backpacks, containerItem, lootMode, lootList) local container = Container(containerItem.uid) for i = 0, container:getSize() do local item = container:getItem(i) if item then if item:isContainer() then lootContainer(player, backpacks, item, lootMode, lootList) elseif item:isItem() then if canLootItem(item.itemid, lootMode, lootList) then if lootItem(player, backpacks, item).looted then lootContainer(player, backpacks, container, lootMode, lootList) break end end end end end end function lootItem(player, backpacks, item) if item:getWeight() > player:getFreeCapacity() then return QuickLootReturn.NO_CAPACITY end local itemType = ItemType(item.itemid) if not itemType or not itemType:getLootCategory() then return QuickLootReturn.ITEM_WITH_NO_CATEGORY end local category = itemType:getLootCategory() local definedBackpack = backpacks[category] -- If there is no bp defined for this category, set UnassignedLoot backpack as the target if not definedBackpack then category = QuickLootCategory.UnassignedLoot definedBackpack = backpacks[category] end local destination = false -- If there is no UnassignedLoot backpack defined or the player don't have the backpack in their inventory, set destination as the mainBp if fallback is enabled if not definedBackpack or not player:getItemCount(definedBackpack.sid) then if player:getQuickLootMainContainerFallback() == 1 then destination = player:getSlotItem(CONST_SLOT_BACKPACK) else return QuickLootReturn.PLAYER_HAS_NO_BP_AND_FALLBACK_DISABLED end end if not destination then destination = getContainerByQuickLootCategory(player, category, definedBackpack.sid) end if not destination then return QuickLootReturn.COULD_NOT_FIND_ANY_BP end -- check freeSlot (if you dont check, it will add items even being beyond backpack capacity) if destination:getEmptySlots() == 0 then -- search for another BP form MainBP like this with FreeSlots -- if cannot have slot to move, find next container inside selected backpack (or another container == this one in other backpack (recursive performance loss?)) -- else if it's fully full -- move to UnassignedLoot (avoid redundancy checks by checking category again here, if it's already UnassignedLoot you can just go to main container) -- if cannot have slot to move, find next container inside UnassignedLoot backpack -- else if it's fully full -- if main container fallback is enabled, move to main cotainer -- else ignore (and send message to user) destination = getFirstFreeBPOfType(player:getSlotItem(CONST_SLOT_BACKPACK), destination.itemid) if not destination and not category == QuickLootCategory.UnassignedLoot then destination = getFirstFreeBPOfType(player:getSlotItem(CONST_SLOT_BACKPACK), backpacks[QuickLootCategory.UnassignedLoot].sid) end if not destination and player:getQuickLootMainContainerFallback() == 1 then destination = getFirstFreeBPOfType(player:getSlotItem(CONST_SLOT_BACKPACK), player:getSlotItem(CONST_SLOT_BACKPACK).itemid) end if not destination then return QuickLootReturn.NO_FREE_SLOTS_LEFT end end item:moveTo(destination) return QuickLootReturn.ITEM_LOOTED end function getFirstFreeBPOfType(rootContainer, bpSID) if rootContainer.itemid == bpSID and rootContainer:getEmptySlots() > 0 then return rootContainer end for i = 0, rootContainer:getSize() - 1 do local item = rootContainer:getItem(i) if item:isContainer() then local foundOurBP = getFirstFreeBPOfType(item, bpSID) if foundOurBP then return foundOurBP end end end return nil end function getContainerBySlot(player, containerSlot, containerIndex) local item local container = player:getContainerById(containerSlot - 64) if container then item = container:getItem(containerIndex) else item = player:getSlotItem(containerSlot) end return item end function getContainerByQuickLootCategory(player, categoryId, serverId) local inbox = player:getSlotItem(CONST_SLOT_STORE_INBOX) if inbox then local itemsCount = inbox:getItemCountById(serverId) if itemsCount then local insideInbox = checkContainerCategory(inbox, categoryId) if insideInbox then return insideInbox end end end local mainBp = player:getSlotItem(CONST_SLOT_BACKPACK) if mainBp and mainBp:hasQuickLootCategory(categoryId) then return mainBp end local itemsCount = player:getItemCount(serverId) if not itemsCount then -- If this player doesn't have any BP like its the set one in the inventory, use mainBP as fallback return nil end local insideBp = checkContainerCategory(mainBp, categoryId) if insideBp then return insideBp end return nil end function checkContainerCategory(containerItem, categoryId) if not containerItem then return nil end local container = Container(containerItem.uid) if container then if container:hasQuickLootCategory(categoryId) then return container end for i = 0, container:getSize() - 1 do local item = container:getItem(i) if item:isContainer() then local nestedContainer = checkContainerCategory(item, categoryId) if nestedContainer then return nestedContainer end end end end return nil end -- Container Methods function Container.hasQuickLootCategory(self, categoryId) return self:getCustomAttribute(string.format("%s%d", QUICKLOOT_CATEGORY_ATTRIBUTE, categoryId)) == 1 end function Container.addQuickLootCategory(self, categoryId) self:setCustomAttribute(string.format("%s%d", QUICKLOOT_CATEGORY_ATTRIBUTE, categoryId), 1) end function Container.removeQuickLootCategory(self, categoryId) self:removeCustomAttribute(string.format("%s%d", QUICKLOOT_CATEGORY_ATTRIBUTE, categoryId)) end -- Player Methods function Player.sendLootBackpacks(self) local playerId = self:getGuid() local containers = {} local count = 0 local rows = db.storeQuery("SELECT `category_id`, `cid`, `sid` FROM `quickloot_containers` WHERE player_id = " .. playerId) if rows then repeat local categoryId = result.getNumber(rows, "category_id") local clientId = result.getNumber(rows, "cid") local serverId = result.getNumber(rows, "sid") if getContainerByQuickLootCategory(self, categoryId, serverId) then count = count + 1 containers[categoryId] = clientId end until not result.next(rows) result.free(rows) end local msg = NetworkMessage() msg:addByte(ServerPackets.SendBackpack) msg:addByte(self:getQuickLootMainContainerFallback() or 1) msg:addByte(count) for categoryId, clientId in pairs(containers) do msg:addByte(categoryId) -- if categoryId == QuickLootCategory.UnassignedLoot and not clientId then --clientId = -- end msg:addU16(clientId) end msg:sendToPlayer(self) end function Player.setQuickLootBackpack(self, categoryId, containerSlot, containerPosition, containerId) local playerId = self:getGuid() -- if is just remove instead replace if not containerSlot then local oldContainerQuery = db.storeQuery("SELECT `sid` FROM `quickloot_containers` WHERE player_id = " .. playerId .. " and category_id = " .. categoryId) if oldContainerQuery then local serverId = result.getNumber(oldContainerQuery, "sid") local oldContainer = getContainerByQuickLootCategory(self, categoryId, serverId) if oldContainer then oldContainer:removeQuickLootCategory(categoryId) end end result.free(oldContainerQuery) db.query("DELETE FROM `quickloot_containers` WHERE `player_id` = " .. playerId .. " AND `category_id` = " .. categoryId) return end -- check if already exists local query = db.storeQuery("SELECT COUNT(category_id) as c FROM `quickloot_containers` WHERE player_id = " .. playerId .. " AND `category_id` = " .. categoryId) local count = result.getNumber(query, "c") result.free(query) local container = getContainerBySlot(self, containerSlot, containerPosition) if not container then return end if container.itemid == GOLD_POUCH and categoryId ~= QuickLootCategory.Gold then self:sendCancelMessage(RETURNVALUE_NOTPOSSIBLE) return end -- if exists another value, remove custom attribute local oldServerId = container.itemid local oldContainer = getContainerByQuickLootCategory(self, categoryId, oldServerId) if oldContainer then oldContainer:removeQuickLootCategory(categoryId) end -- and add custom attribute to new container local serverId = container.itemid if not container:hasQuickLootCategory(categoryId) then container:addQuickLootCategory(categoryId) end if count == 0 then db.query("INSERT INTO `quickloot_containers` (`player_id`, `category_id`, `cid`, `sid`) VALUES (" .. playerId .. ", " .. categoryId .. ", " .. containerId .. ", " .. serverId .. ");") return end db.query('UPDATE `quickloot_containers` SET `cid` = ' .. containerId .. ', `sid` = ' .. serverId.. ' WHERE `player_id` = ' .. playerId .. ' AND `category_id` = ' .. categoryId .. '') end function Player.getQuickLootBackpacks(self) local playerId = self:getGuid() local query = db.storeQuery("SELECT `category_id`, `cid`, `sid` FROM `quickloot_containers` WHERE player_id = " .. playerId) local containers = {} if query then repeat local categoryId = result.getNumber(query, "category_id") local clientId = result.getNumber(query, "cid") local serverId = result.getNumber(query, "sid") containers[categoryId] = { cid = clientId, sid = serverId, } until not result.next(query) result.free(query) end return containers end function Player.resetQuickLootItems(self) self:setQuickLootItems({}) end function Player.getQuickLootMode(self) return self:getStorageValue(StorageQuickLoot.LootMode) end function Player.getQuickLootMainContainerFallback(self) return self:getStorageValue(StorageQuickLoot.MainContainerFallback) end function Player.setQuickLootMode(self, check) self:setStorageValue(StorageQuickLoot.LootMode, check or 0) end function Player.setQuickLootMainContainerFallback(self, check) self:setStorageValue(StorageQuickLoot.MainContainerFallback, check or 0) end function Player.setQuickLootItems(self, items) if type(items) ~= "table" then items = {} end self:setSpecialStorage(StorageQuickLoot.ItemsToLoot, items) end function Player.getQuickLootItems(self) local value = self:getSpecialStorage(StorageQuickLoot.ItemsToLoot) if not value then return {} end return value end function Player.updateQuickLootContainers(self) -- local quickLootCategories = self:getQuickLootBackpacks() -- for i = QuickLootCategory.Armors, QuickLootCategory.StashRetrieve do -- getContainerByQuickLootCategory(self, i, ) -- end end function setupDatabase() db.query([[CREATE TABLE IF NOT EXISTS `quickloot_containers` ( `player_id` INT NOT NULL, `category_id` INT UNSIGNED NOT NULL, `cid` INT UNSIGNED NOT NULL, `sid` INT UNSIGNED NOT NULL, CONSTRAINT `fk_quickloot_containers_player_id` FOREIGN KEY (`player_id`) REFERENCES `players` (`id`) )]]) end Você tem alguma imagem que possa auxiliar no problema? Se sim, coloque-a aqui.
  10. .Qual servidor ou website você utiliza como base? ot manager Qual o motivo deste tópico? PREMIUM ACCOUNT Está surgindo algum erro? Se sim coloque-o aqui. Você tem o código disponível? Se tiver publique-o aqui: Você tem alguma imagem que possa auxiliar no problema? Se sim, coloque-a aqui.
  11. feipedorp postou uma resposta no tópico em Suporte Tibia OTServer
    UP TSF 1.3 ALGUEM?
  12. feipedorp postou uma resposta no tópico em Suporte Tibia OTServer
    Nossa amigo por um momento achei que tinha funcionado reloguei n deu erro ai derrepente aparece conforme imagem, mandei em anexo como coloquei no arquivo xml e no script e tambem o erro que aparece, e mais uma vez desculpa te encher as paciencia
  13. feipedorp postou uma resposta no tópico em Suporte Tibia OTServer
    agr deu o seguinte erro [Warning - Event::checkScript] Event onStepOut not found. scripts/others/sumon_tile.lua Reloaded: movements. essa parte do script no tfs atua sera que é diferente tbm?
  14. feipedorp postou uma resposta no tópico em Suporte Tibia OTServer
    Oi amigo tudo bom? eu fiz como pediu mais apresentou o seguinte erro e o summon continua entrando.
  15. feipedorp postou uma resposta no tópico em Suporte Tibia OTServer
    amigao o T ja arrumo olha o erro abaixo no log
  16. feipedorp postou uma resposta no tópico em Suporte Tibia OTServer
    amigao ja coloquei o script da maneira que vc disse com o T maiusculo ele nao funciona, o tfs talvez esteja interpretando com t minúsculo e acusando erro. nao tenho culpa que ele n funciona. esta igual a foto abaixo e quando relogo o globalevents e da o erro informado.
  17. feipedorp postou uma resposta no tópico em Suporte Tibia OTServer
    voce diz criar um item com esse movement ai, ai quando a pessoa passar por ele simplesmente o sumon vai dessaparecer?
  18. feipedorp postou uma resposta no tópico em Suporte Tibia OTServer
    Meu escript esta com o T Maiúsculo igual abaixo script abaixo ja foi corrigo e o erro permanece igual anteriomente. manda script completo de forma correta por favor...agradeço amigo function onThink(cid, interval, lastExecution) local CentroTreiner = Position(32536, 32480, 15) local TreinerName = "training machine" local specM, spec =Game.getSpectators(CentroTreiner, false, false, A, B, C, D) for i = 1, #specM do spec = specM if spec:isMonster() and spec:getName():lower() ~= treinerName:lower() then spec:remove() end end end O seu amigo so não deixou fazer a magia dentro do local mais quando o cara entra com o sumon dentro desse local ele entra junta e nao some. sera que devemos colocar em global event esse seu script?
  19. feipedorp postou uma resposta no tópico em Suporte Tibia OTServer
    deu erro da foto o scrit esta assim : function onThink(cid, interval, lastExecution) local CentroTreiner = Position(32536, 32480, 15) local TreinerName = "training machine" local specM, spec =Game.getSpectators(CentroTreiner, false, false, A, B, C, D) for i = 1, #specM do spec = specM if spec:isMonster() and spec:getName():lower() ~= treinerName:lower() then spec:remove() end end end
  20. feipedorp postou uma resposta no tópico em Suporte Tibia OTServer
    Nao entendi muito bem tem como montar pra mim de forma correta pq nao esta indo... Começo dos trainer é Position: 32327, 32480, 15 MEIO É Position: 32536, 32480, 15 final é Position: 32634, 32481, 15 desculpe pela minha ignorancia é pq tentei mais n funcionou.
  21. feipedorp postou uma resposta no tópico em Suporte Tibia OTServer
    não entendi você é o mesmo cara de cima? essa posição que esta no seu script é do centro da area de trainer? deu erro aqui
  22. feipedorp postou uma resposta no tópico em Suporte Tibia OTServer
    certo, mais tipo eu coloco posicao inicia igual da foto em anexo, e dps pos final. tudo que estiver entre esses sqm informado tera o comando do script? ou tenho que colocar sqm por sqm ? se possivel de um exemplo por favor.
  23. feipedorp postou uma resposta no tópico em Suporte Tibia OTServer
    .Qual servidor ou website você utiliza como base? OT MANAGER TSF1.3 Qual o motivo deste tópico? RUNES CHARMS Está surgindo algum erro? Se sim coloque-o aqui. Você tem o código disponível? Se tiver publique-o aqui: Você tem alguma imagem que possa auxiliar no problema? Se sim, coloque-a aqui.
  24. feipedorp postou uma resposta no tópico em Suporte Tibia OTServer
    Mais como vou relacionar esse creaturescript com essa area?@FlameArcixt

Informação Importante

Confirmação de Termo