DE

Npc Bugado E Dando Voc Pra Qualquer Lvl

Por deeners2, 07 de mar. de 2012 em Archived

script
otserv
7
1k
deeners2D
07 de março de 2012 às 16:54

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

OverlokerO
07 de março de 2012 às 17:12

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

 

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

deeners2D
09 de março de 2012 às 21:01

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

ZmovirZ
09 de março de 2012 às 21:06

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

OverlokerO
10 de março de 2012 às 08:46

Deu certo?

 

Se deu, já vou deixar a script guardada.

Qualquer coisa né.

VincV
10 de março de 2012 às 12:01

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

a area correta seria duvidas

LorDzL
11 de março de 2012 às 09:56

Seção incorreta, tópico movido.