Npc Bugado E Dando Voc Pra Qualquer Lvl

deeners2
em Lixeira Pública

deeners2

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 03/07/11Posts: 23Char no Tibia: Senhor Feudal

Bom , meu ot é 7.92 e eu tenho esse NPC aqui que tá meio bugado

Eu quero que só level 8 pode se tornar essas vocações , quando um player lvl 300 for lá e der o Spirit of Valan + 500k pro npc , ele dará a vocação , quero que o char seja lvl 8 ! SÓ ISSO. vou deixar o script do NPC , Obrigado

 

local keywordHandler = KeywordHandler:new()

local npcHandler = NpcHandler:new(keywordHandler)

NpcSystem.parseParameters(npcHandler)

 

-- OTServ event handling functions start

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

-- OTServ event handling functions end

 

function creatureSayCallback(cid, type, msg)

-- Place all your code in here. Remember that hi, bye and all that stuff is already handled by the npcsystem, so you do not have to take care of that yourself.

if(npcHandler.focus ~= cid) then

return false

end

 

if msgcontains(msg, 'valan') or msgcontains(msg, 'second promotion') then

selfSay('Bom eu posso torna-lo um valan em troca de um item valioso, lembrando que apos voce conseguir o item e vir aki trocar cmg vc deve vir num level 8 da msm voc que seu char normal que eu o transformarei num valan.')

elseif msgcontains(msg, 'spirit') or msgcontains(msg, 'spirit') then

selfSay('Você gostaria de trocar seu spirit of valan mais 500k? por um personagem valan? lembrando que voce deve ser level 8 para isso.')

talk_state = 1

elseif getPlayerLevel(cid) < 8 then

selfSay('desculpe voce presiza ser level 8.')

talk_state = 1

 

elseif msgcontains(msg, 'yes') and talk_state == 1 then

if getPlayerItemCount(cid,2361) >= 1 and getPlayerItemCount(cid,2160) >= 50 then

if doPlayerTakeItem(cid,2361,1) and doPlayerTakeItem(cid,2160,50) == 0 then

selfSay('Aqui está.')

doPlayerSetVocation(cid, getPlayerVocation(cid)+8)

end

else

selfSay('Desculpe, você não tem os itens requeridos.')

end

 

 

elseif msgcontains(msg, 'no') and (talk_state >= 1 and talk_state <= 5) then

selfSay('Ok.')

talk_state = 0

end

-- Place all your code in here. Remember that hi, bye and all that stuff is already handled by the npcsystem, so you do not have to take care of that yourself.

return true

end

 

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)

npcHandler:addModule(FocusModule:new())

Overloker

@ strength, will and determination !
avatar
Visconde
Visconde

INFOS

Grupo: ViscondeRegistrado: 14/01/08Posts: 461

Não entendi muito bem o que você quer.

 

Só que level's 8 pode usar o NPC? é isso ?

59676330.png

Clique e aprenda a postar na seção correta

deeners2

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 03/07/11Posts: 23Char no Tibia: Senhor Feudal

Isso , todos os lvl's podem falar com o NPC , mais o NPC só vai dar a voc pra quem for lvl 8 !

 

ajuda ae ;s

Zmovir

Shadow Worlds rpg
avatar
Barão
Barão

INFOS

Grupo: BarãoRegistrado: 28/09/10Posts: 237

Testa ai

local keywordHandler = KeywordHandler:new()

local npcHandler = NpcHandler:new(keywordHandler)

NpcSystem.parseParameters(npcHandler)

 

-- OTServ event handling functions start

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

-- OTServ event handling functions end

 

function creatureSayCallback(cid, type, msg)

-- Place all your code in here. Remember that hi, bye and all that stuff is already handled by the npcsystem, so you do not have to take care of that yourself.

if(npcHandler.focus ~= cid) then

return false

end

 

if msgcontains(msg, 'valan') or msgcontains(msg, 'second promotion') then

selfSay('Bom eu posso torna-lo um valan em troca de um item valioso, lembrando que apos voce conseguir o item e vir aki trocar cmg vc deve vir num level 8 da msm voc que seu char normal que eu o transformarei num valan.')

elseif msgcontains(msg, 'spirit') or msgcontains(msg, 'spirit') then

selfSay('Você gostaria de trocar seu spirit of valan mais 500k? por um personagem valan? lembrando que voce deve ser level 8 para isso.')

talk_state = 1

elseif getPlayerLevel(cid) <= 8 then

selfSay('desculpe voce presiza ser level 8.')

talk_state = 1

 

elseif msgcontains(msg, 'yes') and talk_state == 1 then

if getPlayerItemCount(cid,2361) >= 1 and getPlayerItemCount(cid,2160) >= 50 then

if doPlayerTakeItem(cid,2361,1) and doPlayerTakeItem(cid,2160,50) == 0 then

selfSay('Aqui está.')

doPlayerSetVocation(cid, getPlayerVocation(cid)+8)

end

else

selfSay('Desculpe, você não tem os itens requeridos.')

end

 

 

elseif msgcontains(msg, 'no') and (talk_state >= 1 and talk_state <= 5) then

selfSay('Ok.')

talk_state = 0

end

-- Place all your code in here. Remember that hi, bye and all that stuff is already handled by the npcsystem, so you do not have to take care of that yourself.

return true

end

 

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)

npcHandler:addModule(FocusModule:new())

Conheça o shadow worlds clique na imagen

xd9c6.jpg

 

 

 

Metas:

 

Ter uma meta [x]

 

Overloker

@ strength, will and determination !
avatar
Visconde
Visconde

INFOS

Grupo: ViscondeRegistrado: 14/01/08Posts: 461

Deu certo?

 

Se deu, já vou deixar a script guardada.

Qualquer coisa né.

59676330.png

Clique e aprenda a postar na seção correta

Vinc

The white fox
avatar
Conde
Conde

INFOS

Grupo: CondeRegistrado: 30/10/11Posts: 625Gênero: Masculino

area errada,aki é area para postar seu script(compartilhar)

a area correta seria duvidas

^w^

LorDz

Emo cheio de Glitter/ Moderador de OTserv
avatar
Conde
Conde

INFOS

Grupo: CondeRegistrado: 13/05/07Posts: 778Char no Tibia: Shea Fald

Seção incorreta, tópico movido.

Att,

Carlos "LorDz" Alberto



mplz1ajaxizt5mzcdc6n.png

Email: LorDz@XTibia.com