Acabou de sair do forno =]
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Reborn" script="Reborn.lua">
<health now="100" max="100"/>
<look type="325" head="114" body="114" legs="114" feet="114" addons="2"/>
<parameters>
<parameter key="message_greet" value="Olá sou {Reborn} o {senhor das trevas}! Posso {resetar} você para ficar mais forte." />
</parameters>
</npc>
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}
function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end
function onThink() npcHandler:onThink() end
function creatureSayCallback(cid, type, msg)
if(not npcHandler:isFocused(cid)) then
return false
end
local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
if(msgcontains(msg, 'reset') or msgcontains(msg, 'resetar')) then
selfSay('Você dejesa se {transformar na super evolução} ? Para isso vou ter que {tirar o seu pode!}', cid)
talkState[talkUser] = 1
elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 1) then
if getPlayerPremiumDays(cid) <= 0 then
npcHandler:say('Você não tem {premium} {account}.', cid)
talkState[talkUser] = 0
return true
end
if(getPlayerPromotionLevel(cid) == 2) then
selfSay('Você {já tem super promotion} !', cid)
else
if(getPlayerPromotionLevel(cid) == 1) then
if getPlayerLevel(cid) >= 300 then
doPlayerSetPromotionLevel(cid, 2)
doPlayerAddLevel(cid, (-getPlayerLevel(cid)), 1)
doPlayerAddLevel(cid, 19, 1)
doSendMagicEffect(getCreaturePosition(cid), 17)
selfSay("Você acaba de ser promovido para {"..getPlayerVocationName(cid).."}.", cid)
else
npcHandler:say('Você não é {level 300+} !', cid)
end
else
selfSay('Você {não tem promotion} !', cid)
end
end
talkState[talkUser] = 0
end
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
Já testei...
É por isso que eu gosto de ajudar (pelo menos tentar ajudar) este fórum, os caras sabe Agradecer né?
Att,
ஓ PẫulǾ ஓ
paulo.boc@hotmail.com