local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
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
local talkState = {}
function creatureSayCallback(cid, type, msg)
if(not npcHandler:isFocused(cid)) then
return false
end
local talkUser = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid
price = 300000
if msgcontains(msg, "second promote") then
selfSay("Olá você quer ser promovido por '.. price ..' diga {yes} por favor.", cid)
talkState[talkUser] = 1
elseif(msgcontains(msg, "yes") and talkState[talkUser] == 1)then
if doPlayerRemoveMoney(cid, price) == TRUE then
if(isInArray({5, 6, 7, 8}, getPlayerVocation(cid))) then
selfSay('Parabens você foi prpmovido!', cid)
doPlayerSetVocation(cid, getPlayerVocation(cid)+4)
talkState[talkUser] = 0
npcHandler:releaseFocus(cid)
else
selfSay('Você já foi promovido', cid)
talkState[talkUser] = 0
npcHandler:releaseFocus(cid)
end
else
selfSay('You don\'t have '.. price ..'', cid)
talkState[talkUser] = 0
npcHandler:releaseFocus(cid)
end
elseif msg == "no" and talkState[talkUser] == 1 then
selfSay("Then not", cid)
talkState[talkUser] = 0
npcHandler:releaseFocus(cid)
end
return TRUE
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
- Fórum
- xTibia - Notícias e Suporte
- Soluções
- Archived
- Ajuda Com Npc De Promotion
4
1.1k
info
Grupo: Herói
Registrado: 20/05/10
Posts: 3.4k
Reputação: +1.5k
Gênero: Masculino

29 de julho de 2010 às 18:31
Editado Julho 29 por Vodkart
info
Grupo: Campones
Registrado: 29/04/10
Posts: 74
Reputação: +5
Char no Tibia: Walking Knight
29 de julho de 2010 às 21:10
Nossa Vlw Aeee Vodkart +REP
1 ano depois...
28 de agosto de 2011 às 03:34
Nossa Vlw Aeee Vodkart +REP
Eu fiz tudo isso ae certinho..
e deu qase certo...
quando eu dou logout.. ele sai a second promotion
(AJUDAAAA)
mais quero saber mais uma coisa.
meu server tem VIP é por Item Actions.
assim que acaba a vip dele. Some essa promotion vip??
e volta pra elite knight normal ??
Obrigado espero resposta
Editado Agosto 28 por daaniel13



info
Grupo: Campones
Registrado: 29/04/10
Posts: 74
Reputação: +5
Char no Tibia: Walking Knight
Tipo do script:Npc De Promotion
Protocolo (versão do Tibia):8.6
Servidor utilizado:
Nível de experiência:não sei
Adicionais/Informações:Queria um npc que adcionava uma nova promotion ao player mais so para Elite knights, elder druid, etc ai promotion eles para TIPO (Arcane Wizard etc) as voc do meu OT vao de 1 á 12 queria que o npc promovesse eles para o 9 a 12!