Como Por O Comando !spells No Meu Otserver?

Galinho15
em Lixeira Pública

Galinho15

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 05/12/09Posts: 1

Pessoal tenho um ot server 8.50 SQL e quero por o comando !Spells para informar as magias e os levels dela.

Como se fosse um !notice mais em forma de !spells

Como faço isso?

obrigado.

rockstar96

Around the world
avatar
Barão
Barão

INFOS

Grupo: BarãoRegistrado: 01/07/09Posts: 216

/data/talkactions/scripts/spells.lua

function onSay(cid, words, param)
    local count = getPlayerInstantSpellCount(cid)
    local text = ""
    local t = {}
    for i = 0, count - 1 do
        local spell = getPlayerInstantSpellInfo(cid, i)
        if spell.level ~= 0 then
            if spell.manapercent > 0 then
                spell.mana = spell.manapercent .. "%"
            end
            table.insert(t, spell)
        end
    end
    table.sort(t, function(a, b) return a.level < b.level end)
    local prevLevel = -1
    for i, spell in ipairs(t) do
        local line = ""
        if prevLevel ~= spell.level then
            if i ~= 1 then
                line = "\n"
            end
            line = line .. "Spells for Level " .. spell.level .. "\n"
            prevLevel = spell.level
        end
        text = text .. line .. "  " .. spell.words .. " - " .. spell.name .. " : " .. spell.mana .. "\n"
    end
    doPlayerPopupFYI(cid, text)
    return TRUE
end

 

/data/talkactions/talkactions.xml

<talkaction words="!spells" event="script" value="spells.lua"/>

 

 

 

 

 

 

Este script foi feito pela equipe TFS, adaptado para funcionar com talkactions.

Killua

Vivendo e Aprendendo
avatar
Conde
Conde

INFOS

Grupo: CondeRegistrado: 29/04/09Posts: 904Char no Tibia: Jabuti Selvagem

Galinho15

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 05/12/09Posts: 1
Mas, iRockStar. Isso eu tenho que mudar todas as magias ou ele automáticamente se adapta às magias do meu OT?

 

Faço de suas palavras, as minhas.

 

Killua

Vivendo e Aprendendo
avatar
Conde
Conde

INFOS

Grupo: CondeRegistrado: 29/04/09Posts: 904Char no Tibia: Jabuti Selvagem

gkaonicx72

avatar
Marquês
Marquês

INFOS

Grupo: MarquêsRegistrado: 16/07/08Posts: 1130Char no Tibia: -

Acho mais fácil você testar e ver, mais pelo que entendo de scripting acho que ele vai se adaptar somente as que o player pode usar. Por exemplo se ele for knight só vai aparecer as de knight e pro level dele.

Até mais.

Atenciosamente, Kaonic

Trabalhando para um futuro melhor do Xtibia - By Kaonic, não use sem colocar os créditos.

Email (não uso como msn): kaonic@xtibia.com

MSN: Envie MP

Mapping Teacher: Koddy

 

Copa XTibia Design - Participante #2 do Grupo A



1277160188-U5886.jpg

 

 

Gifts:



Moskitinho ** -Reji * -Dj Sky * -ShadowDemon** -NightAdams **

Galinho15

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 05/12/09Posts: 1
/data/talkactions/scripts/spells.lua

function onSay(cid, words, param)
    local count = getPlayerInstantSpellCount(cid)
    local text = ""
    local t = {}
    for i = 0, count - 1 do
        local spell = getPlayerInstantSpellInfo(cid, i)
        if spell.level ~= 0 then
            if spell.manapercent > 0 then
                spell.mana = spell.manapercent .. "%"
            end
            table.insert(t, spell)
        end
    end
    table.sort(t, function(a, b) return a.level < b.level end)
    local prevLevel = -1
    for i, spell in ipairs(t) do
        local line = ""
        if prevLevel ~= spell.level then
            if i ~= 1 then
                line = "\n"
            end
            line = line .. "Spells for Level " .. spell.level .. "\n"
            prevLevel = spell.level
        end
        text = text .. line .. "  " .. spell.words .. " - " .. spell.name .. " : " .. spell.mana .. "\n"
    end
    doPlayerPopupFYI(cid, text)
    return TRUE
end

 

/data/talkactions/talkactions.xml

<talkaction words="!spells" event="script" value="spells.lua"/>

 

 

 

 

 

 

Este script foi feito pela equipe TFS, adaptado para funcionar com talkactions.

 

Testei isso no meu slayer yurotss 8.50 e não pegou...

Eu falo o comando !spells mais não acontece simplesmente nada.