Ir para conteúdo

Mateus Robeerto

Héroi
  • Registro em

  • Última visita

Tudo que Mateus Robeerto postou

  1. saquei, mas eu não estou familiarizado com o Ubuntu 20.4, só com o Windows... Vou tentar sim, já tenho uma máquina virtual e estou instalando o Ubuntu 20.4. Assim que voltar à noite, posso tentar... Já encontrei alguns links de tutoriais para este Ubuntu e como compilar! Também tenho um colega que compila o Ubuntu. Depois dou respostas sobre qual é o comando certo para instalar libs e boots, ok?
  2. Bem interessante, mas é possível para o TFS 1.x?
  3. Qualquer um que você preferir... Vou citar que existem três versões diferentes. O padrão V8 do Kondra é a última versão lançada, ficou bom em desempenho, mas parou de ser desenvolvido. Tem outro V8 da Academy que ainda está em desenvolvimento e também é excelente. E outro com um desempenho ainda melhor é o Mehah versão 3.2. Recomendo baixar apenas a versão mais recente, de acordo com o seu gosto, ok?
  4. Que legal, curti! Você poderia me mostrar como funciona a modal window e a montaria para eu ver, mesmo que seja através de vídeo?
  5. Vi que muitas pessoas estão reclamando e que não funciona, bugs, erros no console, etc. Então, resolvi baixar a base do Thunder feita por MovieBr, atualizei do TFS 1.3 para o TFS 1.5 e corrigi cerca de 80% dos problemas. No entanto, ainda não consigo encontrar alguns bugs. Quem encontrar os bugs pode me relatar pelo Discord: 82mateusroberto. Dependendo do meu dia, pode levar alguns dias para eu responder e corrigir ou não. Acredito que vocês conseguem corrigir os erros, apenas precisam aprender a consertá-los. Não é difícil. Aproveitem para usar como base do seu mapa ou mesmo do projeto Thunder futuramente! Seguem as imagens que mostram a implementação de montaria e modal widow. Obs: Alguns mapas/cavernas podem estar vazios por falta de adição. Eu não tinha boas ideias para adicionar, mas vocês podem adicionar ao seu gosto. Tenham uma boa utilização e sucesso com o projeto no futuro! https://www.mediafire.com/file/0jtn2slt2j67666/baiakthunder-master.rar/file https://www.mediafire.com/file/bougg0q6dlpu2fq/tfs+1.5+source.rar/file https://www.mediafire.com/file/yq1s63xo6np9v53/860.rar/file Este servidor só usa o OtClient. Abra o arquivo otclient/modules/game_feature/feature.lua e procure por esta linha. if (versão >= 860) then adicione abaixo e salve.. pronto g_game.enableFeature(GamePlayerMounts) Aqui estão os GIFs https://imgur.com/UGdQoSS https://imgur.com/OwJ4hpp https://imgur.com/7sN1MaJ Para quem deseja usar uma gamestore personalizada, há uma disponível para TFS 1.5 e 8.6. Já a compartilhei há alguns dias. Dê uma olhada aqui.
  6. Postei sem querer. Agora, sim, está usando o comando !pontos para saber quantos pontos você tem, apenas para o Znote. local talkaction = TalkAction("!points") function Player.getZnotePoints(self) local query = db.storeQuery("SELECT `points` FROM `znote_accounts` WHERE `id` = " .. self:getAccountId()) if not query then return 0 end local value = result.getNumber(query, "points") result.free(query) return value or 0 end function talkaction.onSay(player, words, param, type) if words:lower() == "!points" then local points = player:getZnotePoints() if points > 0 then local message = "Your premium points balance is: " .. points player:popupFYI(message) else player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You don't have premium points.") end return false end return true end talkaction:separator(" ") talkaction:register()
  7. @doukxxt Desculpa pela demora. Os últimos dias foram corridos. Decidi compartilhar isso com vocês Abra o diretório otc/data/layouts/retro/styles/40-inventory.otui e procure por essa linha. Panel id: conditionPanel layout: type: horizontalBox height: 22 padding: 2 anchors.top: slot8.bottom anchors.left: slot6.left anchors.right: slot5.right margin-top: 4 border-width: 1 border-color: #00000077 background-color: #ffffff22 Adicione abaixo disso. StoreButton size: 0 20 anchors.top: prev.bottom anchors.left: parent.left anchors.right: parent.right margin-left: 6 margin-top: 4 margin-right: 6 @onClick: modules.store_module.toggle() Agora, sobre como comprar itens por pontos, vou postar dois tutoriais para Gesior e Znote. APENAS GESIOR.. Este script serve para trocar itens por pontos. Vou dar um exemplo com a Magic Sword. data/scripts. local StoreCustom = TalkAction("!shopMagic Sword") function StoreCustom.onSay(player, words, param) local pointsToDeduct = 10 removePoints(player, pointsToDeduct) local newItemID = 2401 -- Replace with the ID of the item the player will receive local newItemCount = 1 -- Quantity of the new item to be added to the player's inventory player:addItem(newItemID, newItemCount) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have successfully purchased a new item in exchange for" .. pointsToDeduct .. " premium points.") return false end function removePoints(player, amount) local accountId = player:getAccountId() local query = "UPDATE `accounts` SET `premium_points` = `premium_points` - " .. amount .. " WHERE `id` = " .. accountId db.query(query) end StoreCustom:separator(" ") StoreCustom:register() Para saber quantos pontos você tem, digite !points. local talkaction = TalkAction("!points") function Player.getPremiumPoints(self) local query = db.storeQuery("SELECT `premium_points` FROM `accounts` WHERE `id` = " .. self:getAccountId()) if not query then return false end local value = result.getNumber(query, "premium_points") result.free(query) return value end function talkaction.onSay(player, words, param, type) if words:lower() == "!points" then local points = player:getPremiumPoints() if points > 0 then local message = "Your premium points balance is: " .. points player:popupFYI(message) else player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You don't have premium points.") end return false end return true end talkaction:separator(" ") talkaction:register() Para comprar outfits ou addons. local outfitsCustom = TalkAction("!shopMage", "!shopCitizen", "!shopHunter", "!shopKnight", "!shopNoblewoman", "!shopNobleman", "!shopSummoner", "!shopWarrior", "!shopBarbarian", "!shopDruid", "!shopWizard", "!shopOriental", "!shopPirate", "!shopAssassin", "!shopBeggar", "!shopShaman", "!shopNorsewoman", "!shopNorseman", "!shopNightmare", "!shopJester", "!shopBrotherhood", "!shopDemon Hunter", "!shopYalaharian", "!shopNewly Wed", "!shopWarmaster", "!shopWayfarer", "!shopRetro Warrior", "!shopRetro Citizen", "!shopRetro Hunter", "!shopRetro Knight", "!shopRetro Mage", "!shopRetro Noblewoman", "!shopRetro Nobleman", "!shopRetro Summoner") function outfitsCustom.onSay(player, words, param) if words == "/shop" then return false end if words == "!shopMage" then local outfitId = (player:getSex() == PLAYERSEX_FEMALE) and 138 or 130 -- Mage outfit ID local outfitCost = 50 -- Cost in premium_points to acquire the outfit if not player:hasOutfit(outfitId) or not player:hasOutfit(outfitId, 3) then db.query("UPDATE accounts SET premium_points = premium_points - " .. outfitCost .. " WHERE account_id = " .. player:getAccountId()) player:addOutfitAddon(outfitId, 3) -- Add outfit / addons player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN) player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You acquired the Mage outfit addons for " .. outfitCost .. " premium_points!") else player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You already have the Mage outfit!") end ---------------- elseif words == "!shopCitizen" then local outfitId = (player:getSex() == PLAYERSEX_FEMALE) and 136 or 128 -- Citizen outfit ID local outfitCost = 50 -- Cost in premium_points to acquire the outfit if not player:hasOutfit(outfitId) or not player:hasOutfit(outfitId, 3) then db.query("UPDATE accounts SET premium_points = premium_points - " .. outfitCost .. " WHERE account_id = " .. player:getAccountId()) player:addOutfitAddon(outfitId, 3) -- Add Citizen outfit / addons player:getPosition():sendMagicEffect(CONST_ME_MAGIC_RED) player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You acquired the Citizen outfit addons for " .. outfitCost .. " premium_points!") else player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You already have the Citizen outfit!") end ---------------- elseif words == "!shopHunter" then local outfitId = (player:getSex() == PLAYERSEX_FEMALE) and 137 or 129 -- Hunter outfit ID local outfitCost = 50 -- Cost in premium_points to acquire the outfit if not player:hasOutfit(outfitId) or not player:hasOutfit(outfitId, 3) then db.query("UPDATE accounts SET premium_points = premium_points - " .. outfitCost .. " WHERE account_id = " .. player:getAccountId()) player:addOutfitAddon(outfitId, 3) -- Add Hunter outfit / addons player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE) player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You acquired the Hunter outfit addons for " .. outfitCost .. " premium_points!") else player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You already have the Hunter outfit!") end ---------------- elseif words == "!shopKnight" then local outfitId = (player:getSex() == PLAYERSEX_FEMALE) and 139 or 131 -- Knight outfit ID local outfitCost = 50 -- Cost in premium_points to acquire the outfit if not player:hasOutfit(outfitId) or not player:hasOutfit(outfitId, 3) then db.query("UPDATE accounts SET premium_points = premium_points - " .. outfitCost .. " WHERE account_id = " .. player:getAccountId()) player:addOutfitAddon(outfitId, 3) -- Add Knight outfit / addons player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE) player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You acquired the Knight outfit addons for " .. outfitCost .. " premium_points!") else player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You already have the Knight outfit!") end -- Add more commands and messages as necessary end return false end outfitsCustom:separator(" ") outfitsCustom:register() Para comprar uma montaria. local shopsCustom = TalkAction("!shopMidnight Panther", "!shopWidow Queen", "!shopRacing Bird", "!shopWar Bear", "!shopBlack Sheep", "!shopDraptor", "!shopTitanica", "!shopTin Lizzard", "!shopBlazebringer", "!shopRapid Boar", "!shopStampor", "!shopUndead Cavebear", "!shopDonkey", "!shopTiger Slug", "!shopUniwheel", "!shopCrystal Wolf", "!shopWar Horse", "!shopKingly Deer", "!shopTamed Panda", "!shopDromedary", "!shopScorpion King", "!shopDarkbrown Rented Horse", "!shopArmoured War Horse", "!shopShadow Draptor", "!shopGrey Rented Horse", "!shopBrown Rented Horse", "!shopLady Bug", "!shopManta Ray", "!shopIronblight", "!shopMagma Crawler", "!shopDragonling", "!shopGnarlhound", "!shopCrimson Ray", "!shopSteelbeak", "!shopWater Buffalo", "!shopTombstinger", "!shopPlatesaurian", "!shopUrsagrodon", "!shopThe Hellgrip", "!shopNoble Lion", "!shopDesert King", "!shopShock Head", "!shopWalker", "!shopAzudocus", "!shopCarpacosaurus", "!shopDeath Crawler", "!shopFlamesteed", "!shopJade Lion", "!shopJade Pincer", "!shopNethersteed", "!shopTempest", "!shopWinter King", "!shopDoombringer", "!shopWoodland Prince", "!shopHailstorm Fury", "!shopSiegebreaker", "!shopPoisonbane", "!shopBlackpelt", "!shopGolden Dragonfly", "!shopSteel Bee", "!shopCopper Fly", "!shopTundra Rambler", "!shopHighland Yak", "!shopGlacier Vagabond", "!shopShadow Hart", "!shopBlack Stag", "!shopEmperor Deer", "!shopFlying Divan", "!shopMagic Carpet", "!shopFloating Kashmir", "!shopRingtail Waccoon", "!shopNight Waccoon", "!shopEmerald Waccoon", "!shopFlitterkatzen", "!shopVenompaw", "!shopBatcat", "!shopSea Devil", "!shopCoralripper", "!shopPlumfish", "!shopGorongra", "!shopNoctungra", "!shopSilverneck", "!shopSlagsnare", "!shopNightstinger", "!shopRazorcreep", "!shopRift Runner", "!shopNightdweller", "!shopFrostflare", "!shopCinderhoof", "!shopMouldpincer", "!shopBloodcurl", "!shopLeafscuttler", "!shopSparkion", "!shopSwamp Snapper", "!shopMould Shell", "!shopReed Lurker", "!shopNeon Sparkid", "!shopVortexion", "!shopIvory Fang", "!shopShadow Claw", "!shopSnow Pelt", "!shopJackalope", "!shopDreadhare", "!shopWolpertinger", "!shopStone Rhino", "!shopGold Sphinx", "!shopEmerald Sphinx", "!shopShadow Sphinx", "!shopJungle Saurian", "!shopEmber Saurian", "!shopLagoon Saurian", "!shopBlazing Unicorn", "!shopArctic Unicorn", "!shopPrismatic unicorn", "!shopCranium Spider", "!shopCave Tarantula", "!shopGloom Widow", "!shopMole", "!shopMarsh Toad", "!shopSanguine Frog", "!shopToxic Toad", "!shopEbony Tiger", "!shopFeral Tiger", "!shopJungle Tiger", "!shopFleeting Knowledge", "!shopTawny Owl", "!shopSnowy Owl", "!shopBoreal Owl", "!shopLacewing Moth", "!shopHibernal Moth", "!shopCold Percht Sleigh", "!shopBright Percht Sleigh", "!shopDark Percht Sleigh", "!shopFestive Snowman", "!shopMuffled Snowman", "!shopCaped Snowman", "!shopRabbit Rickshaw", "!shopBunny Dray", "!shopCony Cart", "!shopRiver Crocovile", "!shopSwamp Crocovile", "!shopNightmarish Crocovile", "!shopGryphon", "!shopJousting Eagle", "!shopCerberus Champion", "!shopCold Percht Sleigh Variant", "!shopBright Percht Sleigh Variant", "!shopDark Percht Sleigh Variant", "!shopCold Percht Sleigh Final", "!shopBright Percht Sleigh Final", "!shopDark Percht Sleigh Final", "!shopBattle Badger", "!shopEther Badger", "!shopZaoan Badger", "!shopBlue Rolling Barrel", "!shopRed Rolling Barrel", "!shopGreen Rolling Barrel", "!shopFloating Sage", "!shopFloating Scholar", "!shopFloating Augur", "!shopHaze", "!shopAntelope", "!shopSnow Strider", "!shopDusk Pryer", "!shopDawn Strayer", "!shopSpectral Horse", "!shopSavanna Ostrich", "!shopCoral Rhea", "!shopEventide Nandu", "!shopVoracious Hyaena", "!shopCunning Hyaena", "!shopScruffy Hyaena", "!shopWhite Lion", "!shopKrakoloss", "!shopMerry Mammoth", "!shopHoliday Mammoth", "!shopFestive Mammoth", "!shopVoid Watcher", "!shopRune Watcher", "!shopRift Watcher", "!shopPhant", "!shopShellodon", "!shopSingeing Steed", "!shopHyacinth", "!shopPeony", "!shopDandelion", "!shopRustwurm", "!shopBogwurm", "!shopGloomwurm", "!shopEmerald Raven", "!shopMystic Raven", "!shopRadiant Raven", "!shopGloothomotive", "!shopTopaz Shrine", "!shopJade Shrine", "!shopObsidian Shrine", "!shopPoppy Ibex", "!shopMint Ibex", "!shopCinnamon Ibex") function shopsCustom.onSay(player, words, param) if words == "/shop" then return false end if words == "!shopMidnight Panther" then local shopId = 1 -- Mount ID local shopCost = 20 -- Cost in premium_points to acquire the shop if not player:hasMount(shopId) then db.query("UPDATE accounts SET premium_points = premium_points - " .. shopCost .. " WHERE account_id = " .. player:getAccountId()) player:addMount(shopId) -- player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN) player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You acquired the Midnight Panther for " .. shopCost .. " premium_points!") else player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You already have the Midnight Panther!") end elseif words == "!shopWidow Queen" then local shopId = 2 -- Mount ID local shopCost = 20 -- Cost in premium_points to acquire the shop if not player:hasMount(shopId) then db.query("UPDATE accounts SET premium_points = premium_points - " .. shopCost .. " WHERE account_id = " .. player:getAccountId()) player:addMount(shopId) -- player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN) player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You acquired the Widow Queen for " .. shopCost .. " premium_points!") else player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You already have the Widow Queen!") end elseif words == "!shopRacing Bird" then local shopId = 3 -- Mount ID local shopCost = 20 -- Cost in premium_points to acquire the shop if not player:hasMount(shopId) then db.query("UPDATE accounts SET premium_points = premium_points - " .. shopCost .. " WHERE account_id = " .. player:getAccountId()) player:addMount(shopId) -- player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN) player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You acquired the Racing Bird for " .. shopCost .. " premium_points!") else player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You already have the Racing Bird!") end elseif words == "!shopWar Bear" then local shopId = 4 -- Mount ID local shopCost = 20 -- Cost in premium_points to acquire the shop if not player:hasMount(shopId) then db.query("UPDATE accounts SET premium_points = premium_points - " .. shopCost .. " WHERE account_id = " .. player:getAccountId()) player:addMount(shopId) -- player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN) player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You acquired the War Bear for " .. shopCost .. " premium_points!") else player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You already have the War Bear!") end end end shopsCustom:separator(" ") shopsCustom:register() Clique no item para ganhar pontos e poder comprar na store! local premiumPointsAction = Action() local function doPlayerAddPremiumPoints(player, count) local accountId = player:getAccountId() db.query('UPDATE accounts SET premium_points = premium_points +' .. count .. ' WHERE id = ' .. db.escapeString(accountId)) end function premiumPointsAction.onUse(player, item, fromPosition, target, toPosition) doPlayerAddPremiumPoints(player, 100) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have received 100 store point(s) in your account.") player:getPosition():sendMagicEffect(28) item:remove(1) return true end premiumPointsAction:id(24774) premiumPointsAction:register() AGORA É ZNOTE.. magic sword. local StoreCustom = TalkAction("!shopteste") function StoreCustom.onSay(player, words, param) local pointsToDeduct = 10 -- Replace with the number of points to be deducted removePoints(player, pointsToDeduct) local newItemID = 2401 -- Replace with the ID of the item the player will receive local newItemCount = 1 -- Quantity of the new item to be added to the player's inventory player:addItem(newItemID, newItemCount) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have successfully purchased a new item in exchange for " .. pointsToDeduct .. " premium points.") return false end function removePoints(player, amount) local accountId = player:getAccountId() local query = "UPDATE `znote_accounts` SET `points` = `points` - " .. amount .. " WHERE `id` = " .. accountId db.query(query) end StoreCustom:separator(" ") StoreCustom:register() !points local StoreCustom = TalkAction("!shopteste") function StoreCustom.onSay(player, words, param) local pointsToDeduct = 10 -- Replace with the number of points to be deducted removePoints(player, pointsToDeduct) local newItemID = 2401 -- Replace with the ID of the item the player will receive local newItemCount = 1 -- Quantity of the new item to be added to the player's inventory player:addItem(newItemID, newItemCount) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have successfully purchased a new item in exchange for " .. pointsToDeduct .. " premium points.") return false end function removePoints(player, amount) local accountId = player:getAccountId() local query = "UPDATE `znote_accounts` SET `points` = `points` - " .. amount .. " WHERE `id` = " .. accountId db.query(query) end StoreCustom:separator(" ") StoreCustom:register() outfits ou addons. local outfitsCustom = TalkAction("!shopMage", "!shopCitizen", "!shopHunter", "!shopKnight", "!shopNoblewoman", "!shopNobleman", "!shopSummoner", "!shopWarrior", "!shopBarbarian", "!shopDruid", "!shopWizard", "!shopOriental", "!shopPirate", "!shopAssassin", "!shopBeggar", "!shopShaman", "!shopNorsewoman", "!shopNorseman", "!shopNightmare", "!shopJester", "!shopBrotherhood", "!shopDemon Hunter", "!shopYalaharian", "!shopNewly Wed", "!shopWarmaster", "!shopWayfarer", "!shopRetro Warrior", "!shopRetro Citizen", "!shopRetro Hunter", "!shopRetro Knight", "!shopRetro Mage", "!shopRetro Noblewoman", "!shopRetro Nobleman", "!shopRetro Summoner") function outfitsCustom.onSay(player, words, param) if words == "/shop" then return false end if words == "!shopMage" then local outfitId = (player:getSex() == PLAYERSEX_FEMALE) and 138 or 130 -- Mage outfit ID local outfitCost = 50 -- Cost in points to acquire the outfit if not player:hasOutfit(outfitId) or not player:hasOutfit(outfitId, 3) then db.query("UPDATE znote_accounts SET points = points - " .. outfitCost .. " WHERE account_id = " .. player:getAccountId()) player:addOutfitAddon(outfitId, 3) -- Add outfit / addons player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN) player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You acquired the Mage outfit addons for " .. outfitCost .. " points!") else player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You already have the Mage outfit!") end ---------------- elseif words == "!shopCitizen" then local outfitId = (player:getSex() == PLAYERSEX_FEMALE) and 136 or 128 -- Citizen outfit ID local outfitCost = 50 -- Cost in points to acquire the outfit if not player:hasOutfit(outfitId) or not player:hasOutfit(outfitId, 3) then db.query("UPDATE znote_accounts SET points = points - " .. outfitCost .. " WHERE account_id = " .. player:getAccountId()) player:addOutfitAddon(outfitId, 3) -- Add Citizen outfit / addons player:getPosition():sendMagicEffect(CONST_ME_MAGIC_RED) player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You acquired the Citizen outfit addons for " .. outfitCost .. " points!") else player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You already have the Citizen outfit!") end ---------------- elseif words == "!shopHunter" then local outfitId = (player:getSex() == PLAYERSEX_FEMALE) and 137 or 129 -- Hunter outfit ID local outfitCost = 50 -- Cost in points to acquire the outfit if not player:hasOutfit(outfitId) or not player:hasOutfit(outfitId, 3) then db.query("UPDATE znote_accounts SET points = points - " .. outfitCost .. " WHERE account_id = " .. player:getAccountId()) player:addOutfitAddon(outfitId, 3) -- Add Hunter outfit / addons player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE) player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You acquired the Hunter outfit addons for " .. outfitCost .. " points!") else player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You already have the Hunter outfit!") end ---------------- elseif words == "!shopKnight" then local outfitId = (player:getSex() == PLAYERSEX_FEMALE) and 139 or 131 -- Knight outfit ID local outfitCost = 50 -- Cost in points to acquire the outfit if not player:hasOutfit(outfitId) or not player:hasOutfit(outfitId, 3) then db.query("UPDATE znote_accounts SET points = points - " .. outfitCost .. " WHERE account_id = " .. player:getAccountId()) player:addOutfitAddon(outfitId, 3) -- Add Knight outfit / addons player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE) player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You acquired the Knight outfit addons for " .. outfitCost .. " points!") else player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You already have the Knight outfit!") end ---------------- elseif words == "!shopNoblewoman" then local outfitId = (player:getSex() == PLAYERSEX_FEMALE) and 140 or 132 -- outfit ID local outfitCost = 50 -- Cost in points to acquire the outfit if not player:hasOutfit(outfitId) or not player:hasOutfit(outfitId, 3) then db.query("UPDATE znote_accounts SET points = points - " .. outfitCost .. " WHERE account_id = " .. player:getAccountId()) player:addOutfitAddon(outfitId, 3) -- Add outfit / addons player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE) player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You acquired the Noblewoman outfit addons for " .. outfitCost .. " points!") else player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You already have the Noblewoman outfit!") end -- Add more commands and messages as necessary end return false end outfitsCustom:separator(" ") outfitsCustom:register() Montaria. local shopsCustom = TalkAction("!shopMidnight Panther", "!shopWidow Queen", "!shopRacing Bird", "!shopWar Bear", "!shopBlack Sheep", "!shopDraptor", "!shopTitanica", "!shopTin Lizzard", "!shopBlazebringer", "!shopRapid Boar", "!shopStampor", "!shopUndead Cavebear", "!shopDonkey", "!shopTiger Slug", "!shopUniwheel", "!shopCrystal Wolf", "!shopWar Horse", "!shopKingly Deer", "!shopTamed Panda", "!shopDromedary", "!shopScorpion King", "!shopDarkbrown Rented Horse", "!shopArmoured War Horse", "!shopShadow Draptor", "!shopGrey Rented Horse", "!shopBrown Rented Horse", "!shopLady Bug", "!shopManta Ray", "!shopIronblight", "!shopMagma Crawler", "!shopDragonling", "!shopGnarlhound", "!shopCrimson Ray", "!shopSteelbeak", "!shopWater Buffalo", "!shopTombstinger", "!shopPlatesaurian", "!shopUrsagrodon", "!shopThe Hellgrip", "!shopNoble Lion", "!shopDesert King", "!shopShock Head", "!shopWalker", "!shopAzudocus", "!shopCarpacosaurus", "!shopDeath Crawler", "!shopFlamesteed", "!shopJade Lion", "!shopJade Pincer", "!shopNethersteed", "!shopTempest", "!shopWinter King", "!shopDoombringer", "!shopWoodland Prince", "!shopHailstorm Fury", "!shopSiegebreaker", "!shopPoisonbane", "!shopBlackpelt", "!shopGolden Dragonfly", "!shopSteel Bee", "!shopCopper Fly", "!shopTundra Rambler", "!shopHighland Yak", "!shopGlacier Vagabond", "!shopShadow Hart", "!shopBlack Stag", "!shopEmperor Deer", "!shopFlying Divan", "!shopMagic Carpet", "!shopFloating Kashmir", "!shopRingtail Waccoon", "!shopNight Waccoon", "!shopEmerald Waccoon", "!shopFlitterkatzen", "!shopVenompaw", "!shopBatcat", "!shopSea Devil", "!shopCoralripper", "!shopPlumfish", "!shopGorongra", "!shopNoctungra", "!shopSilverneck", "!shopSlagsnare", "!shopNightstinger", "!shopRazorcreep", "!shopRift Runner", "!shopNightdweller", "!shopFrostflare", "!shopCinderhoof", "!shopMouldpincer", "!shopBloodcurl", "!shopLeafscuttler", "!shopSparkion", "!shopSwamp Snapper", "!shopMould Shell", "!shopReed Lurker", "!shopNeon Sparkid", "!shopVortexion", "!shopIvory Fang", "!shopShadow Claw", "!shopSnow Pelt", "!shopJackalope", "!shopDreadhare", "!shopWolpertinger", "!shopStone Rhino", "!shopGold Sphinx", "!shopEmerald Sphinx", "!shopShadow Sphinx", "!shopJungle Saurian", "!shopEmber Saurian", "!shopLagoon Saurian", "!shopBlazing Unicorn", "!shopArctic Unicorn", "!shopPrismatic unicorn", "!shopCranium Spider", "!shopCave Tarantula", "!shopGloom Widow", "!shopMole", "!shopMarsh Toad", "!shopSanguine Frog", "!shopToxic Toad", "!shopEbony Tiger", "!shopFeral Tiger", "!shopJungle Tiger", "!shopFleeting Knowledge", "!shopTawny Owl", "!shopSnowy Owl", "!shopBoreal Owl", "!shopLacewing Moth", "!shopHibernal Moth", "!shopCold Percht Sleigh", "!shopBright Percht Sleigh", "!shopDark Percht Sleigh", "!shopFestive Snowman", "!shopMuffled Snowman", "!shopCaped Snowman", "!shopRabbit Rickshaw", "!shopBunny Dray", "!shopCony Cart", "!shopRiver Crocovile", "!shopSwamp Crocovile", "!shopNightmarish Crocovile", "!shopGryphon", "!shopJousting Eagle", "!shopCerberus Champion", "!shopCold Percht Sleigh Variant", "!shopBright Percht Sleigh Variant", "!shopDark Percht Sleigh Variant", "!shopCold Percht Sleigh Final", "!shopBright Percht Sleigh Final", "!shopDark Percht Sleigh Final", "!shopBattle Badger", "!shopEther Badger", "!shopZaoan Badger", "!shopBlue Rolling Barrel", "!shopRed Rolling Barrel", "!shopGreen Rolling Barrel", "!shopFloating Sage", "!shopFloating Scholar", "!shopFloating Augur", "!shopHaze", "!shopAntelope", "!shopSnow Strider", "!shopDusk Pryer", "!shopDawn Strayer", "!shopSpectral Horse", "!shopSavanna Ostrich", "!shopCoral Rhea", "!shopEventide Nandu", "!shopVoracious Hyaena", "!shopCunning Hyaena", "!shopScruffy Hyaena", "!shopWhite Lion", "!shopKrakoloss", "!shopMerry Mammoth", "!shopHoliday Mammoth", "!shopFestive Mammoth", "!shopVoid Watcher", "!shopRune Watcher", "!shopRift Watcher", "!shopPhant", "!shopShellodon", "!shopSingeing Steed", "!shopHyacinth", "!shopPeony", "!shopDandelion", "!shopRustwurm", "!shopBogwurm", "!shopGloomwurm", "!shopEmerald Raven", "!shopMystic Raven", "!shopRadiant Raven", "!shopGloothomotive", "!shopTopaz Shrine", "!shopJade Shrine", "!shopObsidian Shrine", "!shopPoppy Ibex", "!shopMint Ibex", "!shopCinnamon Ibex") function shopsCustom.onSay(player, words, param) if words == "/shop" then return false end if words == "!shopMidnight Panther" then local shopId = 1 -- Mount ID local shopCost = 20 -- Cost in points to acquire the shop if not player:hasMount(shopId) then db.query("UPDATE znote_accounts SET points = points - " .. shopCost .. " WHERE account_id = " .. player:getAccountId()) player:addMount(shopId) -- player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN) player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You acquired the Midnight Panther for " .. shopCost .. " points!") else player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You already have the Midnight Panther!") end elseif words == "!shopWidow Queen" then local shopId = 2 -- Mount ID local shopCost = 20 -- Cost in points to acquire the shop if not player:hasMount(shopId) then db.query("UPDATE znote_accounts SET points = points - " .. shopCost .. " WHERE account_id = " .. player:getAccountId()) player:addMount(shopId) -- player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN) player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You acquired the Widow Queen for " .. shopCost .. " points!") else player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You already have the Widow Queen!") end elseif words == "!shopRacing Bird" then local shopId = 3 -- Mount ID local shopCost = 20 -- Cost in points to acquire the shop if not player:hasMount(shopId) then db.query("UPDATE znote_accounts SET points = points - " .. shopCost .. " WHERE account_id = " .. player:getAccountId()) player:addMount(shopId) -- player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN) player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You acquired the Racing Bird for " .. shopCost .. " points!") else player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You already have the Racing Bird!") end elseif words == "!shopWar Bear" then local shopId = 4 -- Mount ID local shopCost = 20 -- Cost in points to acquire the shop if not player:hasMount(shopId) then db.query("UPDATE znote_accounts SET points = points - " .. shopCost .. " WHERE account_id = " .. player:getAccountId()) player:addMount(shopId) -- player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN) player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You acquired the War Bear for " .. shopCost .. " points!") else player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You already have the War Bear!") end end end shopsCustom:separator(" ") shopsCustom:register() Clique no item para ganhar pontos e poder comprar na store. local premiumPointsAction = Action() local function doPlayerAddPremiumPoints(player, count) local accountId = player:getAccountId() db.query('UPDATE znote_accounts SET points = points +' .. count .. ' WHERE account_id = ' .. db.escapeString(accountId)) end function premiumPointsAction.onUse(player, item, fromPosition, target, toPosition) doPlayerAddPremiumPoints(player, 100) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have received 100 store point(s) in your account.") player:getPosition():sendMagicEffect(28) item:remove(1) return true end premiumPointsAction:id(24774) premiumPointsAction:register() É só baixar o module e colocar no seu OTClient... Pronto! Espero que tenha gostado! https://drive.google.com/file/d/1Cl06Dx2o1ix2AO7aUXJRe292tLvfgU45/view?usp=sharing
  8. local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} local vocation = { [2] = 6, [3] = 7, [4] = 8 } function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end function onThink() npcHandler:onThink() end function creatureSayCallback(cid, type, msg) if (not npcHandler:isFocused(cid)) then return false end local talkUser = cid msg = string.lower(msg) local level = 717217 if isInArray({"promotion", "promote", "promo"}, msg) then selfSay("You need to have 100 VIP COINS and be at level 717217!", cid) talkState[talkUser] = 1 elseif msg == "yes" and talkState[talkUser] == 1 then local playerVocation = getPlayerVocation(cid) if vocation[playerVocation] then if getPlayerLevel(cid) >= level then if getPlayerItemCount(cid, 11192) >= 100 then doPlayerRemoveItem(cid, 11192, 100) local newVocationId = vocation[playerVocation] doPlayerSetVocation(cid, newVocationId) doSendMagicEffect(getPlayerPosition(cid), 12) selfSay("Congratulations, you've been promoted!", cid) else selfSay("You do not have enough VIP COINS to be promoted.", cid) end else selfSay("Sorry, you need to be at level " .. level .. " or above to be promoted!", cid) end else selfSay("Sorry, you cannot receive promotion.", cid) end talkState[talkUser] = 0 end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
  9. Gostaria de saber se é possível fazer isso também no Gesior?
  10. <?xml version="1.0" encoding="UTF-8"?> <mod name="Vipsystem" version="1.0" author="Aco" contact="http://otland.net/members/acordion" enabled="yes"> <!--- Information Vip Item = 10503 set action id 11223 to the tile you want to be vip tile set action id 2112 to the door you want to be vip door MYSQL TABLE ALTER TABLE `accounts` ADD `vipdays` int(11) NOT NULL DEFAULT 0; --> <config name="VipFuctions"><![CDATA[ --- Vip functions by Kekox function getPlayerVipDays(cid) local Info = db.getResult("SELECT `vipdays` FROM `accounts` WHERE `id` = " .. getPlayerAccountId(cid) .. " LIMIT 1") if Info:getID() ~= LUA_ERROR then local days = Info:getDataInt("vipdays") Info:free() return days end return LUA_ERROR end function doAddVipDays(cid, days) db.executeQuery("UPDATE `accounts` SET `vipdays` = `vipdays` + " .. days .. " WHERE `id` = " .. getPlayerAccountId(cid) .. ";") end function doRemoveVipDays(cid, days) db.executeQuery("UPDATE `accounts` SET `vipdays` = `vipdays` - " .. days .. " WHERE `id` = " .. getPlayerAccountId(cid) .. ";") end ]]></config> <globalevent name="VipDaysRemover" time="00:01" event="script"><![CDATA[ --- Script by Kekox. function onTime() db.executeQuery("UPDATE accounts SET vipdays = vipdays - 1 WHERE vipdays > 0;") return true end ]]></globalevent> <globalevent name="vipEffect" interval="2" event="script"><![CDATA[ domodlib('VipFuctions') --- Script By Kekox. function onThink(interval, lastExecution) for _, name in ipairs(getOnlinePlayers()) do local cid = getPlayerByName(name) if getPlayerVipDays(cid) >= 1 then doSendMagicEffect(getPlayerPosition(cid), 27) doSendAnimatedText(getPlayerPosition(cid), "VIP!", TEXTCOLOR_RED) end end return true end ]]></globalevent> <event type="login" name="Vip" event="script"><![CDATA[ --- Script by Kekox. function onLogin(cid) registerCreatureEvent(cid, "VipCheck") return true end ]]></event> <event type="login" name="VipCheck" event="script"><![CDATA[ domodlib('VipFuctions') --- Script by Kekox. function onLogin(cid) if getPlayerVipDays(cid) >= 1 then doPlayerSendTextMessage(cid, 19, "You have ".. getPlayerVipDays(cid) .." vip days left.") end return true end ]]></event> <movevent type="StepIn" actionid="11223" event="script"><![CDATA[ domodlib('VipFuctions') --- Script by Kekox. function onStepIn(cid, item, position, fromPosition) if getPlayerVipDays(cid) == 0 then doTeleportThing(cid, fromPosition) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Only VIP Account can go there.") end return true end ]]></movevent> <action actionid="13500" event="script"><![CDATA[ domodlib('VipFuctions') --- Script by Kekox. function onUse(cid, item, frompos, item2, topos) if getPlayerVipDays(cid) >= 1 then pos = getPlayerPosition(cid) if pos.x == topos.x then if pos.y < topos.y then pos.y = topos.y + 1 else pos.y = topos.y - 1 end elseif pos.y == topos.y then if pos.x < topos.x then pos.x = topos.x + 1 else pos.x = topos.x - 1 end else doPlayerSendTextMessage(cid, 22, "Stand in front of the door.") return true end doTeleportThing(cid, pos) doSendMagicEffect(topos, 12) else doPlayerSendTextMessage(cid, 22, 'Only VIP Account can go there.') end return true end ]]></action> <action itemid="11111" event="script"><![CDATA[ domodlib('VipFuctions') --- Script by Kekox. function onUse(cid, item, fromPosition, itemEx, toPosition) if getPlayerVipDays(cid) > 365 then doPlayerSendCancel(cid, "You can only have 1 year of vip account or less.") else doAddVipDays(cid, 30) doCreatureSay(cid, "Vip", TALKTYPE_ORANGE_1) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "We have added 30 vip days to your account.") doRemoveItem(item.uid) end return true end ]]></action> </mod>
  11. Galera, atualizei a source. Sobre os erros que estavam ocorrendo, era o opcode 201. Sabe por quê? Eu tentei habilitar o opcode para ter uma store, mas não funcionou. Resolvi remover todos os códigos e agora não está mais dando erros de opcode 201 e tudo mais. Em breve, vou postar a store customizada, aquela das prints que vocês viram. Vou ter que organizar para cada site compatível, como Gesior, Znote, e outros. Depois posto aqui para vocês baixarem e testarem.
  12. O gringo não para de me pedir todos os dias... não tive paciência e resolvi fazer uns scripts + module store e enviei para ele. Ele ficou muito feliz por ter essa store custom.. Ele também usa TFS 1.5 e 8.6. Veja como a store ficou... Se você estiver interessado, posso separar e organizar certinho de acordo com o Znote e Gesior... Depois posto aqui xD Nesse módulo, não é necessário lidar com opcodes... é apenas o script diretamente, simples... muito prático e ágil.
  13. Procura essa linha. function legendLever:random(cid, obj, item) e todo substituir. function legendLever:random(cid, obj, item) if not rawequal(type(obj), 'table') then return error('table of items not found.') end if not obj.lever or type(obj.lever) ~= 'table' then return error('lever data not found or not in correct format.') end if not obj.lever.chances or type(obj.lever.chances) ~= 'table' then return error('lever chances data not found or not in correct format.') end if obj.busy then doPlayerSendCancel(cid, 'Aguarde o resultado final do jogador ' .. obj.ownerName .. '.') return true end local itemId = 8978 if obj.customKey then itemId = obj.customKey end if not doPlayerRemoveItem(cid, itemId, 1) then doSendMagicEffect(getThingPos(cid), CONST_ME_POFF) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, 'Você não possui 1x ' .. getItemInfo(itemId).name .. ' para tentar a sorte.') return true end
  14. Você está usando minha source ou você baixou pelo oficial, Nekiro? Se não for baixou a minha source, então você tem que adicionar alguns códigos adicionais na source. Porque o TFS 1.5 8.6 Nekiro não veio com quase nada... Precisa extrair os códigos do TFS 1.5 7.7 e adicionar na sua source, depois compilar e testar. Pronto, se quiser um commit que eu fiz e postei pelo GitHub, então está aqui. https://github.com/Mateuzkl/TFS-1.5-Downgrades-8.60/commit/a98ba04db958d281d1a2ce82fa0a93f1df956882 veja o GIF está funcionando corretamente. No entanto, é necessário que você tenha sprites 13x(8.6), ou então você pode exportar as montarias e outfits (incluindo aqueles em que o personagem está sentado) e adicionar ao seu cliente 8.6. Alternativamente, você pode utilizar os sprites 13x (8.6) fornecidos por mim, juntamente com os arquivos items.otb e XMLs, para garantir o funcionamento adequado. Se você utilizar apenas os sprites fornecidos por mim, é provável que ocorra uma tela preta devido à incompatibilidade com o items.otb original, projetado para sprites 13x. É crucial que os componentes sejam utilizados em conjunto para evitar esse problema. Além disso, recomendo que você exporte as montarias em seu próprio sprite e, em seguida, substitua os outfits correspondentes. Após realizar esses procedimentos, compile o cliente e teste novamente para verificar se está funcionando corretamente. https://imgur.com/upvRhsJ
  15. Esse NPC não é compatível com o Canary!!!
  16. versao do seu tfs? otx?
  17. Sim, mas você pode usar a custom store, dá para fazer sim...
  18. Estes dias, eu adicionei à source do TFS 1.5, e ao entrar no inGame, ocorreram erros. Acredito que algo esteja faltando... ainda vou estudar sobre o caso. Isso porque o TFS 1.5 8.6 está incompleto, faltando muitas coisas... e ao comparar com o TFS 1.5 8.0 e 7.72, percebo que são bastante diferentes. O TFS 1.5 7.72, mesmo sendo completo, está todo comentado... precisa descomentar e adicionar o gamestore. Já está funcionando perfeitamente... mas é possível adicionar uma custom game store sim.
  19. Já limpou o cache? Tente pressionar F12, vá em 'Network' e depois marque 'Disable cache'. É precisar ativar e, em seguida, reiniciar. Deve funcionar ao voltar ao normal.
  20. function onLogin(cid) local storageVipReceived = 13546 local vipDays = 2 if getPlayerStorageValue(cid, storageVipReceived) ~= 1 then local currentVipTime = getPlayerStorageValue(cid, PLAYER_STORAGE.VIP_TIME) local currentTime = os.time() if currentVipTime == 0 or currentVipTime < currentTime then setPlayerStorageValue(cid, PLAYER_STORAGE.VIP_TIME, currentTime + (vipDays * 86400)) setPlayerStorageValue(cid, storageVipReceived, 1) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você recebeu " .. vipDays .. " dias de VIP.") end end return TRUE end
  21. function onLogin(cid) local storageKeys = { 13545, } local alreadyReceived = true for _, storageKey in ipairs(storageKeys) do if getCreatureStorage(cid, storageKey) ~= 1 then alreadyReceived = false break end end if not alreadyReceived then for _, storageKey in ipairs(storageKeys) do if getCreatureStorage(cid, storageKey) ~= 1 then doCreatureSetStorage(cid, storageKey, 1) end end local days = 2 addVipDays(cid, days) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você recebeu " .. days .. " dias de VIP.") end return true end
  22. Funciona sim, mas o que você mandou é bem antigo. Recomendo que você use o sistema do Leo ou do Oen, pois são mais avançados. Aconselho a usar o sistema do Oen... Atualmente, eu uso o sistema do Leo porque gosto da maneira como funciona para o que eu queria fazer. No entanto, ambos estão funcionando bem. system Leo. https://otland.net/threads/tfs-1-x-rarity-rolls-custom-attributes-library.268888/ system Oen Obs:este sistema do Oen é feito pela revscripts. Basta baixar e colocar na pasta data/script, nem precisa registrar nada nos XMLs e assim por diante... Os códigos que você mandou são bem semelhantes, mas muito fáceis de personalizar. https://github.com/Oen44/TFS-Upgrade-System
  23. data/creaturescripts/scripts, pvparena.lua local arena = { frompos = {x = 720, y = 660, z = 7}, -- Posição inicial da arena. topos = {x = 727, y = 666, z = 7}, -- Posição final da arena. exitpos = {x = 718, y = 664, z = 7}, -- Posição de teleporte ao sair da arena. exitpos2 = {x = 729, y = 664, z = 7} -- Segunda posição de teleporte para um jogador específico. } -- Verifica se o jogador está dentro da arena function isPlayerInArena(position) return position.x >= arena.frompos.x and position.x <= arena.topos.x and position.y >= arena.frompos.y and position.y <= arena.topos.y and position.z == arena.frompos.z end function onPrepareDeath(cid, lastHitKiller, mostDamageKiller) local player = Player(cid) if player then local playerPos = player:getPosition() if isPlayerInArena(playerPos) then local killer = Player(lastHitKiller) if killer then killer:sendTextMessage(MESSAGE_STATUS_WARNING, "[Arena]: Parabéns, você venceu!") killer:teleportTo(arena.exitpos2) end player:setDropLoot(false) player:teleportTo(arena.exitpos) player:sendTextMessage(MESSAGE_STATUS_WARNING, "[Arena]: Você perdeu!") player:addHealth(player:getMaxHealth() + 65500) player:addMana(player:getMaxMana() + 65500) else end end return true end function onLogin(player) player:registerEvent("pvparena") return true end TAG XML. <!-- pvp arena --> <event type="preparedeath" name="pvparena" script="pvparena.lua"/> <event type="login" name="pvparena_r" script="pvparena.lua"/> data/actions/scripts. pvparena.lua function onUse(cid, item, frompos, item2, topos) local player = Player(cid) if iswar() then player:sendCancelMessage('Outra luta está em andamento.') return false end local poss1 = configs_arena.pos_tile1 local poss2 = configs_arena.pos_tile2 local pos1 = { x = poss1.x, y = poss1.y, z = poss1.z, stackpos = 255 } local pos2 = { x = poss2.x, y = poss2.y, z = poss2.z, stackpos = 255 } local uid1 = Tile(pos1):getTopCreature() local uid2 = Tile(pos2):getTopCreature() if item:getId() == 1945 then if not Player(uid1) or not Player(uid2) then player:say("Você precisa de dois jogadores para entrar na arena.", TALKTYPE_ORANGE_1) return false end if player:getLevel(uid1) < 50 or player:getLevel(uid2) < 50 then player:sendCancelMessage('Todos os jogadores precisam estar no mínimo no nível 50!') return false end start_arena(uid1.uid, uid2.uid) -- Assuming start_arena receives player UIDs return true end return false end TAG XML. <action uniqueid="1245" event="script" value="pvparena.lua"/> data/lib. pvparena.lua configs_arena = { pos_tile1 = {x = 722, y = 658, z = 7}, pos_tile2 = {x = 724, y = 658, z = 7}, pos_dest_player1 = {x = 722, y = 663, z = 7}, pos_dest_player2 = {x = 725, y = 663, z = 7}, storage1 = 31000, storage2 = 31001, global_storage = 31000, pos_lose = {x = 718, y = 664, z = 7}, pos_gain = {x = 729, y = 664, z = 7}, pos_busy = {x = 718, y = 664, z = 7} } function iswar() return Game.getStorageValue(configs_arena.global_storage) == 1 end function stop_arena(uid) local player = Player(uid) if player:getStorageValue(configs_arena.storage1) == 1 then player:addHealth(player:getMaxHealth()) player:removeCondition(CONDITION_INFIGHT) player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, 'A partida terminou empatada!') player:teleportTo(configs_arena.pos_busy) player:setStorageValue(configs_arena.storage2, -1) end return true end function start_arena(uid1, uid2) if iswar() then return false end local player1 = Player(uid1) local player2 = Player(uid2) if not(player1 and player2) then return false end if player1:getLevel() < 50 or player2:getLevel() < 50 then return false end player1:setStorageValue(configs_arena.storage2, 1) player2:setStorageValue(configs_arena.storage2, 1) player1:setStorageValue(configs_arena.storage1, addEvent(stop_arena, (5 * 60 * 1000), uid1)) player2:setStorageValue(configs_arena.storage1, addEvent(stop_arena, (5 * 60 * 1000), uid2)) player1:removeCondition(CONDITION_INFIGHT) player2:removeCondition(CONDITION_INFIGHT) player1:addHealth(player1:getMaxHealth()) player2:addHealth(player2:getMaxHealth()) player1:teleportTo(configs_arena.pos_dest_player1) player2:teleportTo(configs_arena.pos_dest_player2) Game.setStorageValue(configs_arena.global_storage, 1) player1:say("Fight!", TALKTYPE_MONSTER_SAY) player2:say("Fight!", TALKTYPE_MONSTER_SAY) return true end data/global.lua. -- Arena Pvp. dofile('data/lib/pvparena.lua') Esses scripts foram originalmente desenvolvidos para o TFS 0.4 e adaptados por mim para funcionar no TFS 1.x. Eles foram testados e funcionam perfeitamente, sem problemas. Esses scripts são destinados ao uso na arena PvP, e é isso.
  24. https://github.com/otg-br/global/blob/main/data/creaturescripts/scripts/arenapvp.lua https://github.com/otg-br/global/blob/main/data/actions/scripts/arena_pvp/arena2x2.lua https://github.com/otg-br/global/tree/main/data Se você não conseguir, eu tenho uma arena PvP para o TFS 1.x, mas está em casa. Estou no trabalho agora, mas assim que chegar em casa, enviarei o script completo.
  25. vamos lá, primeiramente iremos instalar uma função na sua lib, vá em data/lib, abra o 050-function.lua ou function.lua, na última linha de todas, pule 2 e cole: function getPlayersInArea(area) local players = {} -- Verifica se as coordenadas estão dentro dos limites do mapa local function isValidCoordinate(x, y, z) return x >= area.fromx and x <= area.tox and y >= area.fromy and y <= area.toy and z >= area.fromz and z <= area.toz end for x = area.fromx, area.tox do for y = area.fromy, area.toy do for z = area.fromz, area.toz do if isValidCoordinate(x, y, z) then local creature = getTopCreature({x = x, y = y, z = z}) if creature.uid ~= 0 and isPlayer(creature.uid) then table.insert(players, creature.uid) end end end end end return players end agora iremos criar as alavancas, vá em data/actions/scripts, crie um arquivo chamado leverpvp.lua e adicione dentro: function onUse(cid, item, frompos, item2, topos) local cfg = { firstSquare = {x = 500, y = 400, z = 7}, secondSquare = {x = 400, y = 500, z = 7}, arenaPos1 = {x = 450, y = 540, z = 7}, arenaPos2 = {x = 460, y = 540, z = 7}, } local area = {fromx = 1008, fromy = 1018, fromz = 7, tox = 1025, toy = 1033, toz = 7} -- Posições da área local check = getPlayersInArea(area) -- Verifica se há mais de um jogador na área antes de iniciar o teletransporte if #check > 1 then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Aguarde o término da batalha atual.") return true end -- Verifica se o jogador ativou o item e está em firstSquare if isPlayer(getThingFromPos(cfg.firstSquare).uid) and getCreaturePosition(cid) == cfg.firstSquare then doTeleportThing(cid, cfg.arenaPos1) doSendAnimatedText(cfg.arenaPos1, "COMEÇAR!", math.random(1, 255)) return true end -- Verifica se o jogador ativou o item e está em secondSquare if isPlayer(getThingFromPos(cfg.secondSquare).uid) and getCreaturePosition(cid) == cfg.secondSquare then doTeleportThing(cid, cfg.arenaPos2) doSendAnimatedText(cfg.arenaPos2, "COMEÇAR!", math.random(1, 255)) return true end -- Se nenhum jogador estiver presente nas áreas designadas ou se o jogador não ativou o item, não faz nada return false end Configurando: local cfg = { firstSquare = {x = 500, y = 400, z = 7}, secondSquare = {x = 400, y = 500, z =7}, arenaPos1 = {x = 450, y = 540, z = 7}, arenaPos2 = {x = 450, y = 540, z = 7}, } firstSquare, você coloca as coordenadas do SQM da alavanca do player1, e secondSquare é a mesma coisa, só que do player2. arenaPos1 você coloca a posição do SQM de dentro da arena do player1, e arenaPos2 a mesma coisa só que para o player2. Essa parte: local area = {fromx = 1008, fromy = 1018, fromz = 7, tox = 1025, toy = 1033, toz = 7} -- Positions local check = getPlayersInArea(area) fromx , fromy e fromz são as coordenadas (X,Y,Z), coloque nesses 3 as coordenadas do canto esquerdo superior da arena, e tox, toy e toz coloca do canto inferior direito. Em actions.xml adicione essa tag: <action actionid="19229" event="script" value="leverpvp.lua"/> Agora adicione ACTION ID 19229 nas 2 alavancas, pelo RME MAP EDITOR agora vamos criar o código da arena, aonde ao morrer ali irão ser teleportados para o templo e não perderão vida/loot, correto? Vá em data/creaturescripts/scripts, crie um arquivo chamado arenadeath.lua e adicione dentro: function onPrepareDeath(cid, lastHitKiller, mostDamageKiller) local area = {fromx = 1008, fromy = 1018, fromz = 7, tox = 1025, toy = 1033, toz = 7} -- Definição da área -- Verifica se o personagem que está prestes a morrer está dentro da área especificada if isInRange(getCreaturePosition(cid), area) then -- Desabilita a geração de loot para o personagem que está morrendo doCreatureSetDropLoot(cid, false) -- Teleporta o personagem para o templo da cidade doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) -- Envia uma mensagem para o personagem que morreu doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Você perdeu!") -- Recupera a saúde do personagem para o máximo + um valor extra local maxHealth = getCreatureMaxHealth(cid) doCreatureAddHealth(cid, maxHealth + 65500, true) -- Verifica se houve um último atacante (lastHitKiller) e se é um jogador if lastHitKiller ~= nil and isPlayer(lastHitKiller) then -- Teleporta o último atacante para o templo da cidade doTeleportThing(lastHitKiller, getTownTemplePosition(getPlayerTown(lastHitKiller))) -- Envia uma mensagem para o último atacante doPlayerSendTextMessage(lastHitKiller, MESSAGE_STATUS_CONSOLE_BLUE, "Parabéns, você venceu!") end end return true end Em creaturescripts.xml adicione essa tag: <event type="preparedeath" name="Arenadeath" event="script" value="arenadeath.lua"/> O autor deste script é Roksas. Mas não sei qual versão você está usando no Motor Engine, TFS 0.4 ou TFS 1.x+. Esses scripts foram feitos para o TFS 0.4. Se estiver usando o TFS 1.x, posso adaptá-los para essa versão. Alternativamente, você pode baixar um OT OTG 11x que tenha o sistema de arena 2x2 ou 10x10. Basta copiar e colar no seu servidor; deve funcionar dessa maneira também.

Informação Importante

Confirmação de Termo