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?
Como ja fora respondido, oque existe hoje de mappa editors, sao 'proteses de um beta'. Eu como mapper, so vou lhe aconselhar a seguir um X tutorial, ou a usar o editor para esta vercao, apartir do momento qud o RME lancar a sua vercao oficial deste update.
Reuploadei as imagens pra vc (muito bom o script, quero ajudar) via photobucket, agora da pra vc coloca o link direto pra apareçe a imagem...
Imagens abrir Spoiler:
Remere's postou um link de um BETA em seu twitter para baixar-mos.
Ele suporta 9.4, 9.5 e tambem suporta o 9.6.
A new feature in this BETA is the find and replace dialog.
Download link: remeresmapeditor.com/rmedl.php?file=RME-win-3.0-beta-8.zip
Importante: Nao tente converter um mapa antigo (version < 8.1) com essa versão.
Twitter do Remere's: (pra quem quiser seguir e ficar de olho nas novidades)
https://twitter.com/leRemere