- Fórum
- OTServ
- Recursos
- Scripting
- Globalevents e Spells
- Spell Info ao avançar o level
LA
creatureevent
Spell Info ao avançar o level
Por larissaots, 29 de mai. de 2015 em Globalevents e Spells
script
1
857
Por larissaots, 29 de mai. de 2015 em Globalevents e Spells
info
Grupo: Banidos
Registrado: 07/04/13
Posts: 648
Reputação: +163
Este script foi feito por MaXwEllDeN.
Objetivo
Quando player upar, irá aparecer essa mensagem informando para que level ele avançou e quais magias já pode usar.
Crie o arquivo creaturescripts/scripts/advancespells.lua e adicione o seguinte conteúdo:
function onAdvance(cid, skill, oldLevel, newLevel) if skill == SKILL__LEVEL then local spells = {} for index = 0, getPlayerInstantSpellCount(cid) - 1 do local spell = getPlayerInstantSpellInfo(cid, index) if spell.level > oldLevel and spell.level <= newLevel then table.insert(spells, " [".. spell.name .."] \"".. spell.words .. "\" Mana[".. spell.mana .."]") end end if #spells > 0 then doPlayerSendTextMessage(cid, MESSAGE_EVENT_ORANGE, "You have just advanced to level ".. newLevel .." and learned new spells!") for _, v in pairs(spells) do doPlayerSendTextMessage(cid, MESSAGE_EVENT_ORANGE, v) end end end return true endNo arquivo creaturescripts/creaturescripts.xml adicione a tag:
No seu arquivo creaturescripts/scritps/login.lua adicione a seguinte linha ANTES DO ÚLTIMO return true:
Exemplo:
registerCreatureEvent(cid, "AdvLevelSpells") return true end