Bar Spell
Está me dando muita angustia ver o xtibia tão decaido e com pouco conteudo então resolvi dar a minha contribuição.
Então resolvi posta a bar spell que desenvolvi num antigo projeto de naruto.
A barra de spell e uma barrinha que lista todas as spells de um character ela não usa opcode.
Vamos começar extraia na sua pasta modules do otclient o arquivo anexado no topico agora vamos a seu otserv e crie uma arquivo lua em data/lib chamado spell e coloque isto:
function sendSpellsForBarSpell(cid) local dir = "data/spells/spells.xml" str = "ShowJutsu/" print("oi") local monster = io.open(dir, "r") for i in monster:read("*a"):gmatch('<instant(.-)</instant>') do local name = i:match('name="(.-)"') if string.find(i, '<vocation id="'..getPlayerVocation(cid)..'"/>') or string.find(i, 'needlearn="0"') and not string.find(i, '<vocation id') or getPlayerLearnedInstantSpell(cid, name) then local level = i:match('lvl="(.-)"') local word = i:match('words="(.-)"') if getPlayerLevel(cid) >= tonumber(level) then str = str..name.."-"..word.."/" end end end doPlayerSendCancel(cid, str) doPlayerSendCancel(cid, "Barra de moves atulizada") end
function onAdvance(cid, skill, oldLevel, newLevel) if skill ~= 8 then return true end sendSpellsForBarSpell(cid) return true end
<event type="advance" name="bspell" event="script" value="bspell.lua"/>
registerCreatureEvent(cid, "bspell")
Coloque isto em login.lua depois de onLogin(cid)
(Se quiser para você pode retirar a barra do account manager colocando isto depois da verificaço do account manager) :
sendSpellsForBarSpell(cid)