Aqui está, só substituir, e aonde eu marquei de vermelho é o level que poderá fazer!
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 stg = 15333 -- storage para falar com o npc
local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
if msgcontains(msg, 'mission') then
if getPlayerLevel(cid) > 100 then
selfSay("Sorry, you do not have a necessary level to make a task!", cid)
if getPlayerStorageValue(cid, stg) >= 1 then
selfSay("Sorry, you already completed this mission!!", cid)
talkState[talkUser] = 0
else
selfSay("Ooooh good! I'm looking for some rare items... They are: 50 ruby, 50 water pendant e 150 water gem. Do you have these items?", cid)
talkState[talkUser] = 1
end
end
end
---------------------------------------------------------
if (msgcontains(msg, "yes") or msgcontains(msg, "sim")) and talkState[talkUser] == 1 then
if doPlayerRemoveItem(cid, 12188, 50) and doPlayerRemoveItem(cid, 12170, 50) and doPlayerRemoveItem(cid, 12161, 150) and doPlayerRemoveItem(cid, 8261, 1) == TRUE then
selfSay("Thank you!", cid)
setPlayerStorageValue(cid, 102, 1) -- storage para liberar outfit
setPlayerStorageValue(cid, stg, 1) -- para ele nao fazer a missao novamente
doPlayerAddExperience(cid,12000) -- experiencia
local bags = getPlayerSlotItem(cid, 10)
doAddContainerItem(bags.uid, 12247, 1)
else
selfSay("Sorry, but you don't have one of these items.", cid)
talkState[talkUser] = 0
end
elseif (msgcontains(msg, "no") or msgcontains(msg, "nao")) and talkState[talkUser] == 1 then
selfSay("Good bye '..getCreatureName(cid)..'.", cid)
talkState[talkUser] = 0
end
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())





info
Grupo: Campones
Registrado: 22/08/12
Posts: 95
Reputação: +18
Char no Tibia: NoNick
Dessa vez vim pedir ajuda para colocar que o player so pode fazer a quest em determinando level ai ta o script base:
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 stg = 15333 -- storage para falar com o npc
local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
if msgcontains(msg, 'mission') then
if getPlayerStorageValue(cid, stg) >= 1 then
selfSay("Sorry, you already completed this mission!!", cid)
talkState[talkUser] = 0
else
selfSay("Ooooh good! I'm looking for some rare items... They are: 50 ruby, 50 water pendant e 150 water gem. Do you have these items?", cid)
talkState[talkUser] = 1
end
end
---------------------------------------------------------
if (msgcontains(msg, "yes") or msgcontains(msg, "sim")) and talkState[talkUser] == 1 then
if doPlayerRemoveItem(cid, 12188, 50) and doPlayerRemoveItem(cid, 12170, 50) and doPlayerRemoveItem(cid, 12161, 150) and doPlayerRemoveItem(cid, 8261, 1) == TRUE then
selfSay("Thank you!", cid)
setPlayerStorageValue(cid, 102, 1) -- storage para liberar outfit
setPlayerStorageValue(cid, stg, 1) -- para ele nao fazer a missao novamente
doPlayerAddExperience(cid,12000) -- experiencia
local bags = getPlayerSlotItem(cid, 10)
doAddContainerItem(bags.uid, 12247, 1)
else
selfSay("Sorry, but you don't have one of these items.", cid)
talkState[talkUser] = 0
end
elseif (msgcontains(msg, "no") or msgcontains(msg, "nao")) and talkState[talkUser] == 1 then
selfSay("Good bye '..getCreatureName(cid)..'.", cid)
talkState[talkUser] = 0
end
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
Se alguem poder me ajuda usando esse mesmo script obrigando e rep+ pra pessoal