ZA

Ajuda Com Npc De Promotion

Por ZaskxD, 29 de jul. de 2010 em Archived

tibia
script
otserv
4
1.1k
ZaskxDZ
29 de julho de 2010 às 18:04

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!

VodkartV
29 de julho de 2010 às 18:31
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())

Editado Julho 29 por Vodkart

ZaskxDZ
29 de julho de 2010 às 21:10

Nossa Vlw Aeee Vodkart +REP

1 ano depois...
daaniel13D
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