onKill:
local configs = { {name = "War Gyarados", storage = 10294, valuerequest = 1000, storagerequest = 14123}, -- Mude valuerequest para a quantidade que o player deve matar {name = "War Heracross", storage = 10295, valuerequest = 1000, storagerequest = 14124},}function onKill(cid, target) for _, t in ipairs(configs) do if getPlayerStorageValue(cid, t.storage) >= 1 then if getCreatureName(target) == t.name then setPlayerStorageValue(cid, t.storagerequest, getPlayerStorageValue(cid, t.storagerequest) + 1) doPlayerSendTextMessage(cid, 20, "Faltam ".. configs.valuerequest - getPlayerStorageValue(cid, t.storagerequest) .." " .. t.name .. " para terminar a task.") return true end end end return trueend
Npc:
local configs = { {word = "War Gyarados", sto = 10294, money = 0, rewardid = 15589, rewardcount = 20, rewardexp = 10000000, storageid = 5455, storagevalue = os.time() + 1*24*60*60, storagerequest = 14123, valuerequest = 1000, text = "Congratulations! You finished this task. In 24h, you will be able to do it again."}; {word = "War Heracross", sto = 10295, money = 0, rewardid = 15589, rewardcount = 20, rewardexp = 10000000, storageid = 5455, storagevalue = os.time() + 1*24*60*60, storagerequest = 14124, valuerequest = 1000, text = "Congratulations! You finished this task. In 24h, you will be able to do it again."}; --{word = "xxx", sto = xxx,money = xxx, rewardid = xxx, rewardcount = xxx, rewardexp = xxx, storageid = xxx, storagevalue = xxx, storagerequest = xxx, valuerequest = xxx, text = "xxx"};}local keywordHandler = KeywordHandler:new()local npcHandler = NpcHandler:new(keywordHandler)NpcSystem.parseParameters(npcHandler)local talkState = {}function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) endfunction onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) endfunction onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) endfunction onThink() npcHandler:onThink() endfunction creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid for _, npc in ipairs(configs) do if(msgcontains(msg, ''..npc.word..'')) then if getPlayerStorageValue(cid, npc.sto) >= 1 then if getPlayerStorageValue(cid, npc.storageid) < os.time() then if getPlayerStorageValue(cid, npc.storagerequest) >= npc.valuerequest then doPlayerAddItem(cid, npc.rewardid, npc.rewardcount) setPlayerStorageValue(cid, npc.storagerequest, getPlayerStorageValue(cid, npc.storagerequest) - npc.valuerequest) setPlayerStorageValue(cid, npc.storageid, npc.storagevalue) doPlayerAddExperience(cid, npc.rewardexp) doSendAnimatedText(pos, npc.rewardexp, 215) selfSay(''..npc.text..'', cid) talkState[talkUser] = 0 else selfSay('You need to kill '..(npc.valuerequest - getPlayerStorageValue(cid, npc.storagerequest))..' '..npc.word..' to gain a reward.') talkState[talkUser] = 0 end else selfSay('You already did this task, player. Wait '..math.ceil((getPlayerStorageValue(cid, npc.storageid) - os.time())/(60*60))..' hours to do it again.', cid) talkState[talkUser] = 0 end end else selfSay('You are gain the '..npc.word..' task!!', cid) selfSay('You need kill just '..npc.valuerequest..' of him', cid) setPlayerStorageValue(cid, npc.sto, 1) end end return true endendnpcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)npcHandler:addModule(FocusModule:new())
Eu não testei, qual quer coisa avisa aí!








info
Grupo: Marquês
Registrado: 23/09/12
Posts: 1k
Reputação: +87
Gênero: Masculino
olá o script esta funfando perfeitamente porem tem algumas coisas q estao faltando e o autor esta muito ocupado pra me ajudar
entao alguem me ajuda ai pfv
modifacaçao que eu quero:
1º queria mudar o script pra ele perguntar pra a pessoa se quizer aceitar a task pq no momento você só falta o nome do bixo pra matar e ele fala qt estao faltando mas nao faz entregue da task, alias vc nao pega... só conta mesmo se vc nao tivese pegado
2º queria que ele tivese um COUNTER alias q quando matase o bixo, aparesça "0000 Mounstros restantes pra finalizar sua task." pq no momento vc n sabe qt falta pra finalizar
3º ele ta entregando a exp, mas nao esta aparescendo aquele txt animado da exp q vc ta pegando, alias simplemente adiciona a exp no seu char de um jeito invisivel
o script:
funçao onkill
function onKill(cid, target)
local configs = {
{name = "War Gyarados", storage = 10294},
{name = "War Heracross", storage = 10295}
}
for _, t in ipairs(configs) do
if getCreatureName(target) == t.name then
if getPlayerStorageValue(cid, t.storage) < 0 then
setPlayerStorageValue(cid, t.storage, 1)
else
setPlayerStorageValue(cid, t.storage, getPlayerStorageValue(cid, t.storage) + 1)
return true
end
end
end
return true
end
script do npc:
local configs = {
{word = "War Gyarados", itemid = 0, itemcount = 0, money = 0, rewardid = 15589, rewardcount = 20, rewardexp = 10000000, storageid = 5455, storagevalue = os.time() + 1*24*60*60, storagerequest = 10294, valuerequest = 1000, text = "Congratulations! You finished this task. In 24h, you will be able to do it again."};
{word = "War Heracross", itemid = 0, itemcount = 0, money = 0, rewardid = 15589, rewardcount = 20, rewardexp = 10000000, storageid = 5455, storagevalue = os.time() + 1*24*60*60, storagerequest = 10295, valuerequest = 1000, text = "Congratulations! You finished this task. In 24h, you will be able to do it again."};
{word = "xxx", itemid = xxx, itemcount = xxx, money = xxx, rewardid = xxx, rewardcount = xxx, rewardexp = xxx, storageid = xxx, storagevalue = xxx, storagerequest = xxx, valuerequest = xxx, text = "xxx"};
}
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
for _, npc in ipairs(configs) do
if(msgcontains(msg, ''..npc.word..'')) then
if getPlayerStorageValue(cid, npc.storageid) < os.time() then
if getPlayerStorageValue(cid, npc.storagerequest) >= npc.valuerequest then
doPlayerAddItem(cid, npc.rewardid, npc.rewardcount)
setPlayerStorageValue(cid, npc.storagerequest, getPlayerStorageValue(cid, npc.storagerequest) - npc.valuerequest)
setPlayerStorageValue(cid, npc.storageid, npc.storagevalue)
doPlayerAddExperience(cid, npc.rewardexp)
selfSay(''..npc.text..'', cid)
talkState[talkUser] = 0
else
selfSay('You need to kill '..(npc.valuerequest - getPlayerStorageValue(cid, npc.storagerequest))..' '..npc.word..' to gain a reward.')
talkState[talkUser] = 0
end
else
selfSay('You already did this task, player. Wait '..math.ceil((getPlayerStorageValue(cid, npc.storageid) - os.time())/(60*60))..' hours to do it again.', cid)
talkState[talkUser] = 0
end
end
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
tomara q alguem me ajude ;..; valeu