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
item = 'You do not have the required items.'
done = 'Here you are.'
function creatureSayCallback(cid, type, msg)
if(not npcHandler:isFocused(cid)) then
return false
end
if msgcontains(msg, 'stuffed dragon') then
if getPlayerItemCount(cid,6566) >= 1 then
selfSay('Did you bring me the Stuffed Dragon?', cid)
talk_state = 1
else
selfSay('I need a {Stuffed Dragon}, to give you a Infernal Bolt. Come back when you have them.', cid)
talk_state = 0
end
elseif msgcontains(msg, 'yes') and talk_state == 1 then
talk_state = 0
if getPlayerItemCount(cid,6566) >= 1 then
if doPlayerRemoveItem(cid,6566, 10) == TRUE then
selfSay(done, cid)
doPlayerAddItem(cid, 6529, 1)
end
else
selfSay(item, cid)
end
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
Não cheguei a testar.. Mas né..
Dei um edit por causa dos ids..







info
Grupo: Campones
Registrado: 07/11/10
Posts: 10
Reputação: 0
Char no Tibia: n/a
Olá galera, gostaria que vocês me ajudassem em uma coisa simples (não para minha pessoa), eu estou fazendo um script para que o NPC troque um stuffed dragon do id 6566 por uma infernal bolt do id 6529. Mas quando eu falo stuffed dragon, que seria para trocar ele simplesmente nao fala/faz nada. Alguém pode me ajudar? Aqui está o script:
Alguém pode me dizer o que eu estou fazendo de errado por favor? ^^
REP +