Too testando no Bills numero da vocação é 212
Man eu tenho um script akii do npc maiiis nao sei editar.
Eu queria que o npc transformase qualquer vocação em Bills mais ele só transformar a 2.
E quando ele transformase em Bills o player relogava e quando voltase ja estaria com o looktype de Bills.
Resumindo: Queria que trocase a vocação e o outifit de qualquer player mais precisaria do item nessesario segue o script:
local item1 = 9971
local quant1 = 1
local vocation13 = 6
local pos = {x=160, y=58, 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 getPlayerVocation(cid) ~= 2 then
npcHandler:say('Vaza mano você não é vocation 2.',cid)
return false
end
if(parameters.present == true) then
if(doPlayerRemoveItem(cid,item1,quant1) == true) then
doPlayerSetVocation(cid, 6)
doTeleportThing(cid, pos)
npcHandler:say('You changed your vocation to vocation of the Angel.',cid)
else
npcHandler:say('You have ever vocation is the Angel or do not have the necessary items .',cid)
end
npcHandler:resetNpc()
return true
end
end
npcHandler:setMessage(MESSAGE_GREET, "Hello |PLAYERNAME|. Do you want to be promoted to {angel}?.")
local noNode = KeywordNode:new({'no'}, santaNPC, {present = false})
local yesNode = KeywordNode:new({'yes'}, santaNPC, {present = true})
local node = keywordHandler:addKeyword({'angel'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Bring me an enchanted wing !. Do you sure? it will be irreversible! {yes}'})
node:addChildKeywordNode(yesNode)
node:addChildKeywordNode(noNode)
npcHandler:addModule(FocusModule:new())
Conseguir eliminar algumas partes que estava dando erro no script voou posta para a posteridade não ter dor de cabeça.
local item1 = 4759
local quant1 = 1
local vocation13 = 212
local pos = {x=160, y=58, 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, 212)
npcHandler:say('You changed your vocation to vocation of the Angel.',cid)
else
npcHandler:say('You have ever vocation is the Angel or do not have the necessary items .',cid)
end
npcHandler:resetNpc()
return true
end
end
npcHandler:setMessage(MESSAGE_GREET, "Hello |PLAYERNAME|. Do you want to be promoted to {angel}?.")
local noNode = KeywordNode:new({'no'}, santaNPC, {present = false})
local yesNode = KeywordNode:new({'yes'}, santaNPC, {present = true})
local node = keywordHandler:addKeyword({'angel'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Bring me an enchanted wing !. Do you sure? it will be irreversible! {yes}'})
node:addChildKeywordNode(yesNode)
node:addChildKeywordNode(noNode)
npcHandler:addModule(FocusModule:new())
Só editar a sua escolha preechendo as opções.. haa lembrando que tem que colocar o numero da vocação nessa parte doPlayerSetVocation(cid, 212) se não vai dar erro.