Ir para conteúdo

Featured Replies

Postado
  • Autor

 

2 minutos atrás, victor4312 disse:

passa a talktion de !myinfo, vou tentar arrumar pra você.

 

function timeString(timeDiff)
    local dateFormat = {
        {"day", timeDiff / 60 / 60 / 24},
        {"hour", timeDiff / 60 / 60 % 24},
        {"minute", timeDiff / 60 % 60},
        {"second", timeDiff % 60}
    }
    local out = {}
    for k, t in ipairs(dateFormat) do
        local v = math.floor(t[2])
        if(v > 0) then
            table.insert(out, (k < #dateFormat and (#out > 0 and ', ' or '') or ' and ') .. v .. ' ' .. t[1] .. (v ~= 1 and 's' or ''))
        end
    end
    local ret = table.concat(out)
    if ret:len() < 16 and ret:find("second") then
        local a, b = ret:find(" and ")
        ret = ret:sub(b+1)
    end
    
    return ret
end
function getPremiumPoints(cid)
    local query = db.getResult("SELECT `premium_points` FROM `accounts` WHERE `id` = "..getPlayerAccountId(cid))
    return query:getDataInt("premium_points") <= 0 and 0 or query:getDataInt("premium_points")
end
function doCalcPercent(cid, a, b)
    return math.floor(b/a*100)
end
function getExperienceForLevel(lv)
    lv = lv - 1
    return ((50 * lv * lv * lv) - (150 * lv * lv) + (400 * lv)) / 3
end
local var = {
    ["fist fighting"] = 0,
    ["club fighting"] = 1,
    ["sword fighting"] = 2,
    ["axe fighting"] = 3,
    ["distance fighting"] = 4,
    ["shield fighting"] = 5,
    ["fishing"] = 6,
    ["magic"] = 9
}
function ShowMyBuffs(cid)
local show = false
    for store, buff in pairs(command_buffs_storages) do
        if getPlayerStorageValue(cid, store) >= os.time() then
            if show == false then
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"Informacoes dos Buffs:")
                show = true
            end            
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, string.format(buff, timeString(getPlayerStorageValue(cid, store) - os.time())))
        end
    end
end
function onSay(cid, words, param, channel)
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"Premium Points: "..getPremiumPoints(cid))
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"Dias Premmy: "..getPlayerPremiumDays(cid))
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"Dodge Level: "..(getPlayerStorageValue(cid, 98798644) <= 0 and 0 or getPlayerStorageValue(cid, 98798644)))
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"Critical Level: "..(getPlayerStorageValue(cid, 48903) <= 0 and 0 or getPlayerStorageValue(cid, 48903)))
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"Banco: "..getPlayerBalance(cid))    
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"Stamina: "..timeString((getPlayerStamina(cid)*60)))
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"Cap livre: "..getPlayerFreeCap(cid))
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"Experiencia: "..getPlayerExperience(cid))
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"Informacoes das skills de "..getCreatureName(cid))
    local lvl, ln = getPlayerLevel(cid),-(getPlayerExperience(cid) - getExperienceForLevel((getPlayerLevel(cid)+1)))
    local z = (getExperienceForLevel(getPlayerLevel(cid)) - getExperienceForLevel(getPlayerLevel(cid)+1))
    local w = (getExperienceForLevel(getPlayerLevel(cid)) - getPlayerExperience(cid))
    local v = math.floor(w/z*100)
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"- level: "..lvl.." {"..(v <= 0 and 0 or v).."%}. Faltando "..ln.." pontos de experiencia.")
    for name, id in pairs(var) do
        if name == "magic" then
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"- ".. name .. ": "..getPlayerMagLevel(cid).." {" .. doCalcPercent(cid, getPlayerRequiredMana(cid, getPlayerMagLevel(cid)+1), getPlayerSpentMana(cid)) .. "%}. Faltando "..getPlayerRequiredMana(cid, getPlayerMagLevel(cid)+1) - getPlayerSpentMana(cid).." pontos.") 
        else
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"- ".. name .. ": "..getPlayerSkillLevel(cid, id).." {" .. doCalcPercent(cid, getPlayerRequiredSkillTries(cid, id, getPlayerSkillLevel(cid, id)+1), getPlayerSkillTries(cid, id)) .. "%}. Faltando "..getPlayerRequiredSkillTries(cid, id, getPlayerSkillLevel(cid, id)+1) - getPlayerSkillTries(cid, id).." pontos.") 
        end
    end
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"- labia: "..getLabiaLevel(cid).." {" .. doCalcPercent(cid, getLabiaExpTo(getLabiaLevel(cid)+1), getLabiaTries(cid)) .. "%}. Faltando ".. math.floor(getLabiaExpTo(getLabiaLevel(cid)+1) - getLabiaTries(cid)).." pontos.") 
    ShowMyBuffs(cid)
    return true
end

  • Respostas 25
  • Visualizações 3.1k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • O @movie quer o script que aparece essas mensagens ai, acho que é quando clica no livro certo? pega o action que ta nele, e procura em actions.xml depois ve o nome do arquivo, abre ele e posta o scrip

Posted Images

Postado
  • Autor
14 minutos atrás, victor4312 disse:

tenta assim 


function timeString(timeDiff)
    local dateFormat = {
        {"day", timeDiff / 60 / 60 / 24},
        {"hour", timeDiff / 60 / 60 % 24},
        {"minute", timeDiff / 60 % 60},
        {"second", timeDiff % 60}
    }
    local out = {}
    for k, t in ipairs(dateFormat) do
        local v = math.floor(t[2])
        if(v > 0) then
            table.insert(out, (k < #dateFormat and (#out > 0 and ', ' or '') or ' and ') .. v .. ' ' .. t[1] .. (v ~= 1 and 's' or ''))
        end
    end
    local ret = table.concat(out)
    if ret:len() < 16 and ret:find("second") then
        local a, b = ret:find(" and ")
        ret = ret:sub(b+1)
    end
    
    return ret
end
function getPremiumPoints(cid)
    local query = db.getResult("SELECT `premium_points` FROM `accounts` WHERE `id` = "..getPlayerAccountId(cid))
    return query:getDataInt("premium_points") <= 0 and 0 or query:getDataInt("premium_points")
end
function doCalcPercent(cid, a, b)
    return math.floor(b/a*100)
end
function getExperienceForLevel(lv)
    lv = lv - 1
    return ((50 * lv * lv * lv) - (150 * lv * lv) + (400 * lv)) / 3
end
local var = {
    ["fist fighting"] = 0,
    ["club fighting"] = 1,
    ["sword fighting"] = 2,
    ["axe fighting"] = 3,
    ["distance fighting"] = 4,
    ["shield fighting"] = 5,
    ["fishing"] = 6,
    ["magic"] = 9
}
function ShowMyBuffs(cid)
local show = false
    for store, buff in pairs(command_buffs_storages) do
        if getPlayerStorageValue(cid, store) >= os.time() then
            if show == false then
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"Informacoes dos Buffs:")
                show = true
            end            
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, string.format(buff, timeString(getPlayerStorageValue(cid, store) - os.time())))
        end
    end
end
function onSay(cid, words, param, channel)
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"Premium Points: "..getPremiumPoints(cid))
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"Dias Premmy: "..(getPlayerStorageValue(cid, 13500))
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"Dodge Level: "..(getPlayerStorageValue(cid, 98798644) <= 0 and 0 or getPlayerStorageValue(cid, 98798644)))
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"Critical Level: "..(getPlayerStorageValue(cid, 48903) <= 0 and 0 or getPlayerStorageValue(cid, 48903)))
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"Banco: "..getPlayerBalance(cid))    
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"Stamina: "..timeString((getPlayerStamina(cid)*60)))
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"Cap livre: "..getPlayerFreeCap(cid))
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"Experiencia: "..getPlayerExperience(cid))
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"Informacoes das skills de "..getCreatureName(cid))
    local lvl, ln = getPlayerLevel(cid),-(getPlayerExperience(cid) - getExperienceForLevel((getPlayerLevel(cid)+1)))
    local z = (getExperienceForLevel(getPlayerLevel(cid)) - getExperienceForLevel(getPlayerLevel(cid)+1))
    local w = (getExperienceForLevel(getPlayerLevel(cid)) - getPlayerExperience(cid))
    local v = math.floor(w/z*100)
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"- level: "..lvl.." {"..(v <= 0 and 0 or v).."%}. Faltando "..ln.." pontos de experiencia.")
    for name, id in pairs(var) do
        if name == "magic" then
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"- ".. name .. ": "..getPlayerMagLevel(cid).." {" .. doCalcPercent(cid, getPlayerRequiredMana(cid, getPlayerMagLevel(cid)+1), getPlayerSpentMana(cid)) .. "%}. Faltando "..getPlayerRequiredMana(cid, getPlayerMagLevel(cid)+1) - getPlayerSpentMana(cid).." pontos.") 
        else
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"- ".. name .. ": "..getPlayerSkillLevel(cid, id).." {" .. doCalcPercent(cid, getPlayerRequiredSkillTries(cid, id, getPlayerSkillLevel(cid, id)+1), getPlayerSkillTries(cid, id)) .. "%}. Faltando "..getPlayerRequiredSkillTries(cid, id, getPlayerSkillLevel(cid, id)+1) - getPlayerSkillTries(cid, id).." pontos.") 
        end
    end
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"- labia: "..getLabiaLevel(cid).." {" .. doCalcPercent(cid, getLabiaExpTo(getLabiaLevel(cid)+1), getLabiaTries(cid)) .. "%}. Faltando ".. math.floor(getLabiaExpTo(getLabiaLevel(cid)+1) - getLabiaTries(cid)).." pontos.") 
    ShowMyBuffs(cid)
    return true
end

 

 

comando !myinfo nao ta pegando mais

Postado

@Ricardo Tibia 

function onUse(cid, item, frompos, item2, topos)
if item.itemid == 1027 then
local playerpos = getCreaturePosition(cid)
doRemoveItem(item.uid,1027)
doPlayerAddPremiumDays(cid, 10)
doSendMagicEffect(playerpos, 34)
doPlayerSendTextMessage(cid,22,"Voce recebeu 10 dias de premium account.")
end
end

 

Postado
  • Autor
6 minutos atrás, Celulose disse:

@Ricardo Tibia 


function onUse(cid, item, frompos, item2, topos)
if item.itemid == 1027 then
local playerpos = getCreaturePosition(cid)
doRemoveItem(item.uid,1027)
doPlayerAddPremiumDays(cid, 10)
doSendMagicEffect(playerpos, 34)
doPlayerSendTextMessage(cid,22,"Voce recebeu 10 dias de premium account.")
end
end

 

 

onde coloco isso?

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.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Conteúdo Similar

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo