Será de apenas 1 outfit, o addon recebido? Ou será de todas? Se for a primeira opção, poderia informar qual o ID da outfit?
De qualquer maneira, tenta assim:
Primeira opção:
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
local cfg = {
outfit = xxx, --ID da outfit.
sto = xxx, --Storage.
}
if msgcontains(msg, 'first addon') then
if getPlayerStorageValue(cid, 845511) < 1 then
selfSay("Você tem storage "..cfg.sto.."?", cid)
talkState[talkUser] = 1
return true
else
selfSay("Você já pegou seu primeiro addon.", cid)
talkState[talkUser] = 0
return true
end
elseif msgcontains(msg, 'yes') and talkState[talkUser] == 1 then
if getPlayerStorageValue(cid, cfg.sto) >= 1 then
selfSay("Ok, aqui está.", cid)
doPlayerAddAddon(cid, cfg.outfit, 1)
setPlayerStorageValue(cid, 845511, 1)
talkState[talkUser] = 0
return true
else
selfSay("Você não tem a storage!", cid)
talkState[talkUser] = 0
return true
end
elseif msgcontains(msg, 'no') and talkState[talkUser] == 1 then
selfSay("Ok, então,")
talkState[talkUser] = 0
return true
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
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
local sto = xxx --Storage.
if msgcontains(msg, 'first addon') then
if getPlayerStorageValue(cid, 845511) < 1 then
selfSay("Você tem storage "..sto.."?", cid)
talkState[talkUser] = 1
return true
else
selfSay("Você já pegou seu primeiro addon.", cid)
talkState[talkUser] = 0
return true
end
elseif msgcontains(msg, 'yes') and talkState[talkUser] == 1 then
if getPlayerStorageValue(cid, sto) >= 1 then
selfSay("Ok, aqui está.", cid)
doPlayerAddAddons(cid, 1)
setPlayerStorageValue(cid, 845511, 1)
talkState[talkUser] = 0
return true
else
selfSay("Você não tem a storage!", cid)
talkState[talkUser] = 0
return true
end
elseif msgcontains(msg, 'no') and talkState[talkUser] == 1 then
selfSay("Ok, então,")
talkState[talkUser] = 0
return true
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())



info
Grupo: Campones
Registrado: 19/12/11
Posts: 10
Reputação: 0
Char no Tibia: Ursinho Chuby
Eae galera beleza??
Bom eu presciso de um NPC de addon que funcione assim:
O npc so te da um addon se você tiver storage x, ou seja...
Player: Hi
Npc: Olá bla bla bla
Player: first addon
Npc: Você tem storage x?
Player: yes
Npc: aqui esta...
Facil não é? não eu não sei fazer! ME dêm uma luzz :x
REP +