Ir para conteúdo
  • 0

(resolvido) Ajuda script npc vocation


walissonwashing

Pergunta

galera eu queria por para quando o player falar com o npc transformar na vocation
 mudar o newtype dele aqui tá o npc preciso urgente
 

Spoiler

local item1 = 12620
local quant1 = 600

local vocation547 = 547
local pos = {x=655, y=399, z=7}

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

function santaNPC(cid, message, keywords, parameters, node)
if(not npcHandler:isFocused(cid)) then
return false
end
if(parameters.present == true) then
if(doPlayerRemoveItem(cid,item1,quant1) == true) then
doPlayerSetVocation(cid, 547)
doTeleportThing(cid, pos)
npcHandler:say('Voce agora é broly ultragod.',cid)
else
npcHandler:say('Voce nao tem 600 ultimate coins .',cid)
end
npcHandler:resetNpc()
return true
end
end

npcHandler:setMessage(MESSAGE_GREET, "Ola |PLAYERNAME|. Voce quer ser {broly ultragod}?.")

local noNode = KeywordNode:new({'no'}, santaNPC, {present = false})
local yesNode = KeywordNode:new({'yes'}, santaNPC, {present = true})

local node = keywordHandler:addKeyword({'broly ultragod'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Voce quer realmente ser broly ultragod?, você não ira se arrepender. {yes}'})
node:addChildKeywordNode(yesNode)
node:addChildKeywordNode(noNode)
npcHandler:addModule(FocusModule:new())

 

darei REP ++

Link para o comentário
Compartilhar em outros sites

3 respostass a esta questão

Posts Recomendados

  • 0
9 horas atrás, walissonwashing disse:

galera eu queria por para quando o player falar com o npc transformar na vocation

 mudar o newtype dele aqui tá o npc preciso urgente

 

  Mostrar conteúdo oculto

local item1 = 12620

local quant1 = 600

local vocation547 = 547

local pos = {x=655, y=399, z=7}

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

function santaNPC(cid, message, keywords, parameters, node)

if(not npcHandler:isFocused(cid)) then

return false

end

if(parameters.present == true) then

if(doPlayerRemoveItem(cid,item1,quant1) == true) then

doPlayerSetVocation(cid, 547)

doTeleportThing(cid, pos)

npcHandler:say('Voce agora é broly ultragod.',cid)

else

npcHandler:say('Voce nao tem 600 ultimate coins .',cid)

end

npcHandler:resetNpc()

return true

end

end

npcHandler:setMessage(MESSAGE_GREET, "Ola |PLAYERNAME|. Voce quer ser {broly ultragod}?.")

local noNode = KeywordNode:new({'no'}, santaNPC, {present = false})

local yesNode = KeywordNode:new({'yes'}, santaNPC, {present = true})

local node = keywordHandler:addKeyword({'broly ultragod'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Voce quer realmente ser broly ultragod?, você não ira se arrepender. {yes}'})

node:addChildKeywordNode(yesNode)

node:addChildKeywordNode(noNode)

npcHandler:addModule(FocusModule:new())

 

darei REP ++

 

local outfit = 20 -- nmr do newtypelocal item1 = 12620local quant1 = 600local vocation547 = 547local pos = {x=655, y=399, z=7}local keywordHandler = KeywordHandler:new()local npcHandler = NpcHandler:new(keywordHandler)NpcSystem.parseParameters(npcHandler)function onCreatureAppear(cid)  npcHandler:onCreatureAppear(cid)  endfunction onCreatureDisappear(cid)  npcHandler:onCreatureDisappear(cid)  endfunction onCreatureSay(cid, type, msg)  npcHandler:onCreatureSay(cid, type, msg)  endfunction onThink()  npcHandler:onThink()  endfunction santaNPC(cid, message, keywords, parameters, node)if(not npcHandler:isFocused(cid)) thenreturn falseendif(parameters.present == true) thenif(doPlayerRemoveItem(cid,item1,quant1) == true) thendoPlayerSetVocation(cid, 547)doSetCreatureOutfit(cid, {lookType = outfit}, -1)doTeleportThing(cid, pos)npcHandler:say('Voce agora é broly ultragod.',cid)elsenpcHandler:say('Voce nao tem 600 ultimate coins .',cid)endnpcHandler:resetNpc()return trueendendnpcHandler:setMessage(MESSAGE_GREET, "Ola |PLAYERNAME|. Voce quer ser {broly ultragod}?.")local noNode = KeywordNode:new({'no'}, santaNPC, {present = false})local yesNode = KeywordNode:new({'yes'}, santaNPC, {present = true})local node = keywordHandler:addKeyword({'broly ultragod'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Voce quer realmente ser broly ultragod?, você não ira se arrepender. {yes}'})node:addChildKeywordNode(yesNode)node:addChildKeywordNode(noNode)npcHandler:addModule(FocusModule:new())

 

Link para o comentário
Compartilhar em outros sites

Visitante
Este tópico está impedido de receber novos posts.
×
×
  • Criar Novo...