Eu não sei como fazer aquelas portas com a maçaneta piscante funcionar item id:1225 se vc souber com botar na porta e fazer com que o npc dixe ele usa me ajuda meu ot é TFS 0.2 versão 8.40 vlw
faz o npc adiciona no player uma storagevalue.
e poe na porta a actionid com o mesmo storagevalue que o npc setou no player assim ele pode passar pela porta.

"Um Deus que usasse seu poder para criar seres humanos que de antemão sabia que seriam atormentados eternamente, e que os predestinasse a isso,
não poderia ser sábio, nem justo e tampouco amoroso.
Além de nos submeter a isso vim a nos julgar e condenar por nossos atos aos tormentos do inferno.
pra minha pessoa isso não é um Deus Pai amoroso e bondoso como o chaman, seu padrão seria muito mais inferior do que o de muitos homens."
Valeu me ajuda pacas brigadão.
Olá WanderGm,
O Marcryzius deu uma resposta bem básica e eu vou complementá-la ensinando você fazer isso.
MoveEvents e NPC
MoveEvents
data/movements/movements.xml
<movevent event="StepIn" actionid="10000" script="quest.lua" />
TFS 0.3.x:
<movevent event="StepIn" actionid="10000" event="script" value="quest.lua" />
data/movements/scripts/quest.lua
-- Script by Aman Kartholic --
function onStepIn(cid, item, position, fromPosition, param, words)
message ='Você encontrou o que estava procurando.'
status = getPlayerStorageValue(cid,10001)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, message)
setPlayerStorageValue(cid,10001,1)
end
Informações adicionais:
ActionID do tile que adicionará o storage para o player.
Nome do arquivo
Mensagem que aparecerá para o jogador.
Storage - Key
Storage - Value
OBS.²: Seguindo este exemplo, coloquei a ActionID 10001 (correspondente ao storage) na quest door. Não precisa ser necessariamente a porta de ID 1225, existem outros tipos de portas com essa função.
NPC
<?xml version="1.0" encoding="UTF-8"?><npc name="Quest" script="data/npc/scripts/quest.lua" walkinterval="2000" floorchange="0">
<health now="100" max="100"/>
<look type="325" head="114" body="94" legs="114" feet="0" addons="2"/>
<parameters>
<parameter key="message_greet" value="Hello! I can {help} you."/>
</parameters>
</npc>
Nome do arquivo
Fala do NPC
data/npc/scripts/Quest.lua
TFS 0.2.x
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
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, 'help') then
selfSay('Deseja iniciar a quest?', cid)
talkState[talkUser] = 2
elseif msgcontains(msg, 'ajuda') then
selfSay('Deseja iniciar a quest?', cid)
talkState[talkUser] = 1
elseif talkState[talkUser] == 1 then
if msgcontains(msg, 'outro exemplo') then
selfSay('Exemplo de mensagem.', cid)
talkState[talkUser] = 0
elseif msgcontains(msg, 'regras') then
selfSay('Regras sobre a quest.', cid)
talkState[talkUser] = 0
elseif msgcontains(msg, 'prices') then
selfSay('A quest custa 400000 golds.', cid)
talkState[talkUser] = 0
end
elseif talkState[talkUser] == 2 then
if msgcontains(msg, 'test') then
selfSay('Test.', cid)
talkState[talkUser] = 3
elseif msgcontains(msg, 'teste') then
selfSay('Teste.', cid)
talkState[talkUser] = 4
elseif msgcontains(msg, 'quest') then
selfSay('Quer pagar 400000 golds?', cid)
talkState[talkUser] = 5
end
elseif talkState[talkUser] == 3 then
if msgcontains(msg, 'yes') then
if getPlayerStorageValue(cid,5066) == -1 then
if(doPlayerRemoveMoney(cid, 1000) == TRUE) then
setPlayerStorageValue(cid,5066,1)
selfSay('Pode ir embora agora.', cid)
end
else
selfSay('Saia daqui!', cid)
end
else
selfSay('Nao posso fazer o que voce quer!', cid)
end
elseif talkState[talkUser] == 4 then
if msgcontains(msg, 'yes') then
if getPlayerStorageValue(cid,500677) == -1 then
if(doPlayerRemoveMoney(cid, 5000) == TRUE) then
setPlayerStorageValue(cid,500677,1)
selfSay('Continue seu caminho agora.', cid)
end
else
selfSay('Adeus!', cid)
end
else
selfSay('Saia daqui!', cid)
end
elseif talkState[talkUser] == 5 then
if msgcontains(msg, 'yes') then
if getPlayerStorageValue(cid,5074) == -1 then
if(doPlayerRemoveMoney(cid, 400000) == TRUE) then
setPlayerStorageValue(cid,5074,1)
selfSay('Voce pode passar na porta agora.', cid)
end
else
selfSay('Adeus.', cid)
end
else
selfSay('Saia daqui!', cid)
end
talkState[talkUser] = 0
elseif(msgcontains(msg, 'no') and isInArray({1}, talkState[talkUser]) == TRUE) then
talkState[talkUser] = 0
selfSay('Ok. Saia daqui agora mesmo.', cid)
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
TFS 0.3.x
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, 'help') then
selfSay('Deseja iniciar a quest?', cid)
talkState[talkUser] = 2
elseif msgcontains(msg, 'ajuda') then
selfSay('Deseja iniciar a quest?', cid)
talkState[talkUser] = 1
elseif talkState[talkUser] == 1 then
if msgcontains(msg, 'outro exemplo') then
selfSay('Exemplo de mensagem.', cid)
talkState[talkUser] = 0
elseif msgcontains(msg, 'regras') then
selfSay('Regras sobre a quest.', cid)
talkState[talkUser] = 0
elseif msgcontains(msg, 'prices') then
selfSay('A quest custa 400000 golds.', cid)
talkState[talkUser] = 0
end
elseif talkState[talkUser] == 2 then
if msgcontains(msg, 'test') then
selfSay('Test.', cid)
talkState[talkUser] = 3
elseif msgcontains(msg, 'teste') then
selfSay('Teste.', cid)
talkState[talkUser] = 4
elseif msgcontains(msg, 'quest') then
selfSay('Quer pagar 400000 golds?', cid)
talkState[talkUser] = 5
end
elseif talkState[talkUser] == 3 then
if msgcontains(msg, 'yes') then
if getPlayerStorageValue(cid,5066) == -1 then
if(doPlayerRemoveMoney(cid, 1000) == TRUE) then
setPlayerStorageValue(cid,5066,1)
selfSay('Pode ir embora agora.', cid)
end
else
selfSay('Saia daqui!', cid)
end
else
selfSay('Nao posso fazer o que voce quer!', cid)
end
elseif talkState[talkUser] == 4 then
if msgcontains(msg, 'yes') then
if getPlayerStorageValue(cid,500677) == -1 then
if(doPlayerRemoveMoney(cid, 5000) == TRUE) then
setPlayerStorageValue(cid,500677,1)
selfSay('Continue seu caminho agora.', cid)
end
else
selfSay('Adeus!', cid)
end
else
selfSay('Saia daqui!', cid)
end
elseif talkState[talkUser] == 5 then
if msgcontains(msg, 'yes') then
if getPlayerStorageValue(cid,5074) == -1 then
if(doPlayerRemoveMoney(cid, 400000) == TRUE) then
setPlayerStorageValue(cid,5074,1)
selfSay('Voce pode passar na porta agora.', cid)
end
else
selfSay('Adeus.', cid)
end
else
selfSay('Saia daqui!', cid)
end
talkState[talkUser] = 0
elseif(msgcontains(msg, 'no') and isInArray({1}, talkState[talkUser]) == TRUE) then
talkState[talkUser] = 0
selfSay('Ok. Saia daqui agora mesmo.', cid)
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
Informações adicionais:
Mensagens do player
Resposta do NPC
Storage - Key que o NPC adicionará
Storage - Value que o NPC adicionará
Valor, em gold, que o NPC cobrará para adicionar o storage
Dúvida? Problemas? Poste aqui que eu tentarei ajudá-lo.
Cya ~



Atenciosamente,
Aman Kartholic.
e poe na porta a actionid com o mesmo storagevalue que o npc setou no player assim ele pode passar pela porta.