Npc Que Da Second Promotion, Ajuda Por Favor!

WolfyP
Por WolfyP
em Lixeira Pública

WolfyP

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 30/01/11Posts: 3Char no Tibia: Bola Aposentado

Pra procurei em todo canto mas nao acho, em fim, tentei fazer um, consegui, mas toda vez que o player reloga volta pra promotion anterior...

 

aqui:

 

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, 'promotion') or msgcontains(msg, 'second promotion')) then
selfSay('So you want to get your D-promotion, uhn...', cid)
talkState[talkUser] = 1
elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 1) then
if isPremium(cid) then
doPlayerSetVocation(cid, getPlayerVocation(cid)+4)
selfSay('Ok. Now you are D-promoted. Congractulations!', cid)
else
selfSay('Sorry, you must get a Premium Account for this promotion.', cid)
end
talkState[talkUser] = 0
end
return true
end
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())