data/npc/nome do npc.xml
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Nome do NPC" script="superquest.lua">
<health now="100" max="100"/>
<look type="325" head="114" body="114" legs="94" feet="94" addons="2"/>
<parameters>
<parameter key="message_greet" value="Tenho uma {mission} para você." />
</parameters>
</npc>
data/npc/scripts/superquest.xml
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
StorageQuest = 13400 -- StorageQuest é igual a Actiondid da porta.
msg1 = 'Você gostaria de nos ajudar a {restabelecer} a {ordem} na nossa cidade?' -- Perguta
msg2 = 'A {entrada} para o seu santuário interno foi {aberta} para você. Por favor, {detenha} os monstros antes que seja tarde demais!' -- Confirmação
msg3 = 'Já passei as estruções para você.' -- Player ja tem a storage = 1
if msgcontains(msg, 'mission') or msgcontains(msg, 'quest') then
if getPlayerStorageValue(cid,StorageQuest) ~= 1 then
npcHandler:say(msg1, cid)
talk_state = 1
end
elseif msgcontains(msg, 'yes') and talk_state == 1 then
if getPlayerStorageValue(cid,StorageQuest) ~= 1 then
setPlayerStorageValue(cid,StorageQuest,1)
npcHandler:say(msg2, cid)
talk_state = 0
else
npcHandler:say(msg3, cid)
talk_state = 0
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
Agora a porta é o seguinte.
No proprio TFS existe os scripts necessarios, se você não editou só incira no mapa editor a Actionid igual a StorageQuest que está no script do npc, no caso está 13400.
*Lembrando que a porta tem que ser aquelas com fechadura vermelha..gif)
*Qualquer duvida é só avisar.
Att,
Paulo
É por isso que eu gosto de ajudar (pelo menos tentar ajudar) este fórum, os caras sabe Agradecer né?
Att,
ஓ PẫulǾ ஓ
paulo.boc@hotmail.com