Postado Maio 9, 2023 2 anos .Qual servidor ou website você utiliza como base? TFS 1.4 Qual o motivo deste tópico? O script funciona porem precisaria fazer alguns ajustes e correção o Script foi feito pelo Vodkart, precisaria ajustar algumas coisas. Bom o script você consegue utilizar o comando adiciona skill para o Player, porem o limite de compra é 350. só que usando o comando só vai até 208 ou é 202 para skill fist, club, distance, axe, e sword. já o magic level, o maximo que vai é 156 mais pelo comando teria que chegar até 200. o script talvez teria que colocar por db não sei ao certo mais o script funciona porem tem esses problema db.query("UPDATE " .. db_table .. " SET " .. db_set_column .. " = " .. (db_skill_value + db_skill_value_sum) .. " WHERE id = " .. player:getGuid() .. ";") Está surgindo algum erro? Se sim coloque-o aqui. Quote Você tem o código disponível? Se tiver publique-o aqui: SKILL_CLUB = "skill_club" SKILL_DISTANCE = "skill_dist" SKILL_SHIELD = "skill_shielding" SKILL_MAGLEVEL = "maglevel" SKILL_SWORD = "skill_sword" SKILL_AXE = "skill_axe" local buyComprar = TalkAction("!comprar") local storage = 45611 local coinID = 9971 -- moeda para comprar skills local skills = { ["magiclevel"] = {vocations = {1, 5, 2, 6, 11, 12}, voc_msg= "Somente Sorcerers, Druids e Infernalists podem comprar magic level.", lim = 200, lim_msg = "Você não pode ter magic level acima de 200.", price= 3, incre = 1, skill = 7}, ["skillclub"] = {vocations = {9, 10}, voc_msg= "Somente Drunous podem comprar skill de club.", lim = 350, lim_msg = "Você não pode ter skill club acima de 350.", price= 1, incre = 1, skill = 1}, ["skillsword"] = {vocations = {4, 8}, voc_msg= "Somente Knights podem comprar skill de sword.", lim = 350, lim_msg = "Você não pode ter skill sword acima de 350.", price= 1, incre = 1, skill = 2}, ["skillaxe"] = {vocations = {4, 8}, voc_msg= "Somente Knights podem comprar skill de axe.", lim = 350,lim_msg = "Você não pode ter skill axe acima de 350.", price= 1, incre = 1, skill = 3}, ["skilldistance"] = {vocations = {3, 7}, voc_msg= "Somente Paladins podem comprar skill de distance.", lim = 350,lim_msg = "Você não pode ter skill distance acima de 350.", price= 1, incre = 1, skill = 4}, ["skillshielding"] = {vocations = {3, 7, 4, 8, 9, 10}, voc_msg= "Somente Paladins, Knights e Drunous podem comprar skill de shield.", lim = 350, lim_msg = "Você não pode ter skill shielding acima de 350.", price= 1, incre = 1, skill = 5}, ["magiclevel5"] = {vocations = {1, 5, 2, 6, 11, 12}, voc_msg= "Somente Sorcerers, Druids e Infernalists podem comprar magic level.", lim = 200, lim_msg = "Você não pode pode ter magic level acima de 200.", price= 15, incre = 5, skill = 7}, ["skillclub10"] = {vocations = {9, 10}, voc_msg= "Somente Drunous podem comprar skill de club.", lim = 350, lim_msg = "Você não pode ter skill club acima de 350.", price= 10, incre = 10, skill = 1}, ["skillsword10"] = {vocations = {4, 8}, voc_msg= "Somente Knights podem comprar skill de sword.", lim = 350, lim_msg = "Você não pode ter skill sword acima de 350.", price= 10, incre = 10, skill = 2}, ["skillaxe10"] = {vocations = {4, 8}, voc_msg= "Somente Knights podem comprar skill de axe.", lim = 350,lim_msg = "Você não pode ter skill axe acima de 350.", price= 10, incre = 10, skill = 3}, ["skilldistance10"] = {vocations = {3, 7}, voc_msg= "Somente Paladins podem comprar skill de distance.", lim = 350,lim_msg = "Você não pode ter skill distance acima de 350.", price= 10, incre = 10, skill = 4}, ["skillshielding10"] = {vocations = {3, 7, 4, 8, 9, 10}, voc_msg= "Somente Paladins, Knights e Drunous podem comprar skill de shield.", lim = 350, lim_msg = "Você não pode ter skill shielding acima de 350.", price= 10, incre = 10, skill = 5}, } function buyComprar.onSay(player, words, param) local player = Player(player) local pid = player:getGuid() local tile = player:getTile() local param = param:lower() if not tile:hasFlag(TILESTATE_PROTECTIONZONE) then player:sendCancelMessage("Você precisa estar em área protegida para utilizar este comando.") return true end if player:getStorageValue(storage) >= os.time() then player:sendCancelMessage("Por medidas de segurança você só pode utilizar este comando em " .. player:getStorageValue(storage)-os.time() .. " segundos.") return true end if param == "" then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, "Para comprar digite !comprar (nome do item)\nOpcoes:\nsd = 4000 em SD por 50 barras.\nuh = 6000 em UH por 40 barras.\nexplo = 6000 em explosion por 10 barras.\nvip10 = 10 dias de vip por 5 barras.\nvip30 = 30 dias de vip por 10 barras.\ndivine staff = divine staff por 30 barras.\ndivine axe = divine axe por 30 barras.\nlivro nivel 6 = livro nivel 6 por 60 barras.\ndivine club = divine club por 30 barras.\ndivine sword = divine sword por 30 barras.\ndivine crossbow = divine crossbow por 30 barras.\nlivro nivel 5 = livro nivel 5 por 30 barras.\nsuper divine axe = super divine axe por 60 barras.\nsuper divine club = super divine club por 60 barras.\nsuper divine sword = super divine sword por 60 barras.\nsuper divine staff = super divine staff por 60 barras.\nsuper divine crossbow = super divine crossbow por 60 barras.\nskillclub = adiciona 1 skill club por 1 barras.\nskillsword = adiciona 1 skill sword por 1 barras.\nskillaxe = adiciona 1 skill axe por 1 barras.\nskilldistance = adiciona 1 skill distance por 1 barras.\nskillshielding = adiciona 1 skill shielding por 1 barras.\nmagiclevel = adiciona 1 magic level por 3 barras.\nmagiclevel5 = adiciona 5 magic level por 15 barras.\nskillclub10 = adiciona 10 skills club por 10 barras.\nskillsword10 = adiciona 10 skills sword por 10 barras.\nskillaxe10 = adiciona 10 skills axe por 10 barras.\nskilldistance10 = adiciona 10 skill distance por 10 barras.\nskillshielding10 = adiciona 10 skill shielding por 10 barras.\nmontaria shadow draptor = montaria shadow draptor por 30 barras.\nmontaria golden lion = montaria golden lion por 30 barras.\nmontaria winter king = montaria winter king por 30 barras.\nmontaria flying divan = montaria flying divan por 30 barras.\nmontaria woodland prince = montaria woodland prince por 30 barras.\nmontaria black stag = montaria black stag por 30 barras.\nmontaria nether steed = montaria nether steed por 30 barras.\nmontaria snow pelt = montaria snow pelt por 30 barras.\nmontaria slagsnare = montaria slagsnare por 30 barras.\nmontaria sea devil = montaria sea devil por 55 barras.\nmontaria highland yak = montaria highland yak por 75 barras.\nmontaria copper fly = montaria copper fly por 60 barras.\nmontaria bloodcurl = montaria bloodcurl por 70 barras.\nmontaria poisonbane = montaria poisonbane por 65 barras.\nmontaria razorcreep = montaria razorcreep por 75 barras.\nmontaria noctungra = montaria noctungra por 70 barras.\nmontaria leafscuttler = montaria leafscuttler por 75 barras.\nmontaria jade pincer = montaria jade pincer por 60 barras.\nmontaria frostflare = montaria frostflare por 85 barras.\nroupa conjurer = roupa conjurer todos addons por 30 barras\nroupa ceremonial garb = roupa ceremonial garb todos addons por 30 barras.\nroupa puppeteer = roupa puppeteer todos addons por 30 barras.\nroupa death herald = roupa death herald todos addons por 30 barras.\nroupa winter warden = roupa winter warden todos addons por 30 barras.\nremoverfrag = remove todos frags por 100k.\nO Item desejado não existe em nosso stock. Veja a cima os detalhes dos items disponível.") return true end if skills[param] then local v = skills[param] if param == "magiclevel" and player:getBaseMagicLevel() >= v.lim or (player:getBaseMagicLevel() + v.incre ) >= v.lim then player:sendCancelMessage(v.lim_msg) return true elseif player:getSkillLevel(v.skill) + v.incre >= v.lim then player:sendCancelMessage(v.lim_msg) return true end if not isInArray(v.vocations, player:getVocation():getId()) then player:sendCancelMessage(v.voc_msg) return true end if player:getItemCount(coinID) >= v.price then player:removeItem(coinID, v.price) player:setStorageValue(storage, os.time()+1) local skillId = v.skill local amount = v.incre for i = 1, amount do local curSkill = player:getSkillLevel(skillId) local curTries = player:getSkillTries(skillId) local voc = player:getVocation() local nextTries = voc:getRequiredSkillTries(skillId, curSkill + 1) player:addSkillTries(skillId, nextTries - curTries + curTries / nextTries * voc:getRequiredSkillTries(skillId, curSkill + 2)) end else player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, "Você não possui a quantidade necessária para comprar.") end return true end return true end buyComprar:separator(" ") buyComprar:register() Você tem alguma imagem que possa auxiliar no problema? Se sim, coloque-a aqui.
Postado Maio 9, 2023 2 anos Diretor de Projetos 1 hora atrás, Vitorelias disse: .Qual servidor ou website você utiliza como base? TFS 1.4 Qual o motivo deste tópico? O script funciona porem precisaria fazer alguns ajustes e correção o Script foi feito pelo Vodkart, precisaria ajustar algumas coisas. Bom o script você consegue utilizar o comando adiciona skill para o Player, porem o limite de compra é 350. só que usando o comando só vai até 208 ou é 202 para skill fist, club, distance, axe, e sword. já o magic level, o maximo que vai é 156 mais pelo comando teria que chegar até 200. o script talvez teria que colocar por db não sei ao certo mais o script funciona porem tem esses problema db.query("UPDATE " .. db_table .. " SET " .. db_set_column .. " = " .. (db_skill_value + db_skill_value_sum) .. " WHERE id = " .. player:getGuid() .. ";") Está surgindo algum erro? Se sim coloque-o aqui. Você tem o código disponível? Se tiver publique-o aqui: SKILL_CLUB = "skill_club" SKILL_DISTANCE = "skill_dist" SKILL_SHIELD = "skill_shielding" SKILL_MAGLEVEL = "maglevel" SKILL_SWORD = "skill_sword" SKILL_AXE = "skill_axe" local buyComprar = TalkAction("!comprar") local storage = 45611 local coinID = 9971 -- moeda para comprar skills local skills = { ["magiclevel"] = {vocations = {1, 5, 2, 6, 11, 12}, voc_msg= "Somente Sorcerers, Druids e Infernalists podem comprar magic level.", lim = 200, lim_msg = "Você não pode ter magic level acima de 200.", price= 3, incre = 1, skill = 7}, ["skillclub"] = {vocations = {9, 10}, voc_msg= "Somente Drunous podem comprar skill de club.", lim = 350, lim_msg = "Você não pode ter skill club acima de 350.", price= 1, incre = 1, skill = 1}, ["skillsword"] = {vocations = {4, 8}, voc_msg= "Somente Knights podem comprar skill de sword.", lim = 350, lim_msg = "Você não pode ter skill sword acima de 350.", price= 1, incre = 1, skill = 2}, ["skillaxe"] = {vocations = {4, 8}, voc_msg= "Somente Knights podem comprar skill de axe.", lim = 350,lim_msg = "Você não pode ter skill axe acima de 350.", price= 1, incre = 1, skill = 3}, ["skilldistance"] = {vocations = {3, 7}, voc_msg= "Somente Paladins podem comprar skill de distance.", lim = 350,lim_msg = "Você não pode ter skill distance acima de 350.", price= 1, incre = 1, skill = 4}, ["skillshielding"] = {vocations = {3, 7, 4, 8, 9, 10}, voc_msg= "Somente Paladins, Knights e Drunous podem comprar skill de shield.", lim = 350, lim_msg = "Você não pode ter skill shielding acima de 350.", price= 1, incre = 1, skill = 5}, ["magiclevel5"] = {vocations = {1, 5, 2, 6, 11, 12}, voc_msg= "Somente Sorcerers, Druids e Infernalists podem comprar magic level.", lim = 200, lim_msg = "Você não pode pode ter magic level acima de 200.", price= 15, incre = 5, skill = 7}, ["skillclub10"] = {vocations = {9, 10}, voc_msg= "Somente Drunous podem comprar skill de club.", lim = 350, lim_msg = "Você não pode ter skill club acima de 350.", price= 10, incre = 10, skill = 1}, ["skillsword10"] = {vocations = {4, 8}, voc_msg= "Somente Knights podem comprar skill de sword.", lim = 350, lim_msg = "Você não pode ter skill sword acima de 350.", price= 10, incre = 10, skill = 2}, ["skillaxe10"] = {vocations = {4, 8}, voc_msg= "Somente Knights podem comprar skill de axe.", lim = 350,lim_msg = "Você não pode ter skill axe acima de 350.", price= 10, incre = 10, skill = 3}, ["skilldistance10"] = {vocations = {3, 7}, voc_msg= "Somente Paladins podem comprar skill de distance.", lim = 350,lim_msg = "Você não pode ter skill distance acima de 350.", price= 10, incre = 10, skill = 4}, ["skillshielding10"] = {vocations = {3, 7, 4, 8, 9, 10}, voc_msg= "Somente Paladins, Knights e Drunous podem comprar skill de shield.", lim = 350, lim_msg = "Você não pode ter skill shielding acima de 350.", price= 10, incre = 10, skill = 5}, } function buyComprar.onSay(player, words, param) local player = Player(player) local pid = player:getGuid() local tile = player:getTile() local param = param:lower() if not tile:hasFlag(TILESTATE_PROTECTIONZONE) then player:sendCancelMessage("Você precisa estar em área protegida para utilizar este comando.") return true end if player:getStorageValue(storage) >= os.time() then player:sendCancelMessage("Por medidas de segurança você só pode utilizar este comando em " .. player:getStorageValue(storage)-os.time() .. " segundos.") return true end if param == "" then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, "Para comprar digite !comprar (nome do item)\nOpcoes:\nsd = 4000 em SD por 50 barras.\nuh = 6000 em UH por 40 barras.\nexplo = 6000 em explosion por 10 barras.\nvip10 = 10 dias de vip por 5 barras.\nvip30 = 30 dias de vip por 10 barras.\ndivine staff = divine staff por 30 barras.\ndivine axe = divine axe por 30 barras.\nlivro nivel 6 = livro nivel 6 por 60 barras.\ndivine club = divine club por 30 barras.\ndivine sword = divine sword por 30 barras.\ndivine crossbow = divine crossbow por 30 barras.\nlivro nivel 5 = livro nivel 5 por 30 barras.\nsuper divine axe = super divine axe por 60 barras.\nsuper divine club = super divine club por 60 barras.\nsuper divine sword = super divine sword por 60 barras.\nsuper divine staff = super divine staff por 60 barras.\nsuper divine crossbow = super divine crossbow por 60 barras.\nskillclub = adiciona 1 skill club por 1 barras.\nskillsword = adiciona 1 skill sword por 1 barras.\nskillaxe = adiciona 1 skill axe por 1 barras.\nskilldistance = adiciona 1 skill distance por 1 barras.\nskillshielding = adiciona 1 skill shielding por 1 barras.\nmagiclevel = adiciona 1 magic level por 3 barras.\nmagiclevel5 = adiciona 5 magic level por 15 barras.\nskillclub10 = adiciona 10 skills club por 10 barras.\nskillsword10 = adiciona 10 skills sword por 10 barras.\nskillaxe10 = adiciona 10 skills axe por 10 barras.\nskilldistance10 = adiciona 10 skill distance por 10 barras.\nskillshielding10 = adiciona 10 skill shielding por 10 barras.\nmontaria shadow draptor = montaria shadow draptor por 30 barras.\nmontaria golden lion = montaria golden lion por 30 barras.\nmontaria winter king = montaria winter king por 30 barras.\nmontaria flying divan = montaria flying divan por 30 barras.\nmontaria woodland prince = montaria woodland prince por 30 barras.\nmontaria black stag = montaria black stag por 30 barras.\nmontaria nether steed = montaria nether steed por 30 barras.\nmontaria snow pelt = montaria snow pelt por 30 barras.\nmontaria slagsnare = montaria slagsnare por 30 barras.\nmontaria sea devil = montaria sea devil por 55 barras.\nmontaria highland yak = montaria highland yak por 75 barras.\nmontaria copper fly = montaria copper fly por 60 barras.\nmontaria bloodcurl = montaria bloodcurl por 70 barras.\nmontaria poisonbane = montaria poisonbane por 65 barras.\nmontaria razorcreep = montaria razorcreep por 75 barras.\nmontaria noctungra = montaria noctungra por 70 barras.\nmontaria leafscuttler = montaria leafscuttler por 75 barras.\nmontaria jade pincer = montaria jade pincer por 60 barras.\nmontaria frostflare = montaria frostflare por 85 barras.\nroupa conjurer = roupa conjurer todos addons por 30 barras\nroupa ceremonial garb = roupa ceremonial garb todos addons por 30 barras.\nroupa puppeteer = roupa puppeteer todos addons por 30 barras.\nroupa death herald = roupa death herald todos addons por 30 barras.\nroupa winter warden = roupa winter warden todos addons por 30 barras.\nremoverfrag = remove todos frags por 100k.\nO Item desejado não existe em nosso stock. Veja a cima os detalhes dos items disponível.") return true end if skills[param] then local v = skills[param] if param == "magiclevel" and player:getBaseMagicLevel() >= v.lim or (player:getBaseMagicLevel() + v.incre ) >= v.lim then player:sendCancelMessage(v.lim_msg) return true elseif player:getSkillLevel(v.skill) + v.incre >= v.lim then player:sendCancelMessage(v.lim_msg) return true end if not isInArray(v.vocations, player:getVocation():getId()) then player:sendCancelMessage(v.voc_msg) return true end if player:getItemCount(coinID) >= v.price then player:removeItem(coinID, v.price) player:setStorageValue(storage, os.time()+1) local skillId = v.skill local amount = v.incre for i = 1, amount do local curSkill = player:getSkillLevel(skillId) local curTries = player:getSkillTries(skillId) local voc = player:getVocation() local nextTries = voc:getRequiredSkillTries(skillId, curSkill + 1) player:addSkillTries(skillId, nextTries - curTries + curTries / nextTries * voc:getRequiredSkillTries(skillId, curSkill + 2)) end else player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, "Você não possui a quantidade necessária para comprar.") end return true end return true end buyComprar:separator(" ") buyComprar:register() Você tem alguma imagem que possa auxiliar no problema? Se sim, coloque-a aqui. Entendi o seu pensamento mais ele está errado aquele comando do código addskill playername,quantidade ele usa uma tabela qual a essa para atualizar no banco de dados com os dados inseridos. No seu caso para limitar mude manualmente em cada scripts o limite de skill. lim = 350 Contato :https://www.linkedin.com/in/rafhael-oliveira/Projetos :https://github.com/thetibiaking
Postado Maio 9, 2023 2 anos Autor 34 minutes ago, Underewar said: Entendi o seu pensamento mais ele está errado aquele comando do código addskill playername,quantidade ele usa uma tabela qual a essa para atualizar no banco de dados com os dados inseridos. No seu caso para limitar mude manualmente em cada scripts o limite de skill. lim = 350 então mais o Otserv em si ele já como padrão definido um limite não sei se é na src aonde que é, que o limite é travado ex; 156 para magic level e para skills 202 ou 208, se você olhar os valores de limite no script esta 350... vou dar um exemplo quando você ta jogando um otserv 9999999 chega um limite de level 717172 você não consegue mais passar esse level por que no level maximo, eu tenho esse script aqui é da versão 8.6 que a função é diferente veja if(param == "skillsword") then if getPlayerSkillLevel(cid, SKILL_SWORD) >= 350 then doPlayerSendTextMessage(cid, 6, "Você não pode ter skill acima de 350.") return TRUE end if not isKnight(cid) then doPlayerSendTextMessage(cid, 6, "Somente Knights podem comprar skill de sword.") return TRUE end if getPlayerItemCount(cid, 9971) >= 1 then local pid = getPlayerGUID(cid) local sword = getPlayerSkillLevel(cid, SKILL_SWORD) doPlayerRemoveItem(cid, 9971, 1) doRemoveCreature(cid) db.query("UPDATE `player_skills` SET `value` = " .. (sword + 1) .. ", `count` = 0 WHERE `skillid` = 2 and `player_id` = " .. pid .. ";") return TRUE else doPlayerSendTextMessage(cid, 6, "Você não possui a quantidade necessária para comprar.") return TRUE end a função é por db não sei é assim que fala e funciona perfeitamente db.query("UPDATE `player_skills` SET `value` = " .. (sword + 1) .. ", `count` = 0 WHERE `skillid` = 2 and `player_id` = " .. pid .. ";") agora se você olha esse script em si ele usa player:addSkillTries(skillId, nextTries - curTries + curTries / nextTries * voc:getRequiredSkillTries(skillId, curSkill + 2)) é como se você tivesse pegado o skill na raça treinando
Postado Maio 9, 2023 2 anos Diretor de Projetos 23 minutos atrás, Vitorelias disse: então mais o Otserv em si ele já como padrão definido um limite não sei se é na src aonde que é, que o limite é travado ex; 156 para magic level e para skills 202 ou 208, se você olhar os valores de limite no script esta 350... vou dar um exemplo quando você ta jogando um otserv 9999999 chega um limite de level 717172 você não consegue mais passar esse level por que no level maximo, eu tenho esse script aqui é da versão 8.6 que a função é diferente veja if(param == "skillsword") then if getPlayerSkillLevel(cid, SKILL_SWORD) >= 350 then doPlayerSendTextMessage(cid, 6, "Você não pode ter skill acima de 350.") return TRUE end if not isKnight(cid) then doPlayerSendTextMessage(cid, 6, "Somente Knights podem comprar skill de sword.") return TRUE end if getPlayerItemCount(cid, 9971) >= 1 then local pid = getPlayerGUID(cid) local sword = getPlayerSkillLevel(cid, SKILL_SWORD) doPlayerRemoveItem(cid, 9971, 1) doRemoveCreature(cid) db.query("UPDATE `player_skills` SET `value` = " .. (sword + 1) .. ", `count` = 0 WHERE `skillid` = 2 and `player_id` = " .. pid .. ";") return TRUE else doPlayerSendTextMessage(cid, 6, "Você não possui a quantidade necessária para comprar.") return TRUE end a função é por db não sei é assim que fala e funciona perfeitamente db.query("UPDATE `player_skills` SET `value` = " .. (sword + 1) .. ", `count` = 0 WHERE `skillid` = 2 and `player_id` = " .. pid .. ";") agora se você olha esse script em si ele usa player:addSkillTries(skillId, nextTries - curTries + curTries / nextTries * voc:getRequiredSkillTries(skillId, curSkill + 2)) é como se você tivesse pegado o skill na raça treinando A sim! Agora eu entendi! você quer quebrar o limite! Hoje não consigo criar para você o script, amanha posso te ajudar aqui! Boa Sorte! @Vodkart Contato :https://www.linkedin.com/in/rafhael-oliveira/Projetos :https://github.com/thetibiaking
Postado Maio 9, 2023 2 anos Autor 3 minutes ago, Underewar said: A sim! Agora eu entendi! você quer quebrar o limite! Hoje não consigo criar para você o script, amanha posso te ajudar aqui! Boa Sorte! @Vodkart Vou esperar precisava desse script no meu Servidor, mais obrigado pela atenção Undewar braços
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.