Ir para conteúdo
  • Cadastre-se

Derivado (PEDIDO) MOD Military Rank Level!


Posts Recomendados

Greetings people of TibiaKing, i need help of scripter, because, i need modify a mod, the mod is Military Rank, but instead Rank Frags, that be of levels, if it can be do, please help me and modify these mod, thanks.

Here is the mod if in doubt:

<?xml version = "1.0" encoding = "UTF-8"?>
    <mod name = "Military Ranks" version = "1.0" author = "Teckman" enabled = "yes">
        <config name = "ranks"><![CDATA[
            titles = {
                [5] = "Private First Class",
                [10] = "Specialist",
                [15] = "Corporal",
                [20] = "Sergeant",
                [25] = "Staff Sergeant",
                [30] = "Sergeant First Class",
                [35] = "Master Sergeant",
                [40] = "First Sergeant",
                [45] = "Sergeant Major",
                [50] = "Command Sergeant Major",
                [55] = "Sergeant Major of the Army",
                [60] = "Second Lieutenant",
                [65] = "First Lieutenant",
                [70] = "Captain",
                [75] = "Major",
                [80] = "Lieutenant Colonel",
                [90] = "Colonel",
                [100] = "Brigadier General",
                [110] = "Major General",
                [120] = "Lieutenant General",
                [140] = "General",
                [170] = "General of the Army"
            }
            fragsStorage = 600
        ]]></config>
        <event type = "look" name = "ranksLook" event = "script"><![CDATA[
            domodlib("ranks")
            function onLook(cid, thing, position, lookDistance)
                if(isPlayer(thing.uid)) then
                    local rank = {rank = "Private", frags = 0}
                    for k, v in pairs(titles) do
                        if(math.max(0, getPlayerStorageValue(thing.uid, fragsStorage)) > k - 1) then
                            if(k - 1 > rank.frags) then
                                rank.rank, rank.frags = v, k - 1
                            end
                        end
                    end
                    doPlayerSetSpecialDescription(thing.uid, "\n Military rank: " .. rank.rank)
                end
                return true
            end
        ]]></event>
        <event type = "kill" name = "ranksKill" event = "script"><![CDATA[
            domodlib("ranks")
            function onKill(cid, target)
                if(isPlayer(target)) then
                    setPlayerStorageValue(cid, fragsStorage, math.max(0, getPlayerStorageValue(cid, fragsStorage) + 1))
                    if(titles[getPlayerStorageValue(cid, fragsStorage)]) then
                        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You advanced to military rank: " .. titles[getPlayerStorageValue(cid, fragsStorage)] .. ". Congratulations " .. titles[getPlayerStorageValue(cid, fragsStorage)] .. "!")
                    end
                end
                return true
            end
        ]]></event>
        <event type = "login" name = "ranksLogin" event = "script"><![CDATA[
            function onLogin(cid)
                registerCreatureEvent(cid, "ranksKill")
                registerCreatureEvent(cid, "ranksLook")
                return true
            end
        ]]></event>
    </mod>

 

Link para o post
Compartilhar em outros sites
36 minutos atrás, Dempsey disse:

Greetings people of TibiaKing, i need help of scripter, because, i need modify a mod, the mod is Military Rank, but instead Rank Frags, that be of levels, if it can be do, please help me and modify these mod, thanks.

Here is the mod if in doubt:


<?xml version = "1.0" encoding = "UTF-8"?>
    <mod name = "Military Ranks" version = "1.0" author = "Teckman" enabled = "yes">
        <config name = "ranks"><![CDATA[
            titles = {
                [5] = "Private First Class",
                [10] = "Specialist",
                [15] = "Corporal",
                [20] = "Sergeant",
                [25] = "Staff Sergeant",
                [30] = "Sergeant First Class",
                [35] = "Master Sergeant",
                [40] = "First Sergeant",
                [45] = "Sergeant Major",
                [50] = "Command Sergeant Major",
                [55] = "Sergeant Major of the Army",
                [60] = "Second Lieutenant",
                [65] = "First Lieutenant",
                [70] = "Captain",
                [75] = "Major",
                [80] = "Lieutenant Colonel",
                [90] = "Colonel",
                [100] = "Brigadier General",
                [110] = "Major General",
                [120] = "Lieutenant General",
                [140] = "General",
                [170] = "General of the Army"
            }
            fragsStorage = 600
        ]]></config>
        <event type = "look" name = "ranksLook" event = "script"><![CDATA[
            domodlib("ranks")
            function onLook(cid, thing, position, lookDistance)
                if(isPlayer(thing.uid)) then
                    local rank = {rank = "Private", frags = 0}
                    for k, v in pairs(titles) do
                        if(math.max(0, getPlayerStorageValue(thing.uid, fragsStorage)) > k - 1) then
                            if(k - 1 > rank.frags) then
                                rank.rank, rank.frags = v, k - 1
                            end
                        end
                    end
                    doPlayerSetSpecialDescription(thing.uid, "\n Military rank: " .. rank.rank)
                end
                return true
            end
        ]]></event>
        <event type = "kill" name = "ranksKill" event = "script"><![CDATA[
            domodlib("ranks")
            function onKill(cid, target)
                if(isPlayer(target)) then
                    setPlayerStorageValue(cid, fragsStorage, math.max(0, getPlayerStorageValue(cid, fragsStorage) + 1))
                    if(titles[getPlayerStorageValue(cid, fragsStorage)]) then
                        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You advanced to military rank: " .. titles[getPlayerStorageValue(cid, fragsStorage)] .. ". Congratulations " .. titles[getPlayerStorageValue(cid, fragsStorage)] .. "!")
                    end
                end
                return true
            end
        ]]></event>
        <event type = "login" name = "ranksLogin" event = "script"><![CDATA[
            function onLogin(cid)
                registerCreatureEvent(cid, "ranksKill")
                registerCreatureEvent(cid, "ranksLook")
                return true
            end
        ]]></event>
    </mod>

 

 

u want this same script, but... Rank for LEVEL of players? is this?

 

@This life is filled with hurt

When happiness doesn't work

Trust me and take my hand

When the lights go out you will understand

Link para o post
Compartilhar em outros sites

Yeah, i mean, frags = level

 level>>>>> [5] = "Private First Class", <<< rank

Maybe it is not possible in mod, but will there be any script for it?

Thanks for your contribution.

 

[5] = "Private First Class",
                [10] = "Specialist",
                [15] = "Corporal",
                [20] = "Sergeant",
Link para o post
Compartilhar em outros sites

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

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.


  • Conteúdo Similar

    • Por LeoTK
      Salve galera neste tópico irei postar algumas prints do mapa do servidor para quem queira acompanhar e quem sabe até utilizar de inspiração para mapear o seu NTO.
       
      #Att 11/08/2022

       
       
       
       
      Konoha (Em Desenvolvimento)
       
       
       
       
    • Por DiigooMix
      Como o título já diz, será que alguém possui sprite do hitto e se possível as transformações dele?
    • Por OmegaZero
      Olá gostaria que alguém me ajudasse com uma "scripting" não sei se é pela mesma, seria o seguinte uma determinada arma teria a chance de dar double hit e não sei oque fazer alguem poderia ajudar?

      OBS:não sei se é o local correto se não for mova, desculpe
    • Por Madarasenju
      Olá galera do Tibia King, queria por uns npc's no meu server que não tem função de trade nem nada do tipo, queria que eles só andassem como enfeite, Rep+ Pra quem me ajudar... grato desde já.
    • Por SilenceRoot
      A magia é assim o você usa a a magia e ela ficará ativado por 10 segundos, até que o inimigo lance a primeira magia ou todos de uma vez, quando ele lançar a primeira magia, ele não lhe acertará ou seja esquivando dela, e logo em seguida será teletransportado aleatoriamente ao redor do inimigo que usou.
×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo