Esta ai o npc
Provavelmente vai ter erros, porque nao testei !!!
Ignore os erros de portugues !!
Edite as frases de acordo com a situaçao !!!
Na posta data/npc copia qualquer arquivo .xml e renomeie para missao e ponha isto
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Zero Blank" script="data/npc/scripts/missao.lua" walkinterval="5000" floorchange="0">
<health now="100" max="100"/>
<look type="128" head="100" body="40" legs="80" feet="90" addons="3"/>
<parameters>
<parameter key="message_greet" value="Hey |PLAYERNAME|, tenho uma {missao} pra voce !!!" />
</parameters>
</npc>
Pode editar a frase como quiser so nao mexa no {missao}
Crie outro renomeie outro arquivo .xml e o renomeie para missao2 e ponha isto
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Xiro Blank" script="data/npc/scripts/missao2.lua" walkinterval="5000" floorchange="0">
<health now="100" max="100"/>
<look type="128" head="100" body="40" legs="80" feet="90" addons="3"/>
<parameters>
<parameter key="message_greet" value="Hey |PLAYERNAME|, voce falou com meu {irmao} ??" />
</parameters>
</npc>
Agora em scripts copie 1 arquivo .lua cole e renomeie para missao e ponha isto
-------------------
--- NPC MISSAO ----
--- by:Neerd ---
-------------------
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}
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 creatureSayCallback(cid, type, msg)
if(not npcHandler:isFocused(cid)) then
return false
end
local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
if msgcontains(msg, 'missao') then
if getPlayerStorageValue(cid,5537) == -1 then
selfSay('Quero que voce leve (ITEM) ao meu irmao Xiro Blank.', cid)
selfSay('Voce pode me fazer este favor?? {yes}',cid)
talkState[talkUser] = 1
else
selfSay('Voce ja me fez, este favor.',cid)
end
if(msgcontains(msg, 'yes') and talkState[talkUser] == 1) then
doPlayerAddItem(cid,ID DO ITEM, QUANTIDADE DO ITEM)
selfSay('Voce pode encontralo proximo do templo....',cid)
setPlayerStorageValue(cid,5537,1)
end
return true
end
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
Dentro dos selfSay estao as frases vode pode editar como preferir, onde esta escrito id do item,quantidade do item voce poe o item que ele tem que levar pro irmao dele
copie 1 arquivo .lua cole e renomeie para missao2 e ponha isto
-------------------
--- NPC MISSAO ----
--- by:Neerd ----
-------------------
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}
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 creatureSayCallback(cid, type, msg)
if(not npcHandler:isFocused(cid)) then
return false
end
local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
if msgcontains(msg, 'irmao') then
if getPlayerStorageValue(cid,5537) == 1 then
selfSay('Voce me trouce ITEM, vejo que Zero Blank nao se esqueceu de min...', cid)
selfSay('Obrigado pela ajuda !',cid)
doPlayerAddItem(cid,2160, 10)
setPlayerStorageValue(cid,5537,2)
else
selfSay('Voce deve falar com Zero Blank primeiro.',cid)
end
if getPlayerStorageValue(cid,5537) == 2 then
selfSay('Obrigado pela ajuda daquele dia',cid)
end
return true
end
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
Esta ai, tenho que ir pra escola, qualquer coisa posta ai que to de olho