Líderes
-
-
-
Sarah Wesker
MembroPontos4Total de itens -
Conteúdo Popular
Exibindo conteúdo com a maior reputação em 01/02/19 em todas áreas
-
#mda2018 - Melhores do Ano no Tk (listão)
Feliz 2019! Eu desejo que todos tenham um próspero início de ano, agradeço por tudo que aconteceu no Tk no ano passado. Um caloroso obrigado a todos vocês que contribuem nas seções de tutoriais e suporte, vocês são fodas! Separei alguns dos tópicos mais interessantes postados em 2018, eles serão promovidos na página oficial do Tk no face todos os dias até 10/janeiro! Deixe seu joinha em: https://www.facebook.com/TibiaKing/ ? #MDA Acompanhe as publicações em: https://www.facebook.com/TibiaKing/ Programado para os próximos dias: 25/12 • OTHire 7.4 Empera server + Port Hope + spr + dat + website • Snow rain system todos ACC • Paletas organizadas para map editor 10.x e 11.x • OTclient, adicionar novos outfits COMPLETO • Ice Map • SadSoul - OLD Karmia 7.72 | Mysql | OTHIRE | Client | Website 26/12 • RME Solução de bugs • OTCLIENT Criando um botão • War system 0.4 fix cast system • Magnus task system tfs 1.2 • Hell Dungeon cave hunt 11.40 • Pacote de OTs clássicos 8.10 • Teleport com janela tfs 1.3 • Nightmare seal dungeon cavehunt 11.40 27/12 • Adicionar novos elementos tfs 0.3.6 • Água transparente • Compilar tfs otx windows • Asura tower cave hunt 11.40 • Teleport System • TFS 0.4.3 edição exclusiva • Labia system 8.60 • Ancient scarab lair cavehunt 8.60 28/12 • Top fraggers system • Carlin Revamp 2.0 • Sistema bancário tfs 1.2 • Sistema de honra tfs 1.2 • Adicionar sprites, editar itens e gerar .otb • Os melhores packs 860 antigos e atuais 29/12 • Video-tutorial arrumando shop tibia 11.x • Servidor DBOTeach 8.6 Htdocs + Database + Client + Server • Poke X CaZzy 1.0 • Como proteger suas sprites • NTO Ultra 8.60 • Transformar imagem em odb 30/12 • Silverhand Livrary Map • [Lua & C++] getOtsysTime() + getPlayerPing(cid) + doPlayerSendPing(cid) • Tutorial mudar versão do mapa • Baú SAO - Sistema de quest • Fire Palace - Cave hunt 8.60 • Global Save + Restarter • Giant Spiders - Cave Hunt 8.60 • Tile party tfs 1.1+ 31/12 • Tutorial preencher items.otb facilmente • Pack de websites NTODBO • Update ProtocolGame::AddPlayerStats - TFS 1.3 & OTX 3 • Evellor Island Map • Limpar characters Inativos / Account vazias • Como criar um website POKETIBIA 01/01 • Deeplings loach cavehunt 11.40 • Creature information Offset • Spy System • Video-tutorial criando client 10.x • Divulgar pag do face no site • ReCAPTCHA by google • Yielothax Nest cave hunt 11.40 • Channel Help Mute tfs 0.4 02/01 • Hydra mountain cave hunt 8.60 • Alvos específicos em spells de area • Emote spells dinâmico • Hp/Mp 100/100 sem bugs • Guild id 0 doesn't exist - Como corrigir • Dragons Dungeon cave hunt 8.60 • Otclient last version • Store items tfs 1.2 • Nto Brasil attack speed tfs 0.3/0.4 • Medusa Sanctuary cave hunt 8.60 03/01 • Custom Depot 8.60 • Fix tfs 0.4 slot bug • Double exp com aviso • Deep desert - Skeleton elite warriors 11.40 (summer update) • The Secret Tomb cave hunt 11.40 • OTXServer 3.1 (10.X - 11.X) - COMPILADO 64 BITS (WINDOWS) - PURO/LIMPO (COM SCAN) • Remover Battle ao entrar em pz • Mathtime, GetStrTime • In game account manager tfs 1.3 OTX3 • Action de casulos de bixos • Fly system tfs 0.4 • Undeads Tower Cave hunt 8.60 04/01 • Como criar um site na umbler • Tiny Editor • Certificado SSL gratuito para o NGINX em UBUNTU 16.04 • Material kit • Airetsam Kit • Código para evitar Nuker • Askarak Demon cavehunt 11.40 • Warzone 4, 5, 6 new asuras falcons • Maps Deepling Ancestorial Grounds and Sunken Temple • Fortbay city cidade completa 11.40 05/01 • [TFS 1.1+] Guild Dungeon Lever (Com tempo) • [TFS 1.2] Exercise Weapons • Bog raider Island 8.60 • War Golem's cave hunt 8.60 • getPlayerSecureMode (cid) / getPlayerFightMode (cid) • [TFS 0.4 / TFS 1.x] Wand/Rod Elemental • Modal elemental Wand • Reunindo fragmentos 8.60 • Area hardcore tfs 1.1 06/01 • Comando Y cores • Adicionar restrição de level e vocação em itens • Tibia dark skin • Wyvern mountain cavehunt 8.60 • Toll clan cavehunt 8.60 • Hero fortress cavehunt 8.60 • Lost tomb cavehunt 8.60 • Ilha pequena 11.49 • Dark Complex cavehunt 8.60 • Crystal Spiders cavehunt 11.40 07/01 • Arcan Isle cavehunt 8.60 • Forbbiden Village 8.60 • Demons dungeon cavehunt 8.60 • Fortress castle 24h 8.60 • Pharaos tomb cavehunt 8.60 • Warlocks Hunt 8.60 • Minotaur Camp 8.60 • Training center 11.40 • Lizard Chosen Cave 11.40 • Dwarf cave treiners 11.40 • Republic Bay 10.77 • Grimeleech dungeon cavehunt 11.40 08/01 • Functions tfs 1.0 • Item temporário tfs 1.x • Spell cooldown janela própria • Monstros que morreram antes de criar tfs 1.3 • Sprite extractor tibia asset 11 to latest tibias client 11.89 • Evento snowball php mapa • Town portal system (dota 2) • Docker na criação de ots • Hidden trap - igual nto br • Criar OTsev em VPS + Site • Teleport Soulpoints • Comando !bless tfs 1.3 • Serialize/Unserialize Strings to Number • Remover item de um player • Testar proteção de client free Obrigado aos membros que publicaram os conteúdos:4 pontos
-
Firestorm Event TFS 1.X
Firestorm Event TFS 1.X
Vodkart e 2 outros reagiu a Sarah Wesker por uma resposta no tópico
3 pontos>> Only TFS 1.X+ << Oi tudo bem, espero que bem. Hoje, apenas começando o ano novo, quero dar-lhe um Firestorm event que eu criei com muito amor para você. Atualmente, há muitos eventos semelhantes, mas espero que você dê uma chance ao meu Firestorm event. Em seguida, vou explicar rapidamente como usar o Firestorm event. (( Passo 1 )) Crie um novo arquivo.lua na pasta: ( data/lib/ ) com o nome ( fire_storm.lua ) Copie e cole o código no arquivo fire_storm.lua --[[ * Fire Storm Event * Evento creado por Sarah Wesker Dia 31 de Diciembre del 2018 a las 12:30 a.m. Version compatible con TFS 1.x+ ]]-- local DEBUG_ON = true local RELOAD_LIB_ON = true local SHOW_COPYRIGHT = true if RELOAD_LIB_ON or not FSE then if not FSE then print([[>>> The Firestorm Event lib loading...]]) end ---@Fire Storm Event FSE = {} ---@Room Properties FSE.room = {} FSE.room.from = Position(3095, 1847, 8) FSE.room.rangeX = 33 FSE.room.rangeY = 31 ---@Temple Position FSE.getTemplePosition = Position(3191, 1809, 7) ---@Attack Properties FSE.attackSignalEffect = CONST_ME_HITBYFIRE FSE.attackEffect = CONST_ME_FIREAREA FSE.attackDistEffect = CONST_ANI_FIRE ---@Player Counts FSE.players = {} FSE.players.min = 2 FSE.players.max = 30 FSE.players.win = 1 -- always less than FSE.players.min ---@Timers in seconds FSE.timer = {} FSE.timer.removeTp = 20 FSE.timer.checking = 2 FSE.timer.signal = {} FSE.timer.signal.min = 0.1 FSE.timer.signal.max = 0.5 FSE.timer.events = {} ---@Game Dificulty FSE.dificulty = {} FSE.dificulty.attacks = 30 FSE.dificulty.increment = 1 FSE.dificulty.D_attacks = FSE.dificulty.attacks FSE.dificulty.D_increment = FSE.dificulty.increment ---@Teleport Properties FSE.teleport = {} FSE.teleport.itemid = 1387 FSE.teleport.position = Position(3187, 1816, 7) FSE.teleport.destination = Position(3111, 1863, 8) FSE.teleport.actionid = 64500 -- movement script aid FSE.status = [[Stoped]] FSE.rewardContainerName = [[Firestorm Reward]] FSE.rewardContainerID = 2596 FSE.rewards = { -- { id = xxxx, count = 1 to 100 } { id = 2160, count = 100 }, { id = 2160, count = 100 } } function FSE:removeTp(seconds) local teleport = FSE.teleport.position:getTile():getItemById(FSE.teleport.itemid) if teleport then teleport:remove() FSE.teleport.position:sendMagicEffect(CONST_ME_POFF) end FSE:CheckControl() end function FSE:Init() if FSE.status == [[Stoped]] then FSE.status = [[Waiting]] local teleport = Game.createItem(FSE.teleport.itemid, 1, FSE.teleport.position) if not teleport then FSE:Stoped() return DEBUG_ON and print([[The Firestorm Event teleport could not be created.]]) else teleport:setActionId(FSE.teleport.actionid) end addEvent(FSE.removeTp, FSE.timer.removeTp * 1000) Game.broadcastMessage(string.format([[The Firestorm Event has been activated, waiting for participants, You have %s to enter.]], getStringTimeEnglish(FSE.timer.removeTp))) else return DEBUG_ON and print([[The Firestorm Event is trying to start, but an active instance already exists.]]) end end function FSE:Stoped(players, causeMessage, forceStoped) FSE.status = [[Stoped]] for index, eventID in pairs(FSE.timer.events) do stopEvent(eventID) end FSE.timer.events = {} for index, player in pairs(players) do player:teleportTo(FSE.getTemplePosition, false) end FSE.getTemplePosition:sendMagicEffect(CONST_ME_TELEPORT) if forceStoped then Game.broadcastMessage([[The Firestorm Event was forced to close.]]) elseif causeMessage then Game.broadcastMessage(causeMessage) end FSE.dificulty.attacks = FSE.dificulty.D_attacks FSE.dificulty.increment = FSE.dificulty.D_increment return true end function FSE:Started(startMessage) FSE.status = [[Started]] if startMessage then Game.broadcastMessage(startMessage) end FSE:CheckControl() end function FSE:AddEvent(eventID) table.insert(FSE.timer.events, eventID) return eventID end local function getWinNames(players) local names = [[]] for index, player in pairs(players) do names = string.format([[%s%s%s]], names, player:getName(), next(players, index) == nil and '.' or [[, ]]) end return names end function FSE:CheckControl() if FSE.status == [[Stoped]] then -- Break Control elseif FSE.status == [[Waiting]] then local players = FSE:GetPlayers() if #players < FSE.players.min then FSE:Stoped(players, [[The Firestorm Event could not be started because there are not enough participants.]]) else FSE:Started() end elseif FSE.status == [[Started]] then local players = FSE:GetPlayers() if #players <= FSE.players.win then if #players == 0 then FSE:Stoped(players, [[The Firestorm Event has ended.]]) else FSE:Stoped(players, string.format([[The Firestorm Event has ended, the winners are: %s]], getWinNames(players))) FSE:SendRewardToPlayers(players) end FSE:AllRightReserve() -- only credits you can remove if want. else for index = 1, FSE.dificulty.attacks do addEvent(FSE.AttackSignal, math.random(FSE.timer.signal.min * 1000, FSE.timer.signal.max * 1000)) end FSE.dificulty.attacks = FSE.dificulty.attacks + FSE.dificulty.increment FSE:AddEvent(addEvent(FSE.CheckControl, FSE.timer.checking * 1000)) end end end function FSE:GetPlayers() local spectators = Game.getSpectators(FSE.room.from, false, true, 1, FSE.room.rangeX, 1, FSE.room.rangeY) local players = {} if spectators and #spectators > 0 then for index, player in pairs(spectators) do if not player:getGroup():getAccess() then players[#players + 1] = player end end end return players end local function getRewardNames(items) local names = [[]] for index, item in pairs(items) do local it = ItemType(item.id) names = string.format([[%s%u %s%s]], names, item.count, it:getName(), next(items, index) == nil and '.' or [[, ]]) end return names end function FSE:SendRewardToPlayers(players) for index, player in pairs(players) do local depotChest = player:getDepotChest(0, true) if depotChest then local rewardContainer = Game.createItem(FSE.rewardContainerID, 1) if rewardContainer then rewardContainer:setName(FSE.rewardContainerName) local rewardNames = getRewardNames(FSE.rewards) for index2, item in pairs(FSE.rewards) do rewardContainer:addItem(item.id, item.count) end if depotChest:addItemEx(rewardContainer, INDEX_WHEREEVER, FLAG_NOLIMIT) then player:sendTextMessage(MESSAGE_INFO_DESCR, string.format([[You have received on your depot chest: %s]], rewardNames)) end end end end end function FSE:GetRandomTile() local foundTile = Tile(FSE.room.from + Position(math.random(0, FSE.room.rangeX), math.random(0, FSE.room.rangeY), 0)) while not foundTile or not foundTile:getGround() or foundTile:hasProperty(CONST_PROP_BLOCKSOLID) do foundTile = Tile(FSE.room.from + Position(math.random(0, FSE.room.rangeX), math.random(0, FSE.room.rangeY), 0)) end return foundTile end function FSE:AttackSignal() local foundTile = FSE:GetRandomTile() if not foundTile then return DEBUG_ON and print([[Not tile could be found in the Firestorm Event area.]]) end local position = foundTile:getPosition() position:sendMagicEffect(FSE.attackSignalEffect) return addEvent(FSE.AttackTile, 500, self, { x = position.x, y = position.y, z = position.z }) end function FSE:AttackTile(tpos) local position = Position(tpos) local creatures = position:getTile():getCreatures() local fromposdist = (position-Position(5, 5, 0)) fromposdist:sendDistanceEffect(position, FSE.attackDistEffect) position:sendMagicEffect(FSE.attackEffect) if creatures and #creatures > 0 then for index, creature in pairs(creatures) do local player = creature:getPlayer() if player and not player:getGroup():getAccess() then position:sendMagicEffect(CONST_ME_POFF) player:teleportTo(FSE.getTemplePosition, false) FSE.getTemplePosition:sendMagicEffect(CONST_ME_TELEPORT) Game.broadcastMessage(string.format([[The player %s has been eliminated from the Firestorm Event.]], player:getName())) end end end end function FSE:AllRightReserve() return SHOW_COPYRIGHT and print([[The Firestorm Event has ended, all rights reserved for Sarah Wesker.]]) end if type(FSE) == [[table]] then print([[>>> The Firestorm Event lib has successfully loaded.]]) end end (( Passo 2 )) Abra o arquivo ( data/lib/lib.lua ) e adicione esta linha: dofile('data/lib/fire_storm.lua') (( Passo 3 )) Abra o arquivo ( data/movements/movements.xml ) e adicione esta linha: <movevent event="StepIn" actionid="64500" script="fire_storm.lua" /> (( Passo 4 )) Vá para a pasta ( data/movements/scripts ) e crie um novo arquivo.lua ( fire_storm.lua ) Copie e cole o seguinte código nesse novo arquivo.lua function onStepIn(creature, item, position, fromPosition) local player = creature:getPlayer() if player then if #FSE:GetPlayers() >= FSE.players.max then player:teleportTo(FSE.getTemplePosition, false) FSE.getTemplePosition:sendMagicEffect(CONST_ME_TELEPORT) else player:teleportTo(FSE.teleport.destination, false) FSE.teleport.destination:sendMagicEffect(CONST_ME_TELEPORT) if not player:getGroup():getAccess() then player:sendTextMessage(MESSAGE_EVENT_ADVANCE, [[Welcome to the Firestorm Event, you have to survive the rain of fire to win.]]) else player:sendTextMessage(MESSAGE_EVENT_ADVANCE, [[Welcome, administrators can only participate as spectators.]]) end end else creature:teleportTo(fromPosition, false) end return true end (( Passo 5 )) Faça o evento começar em um determinado horário! Você abre o arquivo ( data/globalevents/globalevents.xml ) e adicione esta linha: <globalevent name="Firestorm Event" time="12:00:00" script="fire_strom.lua" /> (( Passo 6 )) Crie um novo arquivo.lua dentro da pasta ( data/globalevents/scripts/ ) -> ( fire_storm.lua ) e adicione este código dentro desse arquivo: function onTime(interval) FSE:Init() return true end (( The End )) Aproveite (( Others )) FSE:Init() | Para iniciar o evento. FSE:Stoped() | Para parar o evento. (( REF IMAGES )) | https://prnt.sc/m2a6ov | | https://prnt.sc/m2a6gf | | https://prnt.sc/m2a7t5 |3 pontos -
Anti Clone System [GlobalEvents] Shop.lua[Gesior] / CheckItens.lua
Anti Clone System [GlobalEvents] Shop.lua[Gesior] / CheckItens.lua
adolfbig reagiu a Emersonssss por uma resposta no tópico
1 pontoEm GlobalEvents crie um Arquivo chamado Check.lua local function CheckPlayer_Items() query = db.getResult("SELECT *, SUBSTRING( CONVERT( attributes USING latin1 ) FROM 22) AS 'serial' FROM player_items WHERE CONVERT( attributes USING latin1 ) LIKE '%description%' GROUP BY SUBSTRING( CONVERT( attributes USING latin1 ) FROM 22) having count(*) > 1") if (query:getID() == -1) then textquery = "\n Check Items : Nenhum item encontrado." print(textquery) return true end if (query:getID() ~= -1) then text = "\n[!] -> Deleting item player_items: [Player ID: " .. getPlayerNameByGUID(query:getDataInt("player_id")) .. " - Sid: "..(query:getDataInt("sid")).." - Pid: "..(query:getDataInt("pid")).." - Itemtype: "..(query:getDataInt("itemtype")).." - Serial: " .. query:getDataString("serial") .."" db.query("DELETE FROM `otservs`.`player_items` WHERE `player_items`.`player_id` =" .. (query:getDataInt("player_id")) .. " AND `player_items`.`sid` ="..(query:getDataInt("sid")).." AND `player_items`.`pid` ="..(query:getDataInt("pid"))..";") db.query("DELETE FROM `otservs`.`player_depotitems` WHERE SUBSTRING(CONVERT(attributes USING latin1) FROM 22) = " .. db.escapeString(query:getDataString("serial")) .. ";") db.query("DELETE FROM `otservs`.`tile_items` WHERE SUBSTRING(CONVERT(attributes USING latin1) FROM 22) = " .. db.escapeString(query:getDataString("serial")) .. ";") f = io.open("data/logs/AntiClone.txt", "a+") f:write("Player: "..text.." - " .. os.date("%d %B %Y - %X.", os.time()) .."\n\n----------------------------------------------------------\n") f:close() print(text) if (query:getID() == -1) then textplayer_items = "\n Check Items : Todos os Items Foram Removidos." print(textplayer_items) return true end CheckPlayer_Items() end return true end local function CheckPlayer_DepotItems() query = db.getResult("SELECT *, SUBSTRING( CONVERT( attributes USING latin1 ) FROM 22) AS 'serial' FROM player_depotitems WHERE CONVERT( attributes USING latin1 ) LIKE '%description%' GROUP BY SUBSTRING( CONVERT( attributes USING latin1 ) FROM 22) having count(*) > 1") if (query:getID() == -1) then textquery = "\n Check Items : Nenhum item encontrado." print(textquery) return true end if (query:getID() ~= -1) then text = "\n[!] -> Deleting item player_depotitems: [Player ID: " .. getPlayerNameByGUID(query:getDataInt("player_id")) .. " - Sid: "..(query:getDataInt("sid")).." - Pid: "..(query:getDataInt("pid")).." - Itemtype: "..(query:getDataInt("itemtype")).." - Serial: " .. query:getDataString("serial") .."" db.query("DELETE FROM `otservs`.`player_items` WHERE `player_items`.`player_id` =" .. (query:getDataInt("player_id")) .. " AND `player_items`.`sid` ="..(query:getDataInt("sid")).." AND `player_items`.`pid` ="..(query:getDataInt("pid"))..";") db.query("DELETE FROM `otservs`.`player_depotitems` WHERE SUBSTRING(CONVERT(attributes USING latin1) FROM 22) = " .. db.escapeString(query:getDataString("serial")) .. ";") db.query("DELETE FROM `otservs`.`tile_items` WHERE SUBSTRING(CONVERT(attributes USING latin1) FROM 22) = " .. db.escapeString(query:getDataString("serial")) .. ";") f = io.open("data/logs/AntiClone.txt", "a+") f:write("Player: "..text.." - " .. os.date("%d %B %Y - %X.", os.time()) .."\n\n----------------------------------------------------------\n") f:close() print(text) if (query:getID() == -1) then textplayer_items = "\n Check Items : Todos os Items Foram Removidos." print(textplayer_items) return true end CheckPlayer_DepotItems() end return true end function onStartup() CheckPlayer_Items() CheckPlayer_DepotItems() return true end em globalevents.xml Adicione <globalevent name="AntiClone" type="start" event="script" value="Check.lua"/> Para Adicionar a Opção de Verificar itens Clonados Adicione um Serial em todos os Itens Vips : em shop.lua Adicione ( Modern Acc ) function onThink(interval, lastExecution, thinkInterval) local result = db.getResult("SELECT * FROM shop_history WHERE `processed` = 0;") if(result:getID() ~= -1) then while(true) do cid = getCreatureByName(getPlayerNameByGUID(tonumber(result:getDataInt("player")))) product = tonumber(result:getDataInt("product")) itemr = db.getResult("SELECT * FROM shop_offer WHERE `id` = "..product..";") if isPlayer(cid) then local um_um = {1,2,3,4,5,6,7,8,9,0} um = um_um[math.random(1, #um_um)] local dois_dois = {1,2,3,4,5,6,7,8,9,0} dois = dois_dois[math.random(1, #dois_dois)] local tres_tres = {1,2,3,4,5,6,7,8,9,0} tres = tres_tres[math.random(1, #tres_tres)] local quatro_quatro = {1,2,3,4,5,6,7,8,9,0} quatro = quatro_quatro[math.random(1, #quatro_quatro)] local id = tonumber(itemr:getDataInt("item")) local tid = tonumber(result:getDataInt("id")) local count = tonumber(itemr:getDataInt("count")) local tipe = tonumber(itemr:getDataInt("type")) local productn = tostring(itemr:getDataString("name")) if isInArray({5,8},tipe) then if getPlayerFreeCap(cid) >= getItemWeightById(id, count) then if isContainer(getPlayerSlotItem(cid, 3).uid) then received = doPlayerAddItem(cid, id, count, false) if received then doItemSetAttribute(received, "description", ''.. productn ..' by ' .. getCreatureName(cid) .. ' [ID:' .. um .. '' .. dois .. '' .. tres .. '' .. quatro .. '].') doPlayerSendTextMessage(cid,19, "You have received >> "..productn.." << from our shop system") db.query("UPDATE `shop_history` SET `processed`='1' WHERE id = " .. tid .. ";") f = io.open("data/logs/Shop.txt", "a+") f:write("Player : '".. productn .." by ".. getCreatureName(cid) .." [ID: ".. um .."".. dois .."".. tres .."".. quatro .."] Item : "..productn.." - "..getCreatureName(cid).."- " .. os.date("%d %B %Y - %X.", os.time()) .."\n----------------------------------------------------------\n") f:close() else doPlayerSendTextMessage(cid,19, "Sorry, you don't have enough space on container to receive >> "..productn.." <<") end else doPlayerSendTextMessage(cid,19, "Sorry, you don't have a container to receive >> "..productn.." <<") end else doPlayerSendTextMessage(cid,19, "Sorry, you don't have enough capacity to receive >> "..productn.." << (You need: "..getItemWeightById(id, count).." Capacity)") end elseif isInArray({6,7},tipe) then if tipe == 6 then bcap = 8 bid = 1987 elseif tipe == 7 then bcap = 20 bid = 1988 end if isItemRune(id) then count = 1 end if getPlayerFreeCap(cid) >= (getItemWeightById(1987, 1) + getItemWeightById(id,count * bcap)) then local bag = doCreateItemEx(bid, 1) for i = 1,bcap do doAddContainerItem(bag, id, count) end received = doPlayerAddItemEx(getPlayerSlotItem(cid, 3).uid, bag) if received == RETURNVALUE_NOERROR then doPlayerSendTextMessage(cid,19, "You have received >> "..productn.." << from our shop system") db.query("UPDATE `shop_history` SET `processed`='1' WHERE id = " .. tid .. ";") else doPlayerSendTextMessage(cid,19, "Sorry, you don't have enough space to receive >> "..productn.." <<") end else doPlayerSendTextMessage(cid,19, "Sorry, you don't have enough capacity to receive >> "..productn.." << (You need: "..getItemWeightById(id, count).." Capacity)") end end end itemr:free() if not(result:next()) then break end end result:free() end return true end Tag : <globalevent name="shop" interval="3000" event="script" value="shop.lua"/> Creditos : Emerson Henrique < DBO INFINITY> Comandos e Codigos Adaptados de varios sistemas Ajuda : Arthur Luna (Ajudou no limite de Caracteres) PS : Meu Shop salva na db. apenas o ID do player e não o nome essa Adaptação não vou disponibilizar. http://otsbrasil.com/dbo Servidor Derivado Dragon Ball Online 8.6 + Cast System + War System entre outros sistemas. [ADM] Aaron Autorizo modificações e Postar em Qualquer Forum, esse codigo é meu e fiz de graça e forneço de Graça. PS2 : Se Possivel mudar o Titulo para Anti Clone System [GlobalEvents] Shop.lua[Modern Acc] / CheckItens.lua1 ponto -
(Resolvido)Autoloot TFS 1.3
1 pontoOlá, eu tenho um autoloot e estou tendo dificuldades pra adapta-lo pra modal window. Eu não quero nem adaptar a parte de adicionar, pois acho que fica mais demorado, queria só a parte de remover, com os autoloots listados e o player ia selecionando e clicando no botão de remover, e se der adicionar um outro botão que limpe todo o autoloot. ja tentei de diversas formas, inclusive puxando pela db mas não tive sucesso. local query = db.storeQuery("SELECT `autoloot_list` FROM player_autoloot WHERE `player_id` = "..player:getGuid()) if not query then return 0 end Aqui vai o lua do remove que eu uso atualmente. function onSay(player, words, param) local itemType = ItemType(param) if itemType:getId() == 0 then itemType = ItemType(tonumber(param)) if itemType:getName() == '' then player:sendCancelMessage("There is no item with that id or name.") return false end end if player:getAutoLootItem(itemType:getId()) then player:removeAutoLootItem(itemType:getId()) player:sendTextMessage(MESSAGE_INFO_DESCR, "You're not auto looting " .. itemType:getName() .. " anymore.") else player:sendCancelMessage("You're not autolooting this item.") end return false end1 ponto
-
Aprenda a utilizar 'Metamethods' em TFS 0.4
Fala clã, hoje irei ensiná-los como agrupar funções em uma classe e usá-las como métodos (similar ao TFS 1.x). Bom, primeiramente o que são métodos? Um método é nada mais nada menos que uma função membro de uma classe, destinadas a serem executadas por objetos instanciados. Bom, não irei se aprofundar no assunto, serei direto. Abaixo segue um exemplo da diferença entre uma função e um método: doPlayerSendCancel(player, 'Hello World') -- Função sendo chamada player:sendCancel('Hello World') -- Método sendo chamado por um objeto 'player' Mas afinal, como utilizar métodos em TFS 0.4? Primeiramente teremos que criar uma lib chamada 110-methods.lua e adicionar o seguinte código: Lembrando que não estou publicando tudo pronto, apenas ensinando como agrupar. E esse exemplo será somente para funções relacionadas à criaturas (players, monsters, npcs). ClassCreature = {} -- for creature functions function ClassCreature:new(creature) return setmetatable({uid = creature}, {__index = self}) end function Creature(uid) return ClassCreature:new(uid) end Feito isso, já podemos começar a converter funções em métodos a partir do próprio arquivo uma abaixo da outra. Como faremos? Segue abaixo a conversão da função doPlayerSendCancel: function ClassCreature:sendCancel(message) return doPlayerSendCancel(self.uid, message) -- (no lugar onde estamos acostumados a colocar cid ou player, colocamos self.uid) end Agora a conversão da função doPlayerSendTextMessage: function ClassCreature:sendTextMessage(msg, type) return doPlayerSendTextMessage(self.uid, type, msg) end Assim já podemos utilizar o método em nossos scripts. Com exemplo, segue abaixo um talkaction: function onSay(player) player = Creature(player) -- Instância player:sendTextMessage('Olá ' .. player:getName() .. ', este é um exemplo de como utilizar métodos em TFS 0.4 :)', MESSAGE_INFO_DESCR) player:sendCancel('Você está no nível ' .. player:getLevel() .. ', parabéns!') return true end Obs: é sempre necessário instanciar da mesma forma do exemplo para códigos simples. Para mais complexos, pode-se instanciar quantos objetos quiseres. E para finalizar, irei deixar alguns métodos já agrupados para vocês testarem: data/lib/110-methods.lua : ClassCreature = {} -- for creature functions function ClassCreature:new(creature) return setmetatable({uid = creature}, {__index = self}) end function Creature(uid) return ClassCreature:new(uid) end -- Métodos function ClassCreature:getName() return getCreatureName(self.uid) end function ClassCreature:getLevel() return getPlayerLevel(self.uid) end function ClassCreature:getHealth() return getCreatureHealth(self.uid) end function ClassCreature:getMana() return getCreatureMana(self.uid) end function ClassCreature:sendCancel(msg) return doPlayerSendCancel(self.uid, msg) end function ClassCreature:sendTextMessage(msg, type) return doPlayerSendTextMessage(self.uid, type, msg) end function ClassCreature:getPosition() return getThingPos(self.uid) end function ClassCreature:teleportTo(pos) return doTeleportThing(self.uid, pos) end E é só isso galera, esse é um dos métodos mais simples de se fazer isso. Abraços! Créditos: Todo meu!1 ponto
-
Aprenda a utilizar 'Metamethods' em TFS 0.4
Muito bom dançarino, acho que pra ser um bom programador você precisa ser organizado, então tu já é um ótimo. Você poderia fazer uns tuto de lua pra quem ta começando, os antigos são bem antigos mesmo.1 ponto
-
#mda2018 - Melhores do Ano no Tk (listão)
#mda2018 - Melhores do Ano no Tk (listão)
Bruxo Ots reagiu a xWhiteWolf por uma resposta no tópico
1 pontonossa eu nem sabia que tinha postado algo esse ano hahaha agradeço por ter me mencionado aqui, significa bastante1 ponto -
(Resolvido)Novo gold
1 pontoexatamente como eu queria, Perfeito ! obrigado. agora vou buscar algumas cores diferentes alem desse azul e agradeço desde já1 ponto
-
#mda2018 - Melhores do Ano no Tk (listão)
Feliz ano novo, que esse ano venham coisas boas. Muito bom @Nolis pelo conteúdo continue assim.1 ponto
-
#mda2018 - Melhores do Ano no Tk (listão)
Feliz Ano Novo. Bom, não tenho nem palavras pra agradecer as pessoas que dedicam a menor parte do seu tempo para nus ajudar, ajudar a comunidade TibiaKing. A forma mais positiva e de meu alcance pra agradecer por tudo que vocês fazem pela comunidade é deixando meu rep+ e meu obrigado.1 ponto
-
#mda2018 - Melhores do Ano no Tk (listão)
Booaaa @Nolis meus parabéns pela iniciativa, e um próspero ano a ti também ...1 ponto
-
#mda2018 - Melhores do Ano no Tk (listão)
#mda2018 - Melhores do Ano no Tk (listão)
Cat reagiu a Matheus Duarte2 por uma resposta no tópico
1 pontoFeliz ano novo para todos!!1 ponto -
Firestorm Event TFS 1.X
Firestorm Event TFS 1.X
Sarah Wesker reagiu a Cat por uma resposta no tópico
1 pontoParabéns, seu tópico de conteúdo foi aprovado! Muito obrigado pela sua contribuição, nós do Tibia King agradecemos. Seu conteúdo com certeza ajudará à muitos outros, você recebeu +1 REP.1 ponto -
#mda2018 - Melhores do Ano no Tk (listão)
Que massa Dani, sempre tentando elevar a comunidade de ot seja com mapas ou conteúdos. E meu nome no meio dessas feras aí insano. Parabéns a todos pelos conteúdos e aqueles que não querem ver a comunidade morrer Tmj.1 ponto
-
(Resolvido)Novo gold
1 pontonão sei se ta certo, mas é algo assim: local coins = { [2152] = {to = 2148, effect = TEXTCOLOR_LIGHTBLUE}, [2148] = {to = 2157, from = 2152, effect = TEXTCOLOR_LIGHTBLUE}, [2157] = {to = 9971, from = 2148, effect = TEXTCOLOR_LIGHTBLUE}, [9971] = {to = 9970, from = 2157, effect = TEXTCOLOR_LIGHTBLUE}, [9970] = {from = 9971}, } function onUse(cid, item, fromPosition, itemEx, toPosition) if(getPlayerFlagValue(cid, PLAYERFLAG_CANNOTPICKUPITEM)) then return false end local coin = coins[item.itemid] if(not coin) then return false end if(coin.to ~= nil and item.type == ITEMCOUNT_MAX) then doChangeTypeItem(item.uid, item.type - item.type) doPlayerAddItem(cid, coin.to, 1) doSendAnimatedText(fromPosition, "$$$", coins[coin.to].effect) elseif(coin.from ~= nil) then doChangeTypeItem(item.uid, item.type - 1) doPlayerAddItem(cid, coin.from, ITEMCOUNT_MAX) doSendAnimatedText(fromPosition, "$$$", coins[coin.from].effect) end return true end1 ponto
-
(Resolvido)Novo gold
1 pontoTenho esse script configurado pro meu sv, tenta configurar ele ai Moedas: 2152 -> platinum coin (no meu sv platinum vale menos) 2148 -> gold coin 2157 -> gold nugget 9971 -> gold ingot 9970 -> small topaz actions.xml <action itemid="2148" event="script" value="other/changegold.lua"/> <action itemid="2152" event="script" value="other/changegold.lua"/> <action itemid="2160" event="script" value="other/changegold.lua"/> <action itemid="2157" event="script" value="other/changegold.lua"/> <action itemid="9971" event="script" value="other/changegold.lua"/> <action itemid="9970" event="script" value="other/changegold.lua"/> actions/others local coins = { [2152] = {to = 2148}, [2148] = {to = 2157, from = 2152}, [2157] = {to = 9971, from = 2148}, [9971] = {to = 9970, from = 2157}, [9970] = {from = 9971}, } function onUse(cid, item, fromPosition, itemEx, toPosition) if(getPlayerFlagValue(cid, PLAYERFLAG_CANNOTPICKUPITEM)) then return false end local coin = coins[item.itemid] if(not coin) then return false end if(coin.to ~= nil and item.type == ITEMCOUNT_MAX) then doChangeTypeItem(item.uid, item.type - item.type) doPlayerAddItem(cid, coin.to, 1) elseif(coin.from ~= nil) then doChangeTypeItem(item.uid, item.type - 1) doPlayerAddItem(cid, coin.from, ITEMCOUNT_MAX) end return true end1 ponto
-
DEV C++ Error libxml ao compilar sources
@DEKU KUNNNN o compilador não consegue encontrar a libxml, geralmente se encontra no diretório de inclusão do compilador e por alguma razão não está lá. Utilize esse dev: https://github.com/Fir3element/binaries/raw/master/dev-cpp.rar Ele está completo, só baixe e coloque para compilar.1 ponto
-
Juntar Mapas - Remere
1 ponto@BilauX Tem como você segurar CTRL + SHIFT e você pode selecionar + de 1 andar ! Recomendo do que pegar 1 por 1 ...1 ponto
-
Error 3003 ao compilar sprites Object Builder
Error 3003 ao compilar sprites Object Builder
Belmont reagiu a gustavodd3 por uma resposta no tópico
1 pontoAumentar o limite da Sprites eu não sei mas tem vários tutorial no tk ou no YT, para substituir sprites vc prescisa baixar as sprites, abrir no Object Builder, EXPORTAR, depois abre as sprites do seu servidor e clica com botão direito Substituir e escolhe a sprite q vc exportou (Tem tutorial no TK e no YT tbm) ? espero ter ajudado!1 ponto -
#mda2018 - Melhores do Ano no Tk (listão)
Feliz natal a toda a comunidade Tibiana, espero que continuamos a crescer a cada dia mais ! Abraço e boas festas !!1 ponto
-
[8.60] Hydra Mountain
1 pontoTrouxe pra vocês uma hunt insana de hydras, feita por kacperciu. Ela foi feita para um projeto de styller, no qual eu também participava na época. Mas por algum motivo o mapper desistiu e publicou a hunt, Façam bom uso! IMAGENS DOWNLOADS Link original Download alternativo: hydra.otbm Scan1 ponto
-
[10.77] Little-Dragon [Jobs]
[10.77] Little-Dragon [Jobs]
Marco Oliveira reagiu a Pedro. por uma resposta no tópico
1 pontoCategoria: Mapa. Versão: 10.77 Autor: Jobs Download: Little-Dragon Jobs.rar Scan: VirusTotal Screens;1 ponto