function onUse(cid, item, frompos, item2, topos)
config = {
storage = XXXX,
spellName = "XXXX" --nome da spell, que esta no spells.xml
}
if getPlayerStorageValue(cid, config.storage) <= 0 then
if not getPlayerLearnedInstantSpell(cid, config.spellName) then
if canPlayerLearnInstantSpell(cid, config.spellName) then
doPlayerLearnInstantSpell(cid, config.spellName)
doPlayerSendTextMessage(cid, 25, "Parabéns! você aprendeu uma nova magia.")
setPlayerStorageValue(cid, config.storage, 1)
else
doPlayerSendCancel(cid, "You cannot do this mission because you cant learn the spell.")
end
else
doPlayerSendCancel(cid, "You have already learned the spell.")
end
else
doPlayerSendCancel(cid, "You have already done.")
end
return TRUE
end
Créditos a 'apocaria'
em http://www.xtibia.com/forum/topic/130884-resolvido-comprar-magias/







info
Grupo: Campones
Registrado: 03/08/09
Posts: 64
Reputação: +6
Gênero: Masculino
Ola, Gostaria de um Script que se um player usase um item ele ganharia uma magia.
ou si nao
um script que o npc vende a magia
e se der tambem, se desse pra upar a magia estilo perfect world, nivel 1 ao 10.
Vlws ae QUem Ajudo.