Ir para conteúdo

Posts Recomendados

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())

Link para o comentário
https://xtibia.com/forum/topic/176800-npc-que-da-second-promotion-ajuda-por-favor/
Compartilhar em outros sites

  • Quem Está Navegando   0 membros estão online

    • Nenhum usuário registrado visualizando esta página.
×
×
  • Criar Novo...