Boa Vodkart, estava pensando em algo diferente ... Ai está =D
Muito Bom Mesmo =D
Por Vodkart, 14 de fev. de 2011 em Globalevents e Spells
info
Grupo: Campones
Registrado: 27/12/10
Posts: 17
Reputação: +1
Char no Tibia: ~> ADM Galaxy <~

Boa Vodkart, estava pensando em algo diferente ... Ai está =D
Muito Bom Mesmo =D
info
Grupo: Infante
Registrado: 13/10/08
Posts: 1.6k
Reputação: +420
Char no Tibia: Demonbholder

Aee velho, ficou muito bom.
legal vod, está de parabéns mto foda.
bjus gatão <3.
info
Grupo: Visconde
Registrado: 23/11/07
Posts: 309
Reputação: +6

Boa mano, ótimo sistema, gostei muito, como você disse, é uma task simples, tem previsão para sair uma mais complexa?
info
Grupo: Visconde
Registrado: 23/11/07
Posts: 309
Reputação: +6

Boa mano, ótimo sistema, gostei muito, como você disse, é uma task simples, tem previsão para sair uma mais complexa?
info
Grupo: Herói
Registrado: 20/05/10
Posts: 3.4k
Reputação: +1.5k
Gênero: Masculino

Quando eu tiver um tempinho eu vou dar uma melhorada nela,alias alguma sugestão para a task?
abraços
info
Grupo: Visconde
Registrado: 04/10/08
Posts: 488
Reputação: +304
Char no Tibia: Van Zarok

Olá, olá!
É possível adicionar um outfit como recompensa em alguma task?
Script ótimo.
REP++
info
Grupo: Herói
Registrado: 23/12/08
Posts: 2.4k
Reputação: +359
Gênero: Masculino
Char no Tibia: Gordo Warlike

qro saber se tem como vc terminar a task o player fala com npc e se tiver completo ele teleporte o player para um lugar celecionado para infrentar o boss do monstro da task!
info
Grupo: Cavaleiro
Registrado: 03/03/07
Posts: 150
Reputação: +48
Gênero: Masculino
Char no Tibia: Kaball Madness

Tem como fazer em conjunto dando Party e pra Repartir EXP ![]()
tem como ajeitar pra 1 só poder fazer?
info
Grupo: Campones
Registrado: 12/01/11
Posts: 33
Reputação: -1
Char no Tibia: Eskeci

oq temq fala com o npc pra pode começa a faser?
info
Grupo: Herói
Registrado: 23/12/08
Posts: 2.4k
Reputação: +359
Gênero: Masculino
Char no Tibia: Gordo Warlike

outra coisa testando aki, tem alguns bugs!
1° ele nao diferencia um frost dragon ou um dragoj lord de um dragon!
2° task de bheolder nao funfa! vc mata e nao soma pontos!
espero resposta desse post e do meu outro la de cima!
info
Grupo: Conde
Registrado: 16/09/07
Posts: 600
Reputação: +151
Gênero: Masculino
Char no Tibia: NãoJogoMais

Créditos Finais: Vodkart & Demonbholder
Versão testada: 8.54 ~ 8.60
Sobre: é um npc de task simples,onde você tem que matar "x" quantidade de monstro para receber uma recompensa ,seja ela items ou experiência.
Task Adicionais:
- Comando que checa quantidade de monstro que você já matou.
- Ao completar todas as task você recebe items especiais.
- Os 10 primeiros jogadores a completar a task ganham um troféu único,items + Premium days.(configuravél)
Screen:
------
Creaturescript
taskcount.lua
function onKill(cid, target) local m = { ["minotaur mage"] = 91001, ["orc spearman"] = 91002, ["cyclops"] = 91003, ["cave rat"] = 91004, ["fire devil"] = 91005, ["orc warrior"] = 91006, ["slime"] = 91007, ["beholder"] = 91008, ["dragon hatchling"] = 91009, ["wyvern"] = 91010, ["fire elemental"] = 91011, ["blue djinn"] = 91012, ["demon skeleton"] = 91013, ["dragon"] = 91014, ["dragon lord"] = 91015, ["vampire"] = 91016, ["crystal spider"] = 91017, ["earth elemental"] = 91018, ["hero"] = 91019, ["avalanche"] = 91020, ["giant spider"] = 91021, ["fury"] = 91022, ["orc warlord"] = 91023, ["green djinn"] = 91024, ["demon"] = 91025, ["hydra"] = 91026, ["frost dragon"] = 91027, ["warlock"] = 91028, ["medusa"] = 91029, ["grim reaper"] = 91030, ["undead dragon"] = 91031, ["ferumbras"] = 91032, ["orshabaal"] = 91033, ["morgaroth"] = 91034, ["ghazbaran"] = 91035, ["minishabaal"] = 91036, ["diabolic imp"] = 91037, ["juggernaut"] = 91038, ["behemoth"] = 91039 } if(isMonster(target) == TRUE) then local n = getCreatureName(target) local name_monster = m[string.lower(n)] if(name_monster) then local contagem = getPlayerStorageValue(cid, name_monster) if(contagem == -1) then contagem = 1 end setPlayerStorageValue(cid, name_monster, contagem+1) end end return TRUE end
creaturescript/script/login.lua
registerCreatureEvent(cid, "task_count")
creaturescript.xml
<event type="kill" name="task_count" script="taskcount.lua"/>
Talkactions
Talkactions/script
task_complete.lua
function onSay(cid, words, param) function pairsByKeys (t, f) local a = {} for n in pairs(t) do table.insert(a, n) end table.sort(a, f) local i = 0 local iter = function () i = i + 1 if a[i] == nil then return nil else return a[i], t[a[i]] end end return iter end local m = { ["minotaur mage"] = {storage = 91001,count = 12}, ["orc spearman"] = {storage = 91002,count = 14}, ["cyclops"] = {storage = 91003,count = 25}, ["cave rat"] = {storage = 91004,count = 10}, ["fire devil"] = {storage = 91005,count = 17}, ["orc warrior"] = {storage = 91006,count = 28}, ["slime"] = {storage = 91007,count = 18}, ["beholder"] = {storage = 91008,count = 40}, ["dragon hatchling"] = {storage = 91009,count = 45}, ["wyvern"] = {storage = 91010,count = 55}, ["fire elemental"] = {storage = 91011,count = 60}, ["blue djinn"] = {storage = 91012,count = 64}, ["demon skeleton"] = {storage = 91013,count = 45}, ["dragon"] = {storage = 91014,count = 80}, ["dragon lord"] = {storage = 91015,count = 90}, ["vampire"] = {storage = 91016,count = 50}, ["crystal spider"] = {storage = 91017,count = 45}, ["earth elemental"] = {storage = 91018,count = 80}, ["hero"] = {storage = 91019,count = 72}, ["avalanche"] = {storage = 91020,count = 83}, ["giant spider"] = {storage = 91021,count = 97}, ["fury"] = {storage = 91022,count = 105}, ["orc warlord"] = {storage = 91023,count = 74}, ["green djinn"] = {storage = 91024,count = 65}, ["demon"] = {storage = 91025,count = 400}, ["hydra"] = {storage = 91026,count = 295}, ["frost dragon"] = {storage = 91027,count = 330}, ["warlock"] = {storage = 91028,count = 210}, ["medusa"] = {storage = 91029,count = 152}, ["grim reaper"] = {storage = 91030,count = 350}, ["undead dragon"] = {storage = 91031,count = 200}, ["ferumbras"] = {storage = 91032,count = 7}, ["orshabaal"] = {storage = 91033,count = 20}, ["morgaroth"] = {storage = 91034,count = 10}, ["ghazbaran"] = {storage = 91035,count = 20}, ["minishabaal"] = {storage = 91036,count = 243}, ["diabolic imp"] = {storage = 91037,count = 163}, ["juggernaut"] = {storage = 91038,count = 45}, ["behemoth"] = {storage = 91039,count = 147} } local str = "" str = str .. "Task Completed :\n\n" for k, v in pairsByKeys(m) do local contagem = getPlayerStorageValue(cid, v.storage) if(contagem == -1) then contagem = 1 end str = str..k.." = ["..((contagem)-1).."/"..v.count.."]\n" end str = str .. "" return doShowTextDialog(cid, 8983, str) end
talkactions.xml
<talkaction words="!task" script="task_complete.lua"/>
NPC
NPC/SCRIPT
simple_task.lua
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 MonsterCount(cid, message, keywords, parameters, node) if(not npcHandler:isFocused(cid)) then return false end local contagem = getPlayerStorageValue(cid, parameters.storage) if(contagem == -1) then contagem = 1 end if getPlayerStorageValue(cid, parameters.x) <= 0 then if (((contagem)-1) >= parameters.count) then doPlayerAddExp(cid, parameters.exp) for k,v in pairs(parameters.reward) do doPlayerAddItem(cid, v.item, v.count or 1) end setPlayerStorageValue(cid, parameters.x, 1) npcHandler:say('Thanks for your help,receive your rewards!', cid) else npcHandler:say('Sorry,but you still only killed '..((contagem)-1)..' monsters!', cid) npcHandler:resetNpc() end else npcHandler:say('You can only receive the reward once!', cid) npcHandler:resetNpc() end return TRUE end function Completed(cid, message, keywords, parameters, node) if(not npcHandler:isFocused(cid)) then return false end if getPlayerStorageValue(cid, parameters.x) <= 0 then for i = 21001,21039 do if getPlayerStorageValue(cid,i) <= 0 then return npcHandler:say('Sorry,but you have not still finished the whole task!', cid) end end doPlayerAddExp(cid, parameters.exp) for k,v in pairs(parameters.reward) do doPlayerAddItem(cid, v.item, v.count or 1) end setPlayerStorageValue(cid, parameters.x, 1) b = getGlobalStorageValue(63004) if b == -1 then b = 1 end if b < 11 then setGlobalStorageValue(63004,b+1) npcHandler:say('you recivied items,trophy and 10 days of premium account!!', cid) doBroadcastMessage('[Task Mission Complete] '..getCreatureName(cid)..' was the '..b..'° to finish the task!.') doPlayerAddPremiumDays(cid, 10) doPlayerAddItem(cid, 2646,1) doPlayerAddItem(cid, 2343,1) doItemSetAttribute(doPlayerAddItem(cid, 7369), "name", "trophy of the 10 firsts finish all task") end npcHandler:say('Congratulations,now you have completed all the task!', cid) npcHandler:resetNpc() else npcHandler:say('You can only receive the reward once!', cid) npcHandler:resetNpc() end return TRUE end keywordHandler:addKeyword({'task'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I have a mission to {low level},{mid level} and {high level},{all mission} or {help} for know the amount of monsters you/ve killed!'}) keywordHandler:addKeyword({'all mission'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Wow! You/re a great hunter!,you really {completed} all mission?'}) keywordHandler:addKeyword({'help'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'To see how many monsters you killed just use command {!task}'}) keywordHandler:addKeyword({'low level'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Then low level you have to kill some monsters like: {minotaur mage},{orc spearman},{cyclops},{cave rat},{fire devil},{fire devil},{orc warrior},{slime},{beholder},{dragon hatchling} and {wyvern}!'}) keywordHandler:addKeyword({'mid level'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'hmm mid level,you have to kill some monsters: {fire elemental},{blue djinn},{demon skeleton},{dragon},{dragon lord},{crystal spider},{earth elemental},{hero},{avalanche},{giant spider},{fury},{orc warlord} and {green djinn}'}) keywordHandler:addKeyword({'high level'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'haha high level,to you it will not be easy because you have to kill some monsters: {demon},{hydra},{frost dragon},{warlock},{medusa},{grim reaper},{undead dragon},{ferumbras},{orshabaal},{morgaroth},{ghazbaran},{minishabaal},{diabolic imp},{juggernaut} and {behemoth}'}) local node1 = keywordHandler:addKeyword({'minotaur mage'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'You already killed 12 minotaur mage? {yes}'}) node1:addChildKeyword({'yes'}, MonsterCount, {x = 21001,storage = 91001,count = 12,reward = {{item = 2656, count = 1},{item = 7730, count = 1},{item = 2152, count = 20}},exp = 1000}) node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Ok, then.', reset = true}) local node2 = keywordHandler:addKeyword({'orc spearman'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'You already killed 14 orc spearman? {yes}'}) node2:addChildKeyword({'yes'}, MonsterCount, {x = 21002, storage = 91002,count = 14,reward = {{item = 2152, count = 50}},exp = 2000}) node2:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Ok, then.', reset = true}) local node3 = keywordHandler:addKeyword({'cyclops'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'You already killed 25 cyclops? {yes}'}) node3:addChildKeyword({'yes'}, MonsterCount, {x = 21003, storage = 91003,count = 25,reward = {{item = 2462, count = 1},{item = 2648, count = 1},{item = 2152, count = 35}},exp = 4000}) node3:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Ok, then.', reset = true}) local node4 = keywordHandler:addKeyword({'cave rat'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'You already killed 10 cave rat? {yes}'}) node4:addChildKeyword({'yes'}, MonsterCount, {x = 21004, storage = 91004,count = 10,reward = {{item = 2696, count = 1},{item = 2152, count = 20}},exp = 0}) node4:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Ok, then.', reset = true}) local node5 = keywordHandler:addKeyword({'fire devil'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'You already killed 17 fire devil? {yes}'}) node5:addChildKeyword({'yes'}, MonsterCount, {x = 21005, storage = 91005,count = 17,reward = {{item = 2160, count = 2},{item = 2491, count = 1},{item = 2488, count = 1}},exp = 10000}) node5:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Ok, then.', reset = true}) local node6 = keywordHandler:addKeyword({'orc warrior'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'You already killed 28 orc warrior? {yes}'}) node6:addChildKeyword({'yes'}, MonsterCount, {x = 21006, storage = 91006,count = 28,reward = {{item = 2152, count = 25}},exp = 0}) node6:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Ok, then.', reset = true}) local node7 = keywordHandler:addKeyword({'slime'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'You already killed 18 slime? {yes}'}) node7:addChildKeyword({'yes'}, MonsterCount, {x = 21007, storage = 91007,count = 18,reward = {{item = 2160, count = 1},{item = 2477, count = 1}},exp = 15000}) node7:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Ok, then.', reset = true}) local node8 = keywordHandler:addKeyword({'beholder'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'You already killed 40 beholder? {yes}'}) node8:addChildKeyword({'yes'}, MonsterCount, {x = 21008, storage = 91008,count = 40,reward = {{item = 2160, count = 2},{item = 2518, count = 1}},exp = 0}) node8:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Ok, then.', reset = true}) local node9 = keywordHandler:addKeyword({'dragon hatchling'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'You already killed 45 dragon hatchling? {yes}'}) node9:addChildKeyword({'yes'}, MonsterCount, {x = 21009, storage = 91009,count = 45,reward = {{item = 2475, count = 1},{item = 2187, count = 1}},exp = 20000}) node9:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Ok, then.', reset = true}) local node10 = keywordHandler:addKeyword({'wyvern'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'You already killed 55 wyvern? {yes}'}) node10:addChildKeyword({'yes'}, MonsterCount, {x = 21010, storage = 91010,count = 55,reward = {{item = 2519, count = 1},{item = 2160, count = 2}},exp = 0}) node10:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Ok, then.', reset = true}) local node11 = keywordHandler:addKeyword({'fire elemental'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'You already killed 60 fire elemental? {yes}'}) node11:addChildKeyword({'yes'}, MonsterCount, {x = 21011,storage = 91011,count = 60,reward = {{item = 2392, count = 1},{item = 2160, count = 5}},exp = 0}) node11:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Ok, then.', reset = true}) local node12 = keywordHandler:addKeyword({'blue djinn'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'You already killed 64 blue djinn {yes}'}) node12:addChildKeyword({'yes'}, MonsterCount, {x = 21022, storage = 91012,count = 64,reward = {{item = 2160, count = 10},{item = 2451, count = 1}},exp = 0}) node12:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Ok, then.', reset = true}) local node13 = keywordHandler:addKeyword({'demon skeleton'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'You already killed 45 demon skeleton? {yes}'}) node13:addChildKeyword({'yes'}, MonsterCount, {x = 21013, storage = 91013,count = 45,reward = {{item = 2498, count = 1},{item = 2152, count = 30}},exp = 0}) node13:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Ok, then.', reset = true}) local node14 = keywordHandler:addKeyword({'dragon'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'You already killed 80 dragon? {yes}'}) node14:addChildKeyword({'yes'}, MonsterCount, {x = 21014, storage = 91014,count = 80,reward = {{item = 2516, count = 1},{item = 7457, count = 1},{item = 2160, count = 4}},exp = 0}) node14:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Ok, then.', reset = true}) local node15 = keywordHandler:addKeyword({'dragon lord'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'You already killed 90 dragon lord? {yes}'}) node15:addChildKeyword({'yes'}, MonsterCount, {x = 21015, storage = 91015,count = 95,reward = {{item = 7402, count = 1},{item = 2537, count = 1}},exp = 101321}) node15:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Ok, then.', reset = true}) local node16 = keywordHandler:addKeyword({'vampire'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'You already killed 50 vampire? {yes}'}) node16:addChildKeyword({'yes'}, MonsterCount, {x = 21016, storage = 91016,count = 50,reward = {{item = 2534, count = 1},{item = 2197, count = 1}},exp = 60000}) node16:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Ok, then.', reset = true}) local node17 = keywordHandler:addKeyword({'crystal spider'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'You already killed 45 crystal spider? {yes}'}) node17:addChildKeyword({'yes'}, MonsterCount, {x = 21017, storage = 91017,count = 45,reward = {{item = 2160, count = 25},{item = 8920, count = 1}},exp = 0}) node17:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Ok, then.', reset = true}) local node18 = keywordHandler:addKeyword({'earth elemental'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'You already killed 80 earth elemental? {yes}'}) node18:addChildKeyword({'yes'}, MonsterCount, {x = 21018, storage = 91018,count = 80,reward = {{item = 2160, count = 10},{item = 11114, count = 1}},exp = 80000}) node18:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Ok, then.', reset = true}) local node19 = keywordHandler:addKeyword({'hero'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'You already killed 72 hero? {yes}'}) node19:addChildKeyword({'yes'}, MonsterCount, {x = 21019, storage = 91019,count = 72,reward = {{item = 2487, count = 1},{item = 2491, count = 1}},exp = 0}) node19:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Ok, then.', reset = true}) local node20 = keywordHandler:addKeyword({'avalanche'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'You already killed 83 avalanche? {yes}'}) node20:addChildKeyword({'yes'}, MonsterCount, {x = 21020, storage = 91020,count = 83,reward = {{item = 8851, count = 1}},exp = 0}) node20:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Ok, then.', reset = true}) local node21 = keywordHandler:addKeyword({'giant spider'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'You already killed 97 giant spider? {yes}'}) node21:addChildKeyword({'yes'}, MonsterCount, {x = 21021, storage = 91021,count = 97,reward = {{item = 2536, count = 1},{item = 2160, count = 13}},exp = 150000}) node21:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Ok, then.', reset = true}) local node22 = keywordHandler:addKeyword({'fury'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'You already killed 105 fury? {yes}'}) node22:addChildKeyword({'yes'}, MonsterCount, {x = 21022, storage = 91022,count = 105,reward = {{item = 6500, count = 35},{item = 2414, count = 1}},exp = 0}) node22:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Ok, then.', reset = true}) local node23 = keywordHandler:addKeyword({'orc warlor'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'You already killed 74 orc warlord? {yes}'}) node23:addChildKeyword({'yes'}, MonsterCount, {x = 21023, storage = 91023,count = 74,reward = {{item = 7414, count = 1}},exp = 98574}) node23:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Ok, then.', reset = true}) local node24 = keywordHandler:addKeyword({'green djinn'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'You already killed 65 green djinn? {yes}'}) node24:addChildKeyword({'yes'}, MonsterCount, {x = 21024, storage = 91024,count = 65,reward = {{item = 2517, count = 1}},exp = 123125}) node24:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Ok, then.', reset = true}) local node25 = keywordHandler:addKeyword({'demon'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'You already killed 400 demons {yes}'}) node25:addChildKeyword({'yes'}, MonsterCount, {x = 21025, storage = 91025,count = 400,reward = {{item = 2160, count = 80},{item = 2495, count = 1},{item = 2496, count = 1},{item = 2520, count = 1},{item = 2472, count = 1}},exp = 7500000}) node25:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Ok, then.', reset = true}) local node26 = keywordHandler:addKeyword({'hydra'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'You already killed 295 hydras? {yes}'}) node26:addChildKeyword({'yes'}, MonsterCount, {x = 21026, storage = 91026,count = 295,reward = {{item = 2160, count = 50},{item = 6433, count = 1},{item = 7434, count = 1},{item = 2197, count = 1},{item = 2476, count = 1}},exp = 2500000}) node26:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Ok, then.', reset = true}) local node27 = keywordHandler:addKeyword({'frost dragon'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'You already killed 80 frost dragons? {yes}'}) node27:addChildKeyword({'yes'}, MonsterCount, {x = 21027, storage = 91027,count = 330,reward = {{item = 2396, count = 1},{item = 2492, count = 1},{item = 2160, count = 100}},exp = 5246300}) node27:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Ok, then.', reset = true}) local node28 = keywordHandler:addKeyword({'warlock'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'You already killed 210 warlocks? {yes}'}) node28:addChildKeyword({'yes'}, MonsterCount, {x = 21028, storage = 91028,count = 210,reward = {{item = 8918, count = 1},{item = 2206, count = 1},{item = 2173, count = 1},{item = 2160, count = 100}},exp = 27393800}) node28:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Ok, then.', reset = true}) local node29 = keywordHandler:addKeyword({'medusa'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'You already killed 152 medusas? {yes}'}) node29:addChildKeyword({'yes'}, MonsterCount, {x = 21029, storage = 91029,count = 152,reward = {{item = 2542, count = 1},{item = 7403, count = 1},{item = 2536, count = 1},{item = 2160, count = 65}},exp = 1639300}) node29:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Ok, then.', reset = true}) local node30 = keywordHandler:addKeyword({'grim reaper'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'You already killed 350 grim reapers? {yes}'}) node30:addChildKeyword({'yes'}, MonsterCount, {x = 21030, storage = 91030,count = 350,reward = {{item = 2160, count = 70},{item = 2474, count = 1},{item = 8927, count = 1},{item = 6433, count = 1}},exp = 38124230}) node30:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Ok, then.', reset = true}) local node31 = keywordHandler:addKeyword({'undead dragon'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'You already killed 200 undead dragons? {yes}'}) node31:addChildKeyword({'yes'}, MonsterCount, {x = 21031, storage = 91031,count = 200,reward = {{item = 2160, count = 80},{item = 2514, count = 1},{item = 2466, count = 1}},exp = 2219180}) node31:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Ok, then.', reset = true}) local node32 = keywordHandler:addKeyword({'ferumbras'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'You already killed 7 ferumbras? {yes}'}) node32:addChildKeyword({'yes'}, MonsterCount, {x = 21032, storage = 91032,count = 7,reward = {{item = 2472, count = 1},{item = 8925, count = 1},{item = 8904, count = 1},{item = 5903, count = 1},{item = 2160, count = 100}},exp = 5246300}) node32:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Ok, then.', reset = true}) local node33 = keywordHandler:addKeyword({'orshabaal'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'You already killed 20 orshabaal? {yes}'}) node33:addChildKeyword({'yes'}, MonsterCount, {x = 21033, storage = 91033,count = 20,reward = {{item = 2469, count = 1},{item = 2472, count = 1},{item = 2393, count = 1},{item = 2160, count = 100}},exp = 7915800}) node33:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Ok, then.', reset = true}) local node34 = keywordHandler:addKeyword({'morgaroth'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'You already killed 10 morgaroth? {yes}'}) node34:addChildKeyword({'yes'}, MonsterCount, {x = 21034, storage = 91034,count = 10,reward = {{item = 2523, count = 1},{item = 2415, count = 1},{item = 2160, count = 100}},exp = 15694800}) node34:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Ok, then.', reset = true}) local node35 = keywordHandler:addKeyword({'ghazbaran'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'You already killed 20 ghazbaran? {yes}'}) node35:addChildKeyword({'yes'}, MonsterCount, {x = 21035, storage = 91035,count = 20,reward = {{item = 2494, count = 1},{item = 2408, count = 1},{item = 2390, count = 1},{item = 2160, count = 100}},exp = 15694800}) node35:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Ok, then.', reset = true}) local node36 = keywordHandler:addKeyword({'minishabaal'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'You already killed 243 minishabaal? {yes}'}) node36:addChildKeyword({'yes'}, MonsterCount, {x = 21036, storage = 91036,count = 243,reward = {{item = 2470, count = 1},{item = 2466, count = 1},{item = 7753, count = 1},{item = 2160, count = 70}},exp = 1118190}) node36:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Ok, then.', reset = true}) local node37 = keywordHandler:addKeyword({'diabolic imp'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'You already killed 163 diabolic imp? {yes}'}) node37:addChildKeyword({'yes'}, MonsterCount, {x = 21037, storage = 91037,count = 163,reward = {{item = 9776, count = 1},{item = 7418, count = 1},{item = 2421, count = 1},{item = 2160, count = 68}},exp = 2125150}) node37:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Ok, then.', reset = true}) local node38 = keywordHandler:addKeyword({'juggernaut'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'You already killed 45 juggernaut? {yes}'}) node38:addChildKeyword({'yes'}, MonsterCount, {x = 21038, storage = 91038,count = 45,reward = {{item = 2506, count = 1},{item = 2522, count = 1},{item = 2160, count = 90}},exp = 24858000}) node38:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Ok, then.', reset = true}) local node39 = keywordHandler:addKeyword({'behemoth'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'You already killed 147 behemoth? {yes}'}) node39:addChildKeyword({'yes'}, MonsterCount, {x = 21039, storage = 91039,count = 147,reward = {{item = 6391, count = 1},{item = 5741, count = 1},{item = 2160, count = 65}},exp = 3138470}) node39:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Ok, then.', reset = true}) local node40 = keywordHandler:addKeyword({'completed'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I have to give you special items! You already killed all monster? {yes}'}) node40:addChildKeyword({'yes'}, Completed, {x = 21040,reward = {{item = 2471, count = 1},{item = 2469, count = 1},{item = 9932, count = 1},{item = 2160, count = 100}},exp = 54042300}) node40:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Ok, then.', reset = true}) npcHandler:addModule(FocusModule:new())
NPC/
Ludger.xml
<?xml version="1.0"?> <npc name="Ludger" script="data/npc/scripts/simple_task.lua" walkinterval="50000" floorchange="0"> <health now="100" max="100"/> <look type="129" head="95" body="116" legs="121" feet="115" addons="3"/> <parameters> <parameter key="message_greet" value="Hello |PLAYERNAME|.I have some {task} for you!" /> </parameters> </npc>
Caso queiram fazer Download dos script:
Vixe, oque eu vou dizer pra vc?
Perfeito o Script, sem choros / sem lágrimas
REP+
valeu ae!
info
Grupo: Campones
Registrado: 29/05/09
Posts: 19
Reputação: +3
Char no Tibia: Kngiht Bem

1.0Depois que o players faz a task ele pode fazer novamente a mesma task ?
1.1Ex: faço a dos demon, terminei ganhei meus premios, posso fazer ela novamente ?.
2.0 Como faço para ajustar o numero de monstros e experiencia que ganha por fazer cada task ?
info
Grupo: Herói
Registrado: 20/05/10
Posts: 3.4k
Reputação: +1.5k
Gênero: Masculino

1.0Depois que o players faz a task ele pode fazer novamente a mesma task ?
Não
1.1Ex: faço a dos demon, terminei ganhei meus premios, posso fazer ela novamente ?.
Não
2.0 Como faço para ajustar o numero de monstros e experiencia que ganha por fazer cada task ?
count -- quantidade de monstro que tem que matar
info
Grupo: Herói
Registrado: 20/05/10
Posts: 3.4k
Reputação: +1.5k
Gênero: Masculino
Mods:
Simple Task.xml
<?xml version="1.0" encoding="UTF-8"?> <mod name="Simple Task" version="3.0" author="Vodkart" contact="xtibia.com" enabled="yes"> <config name="task_func"><![CDATA[ tasktabble = { ["troll"] = {monster_race={"troll","frost troll","furious troll","island troll","swamp troll","troll champion","troll legionnaire"}, storage_start = 200201, storage = 91001,count = 150,exp = 200,money = 250}, ["globin"] = {monster_race={"goblin","goblin assassin","goblin leader"}, storage_start = 200202, storage = 91002,count = 150,exp = 300,money = 300}, ["rotworm"] = {monster_race={"rotworm","carrion worm"}, storage_start = 200203, storage = 91003,count = 300,exp = 1000,money = 800}, ["cyclops"] = {monster_race={"cyclops","cyclops smith","cyclops drone"}, storage_start = 200204, storage = 91004,count = 500,exp = 3000,money = 800}, ["green djinn"] = {monster_race={"green djinn","efreet"}, storage_start = 200205, storage = 91005,count = 500,exp = 10000,money = 5000}, ["blue djinn"] = {monster_race={"blue djinn","marid"}, storage_start = 200206, storage = 91006,count = 500,exp = 10000,money = 5000}, ["pirate one"] = {monster_race={"pirate buccaneer","pirate corsair","pirate cutthroat","pirate ghost","pirate marauder","pirate skeleton"}, storage_start = 200207, storage = 91007,count = 300,exp = 10000,money = 5000}, ["pirate two"] = {monster_race={"pirate buccaneer","pirate corsair","pirate cutthroat","pirate ghost","pirate marauder","pirate skeleton"}, storage_start = 200208, storage = 91008,count = 300,exp = 10000,money = 5000}, ["minotaur"] = {monster_race={"minotaur","minotaur archer","minotaur mage","minotaur guard"}, storage_start = 200209, storage = 91009,count = 20}, ["necromancer"] = {monster_race={"necromancer","priestess"}, storage_start = 200210, storage = 91010,count= 400}, ["carniphila"] = {monster_race={"carniphila"}, storage_start = 200211, storage = 91011,count= 150, exp = 2500}, ["stone golem"] = {monster_race={"stone golem"}, storage_start = 200212, storage = 91012,count= 220, exp = 2000}, ["ice golem"] = {monster_race={"ice golem"}, storage_start = 200213, storage = 91013,count= 300, exp = 12000}, ["dragon"] = {monster_race={"dragon","dragon lord","frost dragon"}, storage_start = 200214, storage = 91014,count= 250, exp = 50000}, ["mutated rat"] = {monster_race={"mutated rat"}, storage_start = 200215, storage = 91015,count = 210, exp = 25000, money = 10000}, ["giant spider"] = {monster_race={"giant spider"}, storage_start = 200215, storage = 91016,count = 500, exp = 50000, money = 15000}, ["hydra"] = {monster_race={"hydra"}, storage_start = 200217, storage = 91017,count = 5000, exp = 2000, money = 15000, reward = {{6433,1},{7434,1},{2197,1},{2476,1}}}, ["sea serpent"] = {monster_race={"sea serpent"}, storage_start = 200218, storage = 91018,count = 1500, exp = 70000, money = 30000}, ["behemoth"] = {monster_race={"behemoth"}, storage_start = 200219, storage = 91019,count = 1800, exp = 50000, money = 30000, reward = {{6391,1},{5741,1}}}, ["serpent spawn"] = {monster_race={"serpent spawn"}, storage_start = 200220, storage = 91020,count = 1400, exp = 70000, money = 30000}, ["demon"] = {monster_race={"demon"}, storage_start = 200221, storage = 91021,count = 6666, exp = 70000, money = 200000, reward = {{2495,1},{2496,1},{2520,1},{2472,1}}}, ["quara"] = {monster_race={"quara predator","quara constrictor","quara hydromancer","quara mantassin","quara pincher"}, storage_start = 200222, storage = 91022,count = 300, exp = 40000, money = 50000}, ["quara scout"] = {monster_race={"quara predator scout","quara constrictor scout","quara hydromancer scout","quara mantassin scout","quara pincher scout"}, storage_start = 200223, storage = 91023,count = 300, exp = 50000, money = 60000} } configbosses_task = { {race = "minotaur",Playerpos = {x = 189, y = 57, z = 7}, FromPosToPos = {{x = 186, y = 54, z = 7},{x = 193, y = 60, z = 7}},time = 5}, {race = "necromancer",Playerpos = {x = 196, y = 39, z = 7}, FromPosToPos = {{x = 195, y = 37, z = 7},{x = 198, y = 41, z = 7}}, time = 5}, {race = "dragon",Playerpos = {x = 208, y = 59, z = 7}, FromPosToPos = {{x = 206, y = 56, z = 7},{x = 209, y = 65, z = 7}}, time = 5} } function isSummon(uid) return uid ~= getCreatureMaster(uid) or false end function CheckTask(cid) for k, v in pairs(tasktabble) do if getPlayerStorageValue(cid,v.storage_start) >= 1 then return true end end return false end function finisheAllTask(cid) local config = { exp = {true,100000}, money = {true,200000}, items ={false,{{2124,2},{2173,1}}}, premium ={true,5} } local x = true for k, v in pairs(tasktabble) do if tonumber(getPlayerStorageValue(cid,v.storage)) then x = false end end if x == true then setPlayerStorageValue(cid, 521456, 0) local b = getGlobalStorageValue(63005) if b == -1 then b = 1 end if b < 11 then setGlobalStorageValue(63005,b+1) doBroadcastMessage('[Task Mission Complete] '..getCreatureName(cid)..' was the '..b..' to finish the task!.') doPlayerAddPremiumDays(cid, config.premium[1] == true and config.premium[2] or 0) doPlayerAddExp(cid, config.exp[1] == true and config.exp[2] or 0) doPlayerAddMoney(cid, config.money[1] == true and config.money[2] or 0) if config.items[1] == true then doAddItemsFromList(cid,config.items[2]) end doItemSetAttribute(doPlayerAddItem(cid, 7369), "name", "trophy "..getCreatureName(cid).." completed all the task.") end end end function HavePlayerPosition(cid, from, to) return isInRange(getPlayerPosition(cid), from, to) and true or false end function getRankStorage(cid, value, max, RankName) -- by vodka local str ="" str = "--[".. (RankName == nil and "RANK STORAGE" or ""..RankName.."") .."]--\n\n" local query = db.getResult("SELECT `player_id`, `value` FROM `player_storage` WHERE `key` = "..value.." ORDER BY cast(value as INTEGER) DESC;") if (query:getID() ~= -1) then k = 1 repeat if k > max then break end str = str .. "\n " .. k .. ". "..getPlayerNameByGUID(query:getDataString("player_id")).." - [" .. query:getDataInt("value") .. "]" k = k + 1 until not query:next() end return doShowTextDialog(cid, 2529, str) end function getItemsInContainerById(container, itemid) -- Function By Kydrai local items = {} if isContainer(container) and getContainerSize(container) > 0 then for slot=0, (getContainerSize(container)-1) do local item = getContainerItem(container, slot) if isContainer(item.uid) then local itemsbag = getItemsInContainerById(item.uid, itemid) for i=0, #itemsbag do table.insert(items, itemsbag[i]) end else if itemid == item.itemid then table.insert(items, item.uid) end end end end return items end function doPlayerAddItemStacking(cid, itemid, quant) -- by mkalo local item = getItemsInContainerById(getPlayerSlotItem(cid, 3).uid, itemid) local piles = 0 if #item > 0 then for i,x in pairs(item) do if getThing(x).type < 100 then local it = getThing(x) doTransformItem(it.uid, itemid, it.type+quant) if it.type+quant > 100 then doPlayerAddItem(cid, itemid, it.type+quant-100) end else piles = piles+1 end end else return doPlayerAddItem(cid, itemid, quant) end if piles == #item then doPlayerAddItem(cid, itemid, quant) end end function getItemsFromList(items) -- by vodka local str = '' if table.maxn(items) > 0 then for i = 1, table.maxn(items) do str = str .. items[i][2] .. ' ' .. getItemNameById(items[i][1]) if i ~= table.maxn(items) then str = str .. ', ' end end end return str end function doAddItemsFromList(cid,items) -- by vodka if table.maxn(items) > 0 then for i = 1, table.maxn(items) do local count = items[i][2] while count > 0 do if isItemStackable(items[i][1]) then doPlayerAddItemStacking(cid, items[i][1], 1) else doPlayerAddItem(cid, items[i][1],1) end count = count - 1 end end end end function pairsByKeys(t, f) local a = {} for n in pairs(t) do table.insert(a, n) end table.sort(a, f) local i = 0 local iter = function () i = i + 1 if a[i] == nil then return nil else return a[i], t[a[i]] end end return iter end ]]></config> <event type="login" name="TaskLogin" event="script"><![CDATA[ function onLogin(cid) registerCreatureEvent(cid, "KillTask") return true end]]></event> <talkaction words="/task;!task" event="buffer"><![CDATA[ domodlib('task_func') local param = string.lower(param) if param == "rank" then getRankStorage(cid, 521456, 20, "Task Rank Finalizadas") return true end local str = "" str = str .. "Task Completed :\n\n" for k, v in pairsByKeys(tasktabble) do local contagem = getPlayerStorageValue(cid, v.storage) if (contagem == -1) then contagem = 1 end str = str..k.." = ".. (not tonumber(contagem) and "["..contagem.."]" or "["..((contagem)-1).."/"..v.count.."]") .."\n" end str = str .. "" return doShowTextDialog(cid, 8983, str) ]]></talkaction> <event type="kill" name="KillTask" event="script"><![CDATA[ domodlib('task_func') function onKill(cid, target, lastHit) if isMonster(target) and not isSummon(target) then local n = string.lower(getCreatureName(target)) for race, mob in pairs(tasktabble) do if getPlayerStorageValue(cid,mob .storage_start) >= 1 then for i = 1,#mob.monster_race do if n == mob.monster_race[i] then local contagem = getPlayerStorageValue(cid, mob.storage) if not tonumber(contagem) then return true end if (contagem == -1) then contagem = 1 end if contagem > mob.count then return true end setPlayerStorageValue(cid, mob.storage, contagem+1) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE,""..(contagem == mob.count and "Congratulations! You finished the task of "..race.."." or "defeated. Total [" .. contagem .. "/" .. mob.count .. "] " .. race .. ".").."") end end end end end return true end]]></event> </mod>NPC
NPC/SCRIPT
simple_task.lua
domodlib('task_func') 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 msg = string.lower(msg) if isInArray({"task","tasks","missao","mission"}, msg) then npcHandler:say("Me diga o nome do monstro que você deseja fazer a task!", cid) talkState[talkUser] = 1 elseif talkState[talkUser] == 1 then if tasktabble[msg] then if CheckTask(cid) ~= true then local contagem = getPlayerStorageValue(cid, tasktabble[msg].storage) if (contagem == -1) then contagem = 1 end if not tonumber(contagem) then npcHandler:say('Desculpe, mas você já terminou a task do '..msg, cid) return true end setPlayerStorageValue(cid, tasktabble[msg].storage_start, 1) npcHandler:say("Parabéns, agora você está participando da missão task do "..msg..", falta matar "..string.sub(((contagem)-1)-tasktabble[msg].count, 2).." "..msg, cid) talkState[talkUser] = 0 else npcHandler:say('Desculpe, mas você já faz parte de uma task!', cid) talkState[talkUser] = 0 end else npcHandler:say('digite o nome correto da missão task! para mais informações digite {!task}', cid) talkState[talkUser] = 1 end elseif isInArray({"receber","reward","recompensa","report","reportar"}, msg) then if CheckTask(cid) then for k, v in pairs(tasktabble) do racetype = k if getPlayerStorageValue(cid,v.storage_start) >= 1 then local contagem = getPlayerStorageValue(cid, v.storage) if (contagem == -1) then contagem = 1 end if not tonumber(contagem) then npcHandler:say('você só pode receber os items uma única vez!', cid) return true end if (((contagem)-1) >= v.count) then for _, check in pairs(configbosses_task) do if string.lower(check.race) == string.lower(racetype) then local on = getPlayersOnline() for i=1, #on do if HavePlayerPosition(on[i], check.FromPosToPos[1],check.FromPosToPos[2]) then selfSay('aguarde alguns instantes, tem pessoas fazendo a task.', cid) return true end end doTeleportThing(cid, check.Playerpos) local function checkArea(cid) if not isCreature(cid) then return LUA_ERROR end if HavePlayerPosition(cid, check.FromPosToPos[1],check.FromPosToPos[2]) then doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) end end addEvent(checkArea, check.time*60*1000, cid) end end local str = "" if v.exp ~= nil then doPlayerAddExp(cid, v.exp ) str = str.."".. (str == "" and "" or ",") .." "..v.exp.." de exp" end if v.money ~= nil then doPlayerAddMoney(cid, v.money) str = str.."".. (str == "" and "" or ",") ..""..v.money.." gps" end if v.reward ~= nil then doAddItemsFromList(cid,v.reward) str = str.."".. (str == "" and "" or ",") ..""..getItemsFromList(v.reward) end npcHandler:say("Obrigado pela sua ajuda Recompensas: "..(str == "" and "nenhuma" or ""..str.."").." por ter completado a task do "..k, cid) setPlayerStorageValue(cid, v.storage, "Finished") setPlayerStorageValue(cid, v.storage_start, 0) setPlayerStorageValue(cid, 521456, getPlayerStorageValue(cid, 521456) == -1 and 1 or getPlayerStorageValue(cid, 521456)+1) finisheAllTask(cid) else npcHandler:say('Desculpe,mas você só matou '..((contagem)-1)..' de '..v.count..' '..k, cid) end end end else npcHandler:say("você não está em nenhuma missão task", cid) end elseif isInArray({"sair","leave","exit"}, msg) then if CheckTask(cid) then talkState[talkUser] = 2 for k, v in pairs(tasktabble) do if getPlayerStorageValue(cid,v.storage_start) >= 1 then storagesair = v.storage_start local contagem = getPlayerStorageValue(cid, v.storage) if (contagem == -1) then contagem = 1 end npcHandler:say('você está participando de uma missão task do '..k..' e já tem '..((contagem)-1)..' '..k..' mortos, deseja mesmo sair?', cid) end end else npcHandler:say("você não está em nenhuma missão task", cid) end elseif msgcontains(msg, 'yes') and talkState[talkUser] == 2 then setPlayerStorageValue(cid, storagesair, 0) npcHandler:say("Você foi retirado da task com sucesso!", cid) elseif msg == "no" then selfSay("Tudo bem então", cid) talkState[talkUser] = 0 npcHandler:releaseFocus(cid) end return TRUE end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())NPC
Ludger.xml
<?xml version="1.0"?> <npc name="Ludger" script="data/npc/scripts/simple_task.lua" walkinterval="50000" floorchange="0"> <health now="100" max="100"/> <look type="129" head="95" body="116" legs="121" feet="115" addons="3"/> <parameters> <parameter key="message_greet" value="Ola |PLAYERNAME|. quer fazer uma {task}? ou {sair} de uma? tambem pode {receber} premios se terminou ela!" /> </parameters> </npc>Como configurar?
-- configuração task monstros --
para configurar você vai ali no Mods
lá tem uma tabela chamada 'tasktabble' que funciona da seguinte maneira:
["nome da task"] -- aqui você coloca o nome da task
monster_race={"nome dos monstro"} -- aqui você coloca o nome dos monstro que vão contar na task
exemplo:
monster_race={"cyclops","cyclops smith","cyclops drone"}ou seja vai contar nessa task tanto se eu matar um 'cyclops' como matar tbm um 'cyclops drone'
storage_start -- n mexa, é para checar se ele está com a task
storage -- é o valor da storage para fazer a contagem. obs: não edite
count -- é o total de monstro que tem que matar
money -- é qnto de dinheiro ele vai receber ao terminar a task, se n quiser colocar pra receber money só remover essa parte
exp -- é quanto ele vai ganhar de exp ao terminar a task, se n quiser colocar pra receber exp só remover essa parte
reward -- é a lista dos items que ele vai ganhar ao terminar a task, caso não queira que ele receba items só remover essa parte
-- configuração bosses --
em mods tem uma tabela chamada 'configbosses_task'
configbosses_task = { {race = "minotaur",Playerpos = {x = 189, y = 57, z = 7}, FromPosToPos = {{x = 186, y = 54, z = 7},{x = 193, y = 60, z = 7}},time = 5}, {race = "necromancer",Playerpos = {x = 196, y = 39, z = 7}, FromPosToPos = {{x = 195, y = 37, z = 7},{x = 198, y = 41, z = 7}}, time = 5}, {race = "dragon",Playerpos = {x = 208, y = 59, z = 7}, FromPosToPos = {{x = 206, y = 56, z = 7},{x = 209, y = 65, z = 7}}, time = 5} }race -- é o nome da task que vai ter boss, só olhar dentro dos [""] que vc editou a tabela dos monstros
Playerpos -- é pra onde o jogador vai ao entrar no boss
FromPosToPos -- nessa parte são duas pos, é o começo da área e o final da área do boss
time -- é o limite de tempo em minutos que o jogador vai poder ficar na sala do boss
-- configuração recompensas top 10 jogadores terminar todas as TASKS --
ali em mods tem essa tabela:
local config = { exp = {true,100000}, -- vai ganhar exp? se true edite a exp money = {true,200000}, -- vai ganhar money? se true edite a qntidade de dinheiro items ={false,{{2124,2},{2173,1}}}, -- vai receber items? se true edite os items dentro da tabela premium ={false,5} -- vai receber premium days? se true edite os dias q vai receber }Editado Outubro 23 por Vodkart