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())
Segunda 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 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())
Sabe fazer o XML?
Não respondo PMs solicitando suporte. Já existem seções no fórum para isto.