Ir para conteúdo

Featured Replies

Postado
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,msg = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid,msg:lower()
local level, storage = 8, 437369
local class = {["mage"] = 1,["savage"] = 2, ["warrior"] = 3} -- defina as classes
if (msgcontains(msg, 'vocation') or msgcontains(msg, 'class')) then
npcHandler:say("So you are a decided one. What is your path? Follow your natural instincts as a {savage}. Bend the elements arround you, become a {mage}. Face and fright your enemies, {warrior}!", cid)
talkState[talkUser] = 1
elseif talkState[talkUser] == 1 then
if class[msg] then
if getPlayerLevel(cid) >= level and getPlayerVocation(cid) <= 0 then
setPlayerStorageValue(cid, storage, 1)
doPlayerSetVocation(cid, class[msg])
npcHandler:say("Congratulations! You have become a "..msg, cid)
talkState[talkUser] = 0
else
npcHandler:say("You are not prepared yet. Come back when you get stronger. Reach level "..level..".", cid)
talkState[talkUser] = 0
end
else
npcHandler:say("Sorry, choose a {savage}, {mage} or {warrior}!", cid)
end
elseif msg == "no" then
selfSay("I will be waiting for you when you change your mind", cid)
talkState[talkUser] = 0
npcHandler:releaseFocus(cid)
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

 

fala assim:

 

hi

class ou vocation

fala o nome da vocação, exemplo: savage

 

Editado por Vodkart (veja o histórico de edições)

vodkart_logo.png

[*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*]

 

DISCORDvodkart#6090

 

  • Respostas 6
  • Visualizações 585
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} function onCreatureAppear(cid) npcHandler:onCre

Postado
27 minutos atrás, Vodkart disse:

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,msg = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid,msg:lower()
local level, storage = 8, 437369
local class = {["mage"] = 1,["savage"] = 2, ["warrior"] = 3} -- defina as classes
if (msgcontains(msg, 'vocation') or msgcontains(msg, 'class')) then
npcHandler:say("So you are a decided one. What is your path? Follow your natural instincts as a {savage}. Bend the elements arround you, become a {mage}. Face and fright your enemies, {warrior}!", cid)
talkState[talkUser] = 1
elseif talkState[talkUser] == 1 then
if class[msg] then
if getPlayerLevel(cid) >= level and getPlayerVocation(cid) <= 0 then
setPlayerStorageValue(cid, storage, 1)
doPlayerSetVocation(cid, class[msg])
npcHandler:say("Congratulations! You have become a "..msg, cid)
talkState[talkUser] = 0
else
npcHandler:say("You are not prepared yet. Come back when you get stronger. Reach level "..level..".", cid)
talkState[talkUser] = 0
end
else
npcHandler:say("Sorry, choose a {savage}, {mage} or {warrior}!", cid)
end
elseif msg == "no" then
selfSay("I will be waiting for you when you change your mind", cid)
talkState[talkUser] = 0
npcHandler:releaseFocus(cid)
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

 

fala assim:

 

hi

class ou vocation

fala o nome da vocação, exemplo: savage

 

 

Pow man da pra ti me ajuda no meu topico pf

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo