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, 'iruka sensei') then
if getPlayerStorageValue(cid,5537) == 1 then
if getPlayerItemCount(cid, 8859) >= 50 then
selfSay('Vejo que você me trouxe as 50 spiders fang...', cid)
selfSay('Obrigado pela ajuda !',cid)
doPlayerAddExperience(cid,20000)
doPlayerAddItem(cid,2152, 10)
doPlayerRemoveItem(cid, 8859, 50)
setPlayerStorageValue(cid,5537,2)
else
selfSay('Você tem que me trazer 50 spiders fangs!', cid)
end
else
selfSay('Voce deve falar com o Iruka Sensei primeiro.',cid)
end
if getPlayerStorageValue(cid,5537) == 2 then
selfSay('Agora va ate a loja X e compre obsidian knife, depois mate monstro y e retire coro e leve para o test blank. Você vai precisar de pelo menos 20 coros para entregar a missao',cid)
end
return true
end
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
tenta ae..





info
Grupo: Cavaleiro
Registrado: 04/09/12
Posts: 185
Reputação: +2
Olá, esse meu npc de missão verifica a storage e dá storage quando o player termina a missão, mas ta acontecendo uma coisa... Se o player tiver o item necessario ele retira o item e da a exp e a recompensa, mas se o player não tiver o item necessario ele da a exp e a recompensa mesmo assim. Eu gostaria que ele só desse a experiencia e a recompensa se o player tivesse os itens que o npc mando ele buscar.
Olha o NPC ae
Quem conseguir fazer dou REP+