• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

talkacton !buy skill tfs 1.4

vitorelias1

New Member
Joined
Sep 27, 2022
Messages
27
Reaction score
2
hi guys good night!

i use tfs 1.4 i have this script, but there is a problem in this script the skill limit is locked ex; skill, axe, sword, club, distance, max 208 and ml 156.
and in the script the maximum you can buy is 350 for axe,sword,club and distance é 350 and , magic level 200.

maybe I would need to modify it to put it by database I really needed this script
I don't know if it's possible to put it by db.query I saw this function here but I don't know

db.query("UPDATE " .. db_table .. " SET " .. db_set_column .. " = " .. (db_skill_value + db_skill_value_sum) .. " WHERE id = " .. player:getGuid() .. ";")


Lua:
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()

up
 
Last edited:
Back
Top