Sem fazer nada, achei interessante essa coisa de presente lá no global wars, resolvi fazer um bem básico só para testar, fazia muito tempo que não postava nada mesmo.
Crie um arquivo na pasta creaturescript/scripts com nome de presentes.lua
function onAdvance(cid, skill, oldLevel, newLevel) if getPlayerStorageValue(cid, 99963) < 1 and getPlayerLevel(cid) >= 19 then doPlayerAddLevel(cid,30) setPlayerStorageValue(cid, 99963, 1) doPlayerSendTextMessage(cid,22,"Voce recebeu 30 leveis de presente") return 1 end if getPlayerStorageValue(cid, 99962) < 2 and getPlayerLevel(cid) >= 70 then doPlayerAddItem(cid,2160,2) setPlayerStorageValue(cid, 99962, 2) doPlayerSendTextMessage(cid,22,"Voce recebeu 20k de dinheiro") return 1 end if getPlayerStorageValue(cid, 99961) < 3 and getPlayerLevel(cid) >= 125 then doPlayerAddItem(cid,2160,10) setPlayerStorageValue(cid, 99961,3) doPlayerSendTextMessage(cid,22,"Voce recebeu 100k de dinheiro") return 1 end if getPlayerStorageValue(cid, 99960) < 4 and getPlayerLevel(cid) >= 200 then doPlayerAddItem(cid,2160,20) setPlayerStorageValue(cid, 99960,4) doPlayerSendTextMessage(cid,22,"Voce recebeu 200k de dinheiro") return 1 end return TRUE end
depois na creaturescript.xml coloque a tag.
<event type="advance" name="presente" event="script" value="presentes.lua"/>
logo em seguida registra o evento no login.lua
registerCreatureEvent(cid, "presente")
Depois, só rodar e seja feliz ;D
Altere do seu jeito ;D