Ir para conteúdo

Task System & Quest Log 100%


UchihaNear

Posts Recomendados

Vejo muitos por ae precisando do sistema de task do global, e hoje eu vim aki postar um que e identico ao do global. Sou novo nessa bagaça se ficar ruim o topico flala q na prox eu tento melhorar. Entao Vamos la.

 

1°Va ate a pasta creaturescript e dentro de script crie um arquivo com nome killinginthenameof e cole isso dentro

local questCreatures =

{

["troll"] = {questStarted = 65000, questStorage = 65000, creatureStorage = 15000, killsRequired = 100, raceName = "Trolls"},

["frost troll"] = {questStarted = 65000, questStorage = 65000, creatureStorage = 15001, killsRequired = 100, raceName = "Trolls"},

["furious troll"] = {questStarted = 65000, questStorage = 65000, creatureStorage = 15002, killsRequired = 100, raceName = "Trolls"},

["island troll"] = {questStarted = 65000, questStorage = 65000, creatureStorage = 15003, killsRequired = 100, raceName = "Trolls"},

["swamp troll"] = {questStarted = 65000, questStorage = 65000, creatureStorage = 15004, killsRequired = 100, raceName = "Trolls"},

["troll champion"] = {questStarted = 65000, questStorage = 65000, creatureStorage = 15005, killsRequired = 100, raceName = "Trolls"},

["troll legionnaire"] = {questStarted = 65000, questStorage = 65000, creatureStorage = 15006, killsRequired = 100, raceName = "Trolls"},

["goblin"] = {questStarted = 65001, questStorage = 65001, creatureStorage = 15007, killsRequired = 150, raceName = "Goblins"},

["goblin assassin"] = {questStarted = 65001, questStorage = 65001, creatureStorage = 15008, killsRequired = 150, raceName = "Goblins"},

["goblin leader"] = {questStarted = 65001, questStorage = 65001, creatureStorage = 15009, killsRequired = 150, raceName = "Goblins"},

["goblin scavenger"] = {questStarted = 65001, questStorage = 65001, creatureStorage = 15010, killsRequired = 150, raceName = "Goblins"},

["rotworm"] = {questStarted = 65002, questStorage = 65002, creatureStorage = 15011, killsRequired = 300, raceName = "Rotworms"},

["carriom worm"] = {questStarted = 65002, questStorage = 65002, creatureStorage = 15012, killsRequired = 300, raceName = "Rotworms"},

["cyclops"] = {questStarted = 65003, questStorage = 65003, creatureStorage = 15013, killsRequired = 500, raceName = "Cyclops"},

["cyclops smith"] = {questStarted = 65003, questStorage = 65003, creatureStorage = 15014, killsRequired = 500, raceName = "Cyclops"},

["cyclops drone"] = {questStarted = 65003, questStorage = 65003, creatureStorage = 15015, killsRequired = 500, raceName = "Cyclops"},

["crocodile"] = {questStarted = 14007, questStorage = 14007, creatureStorage = 15016, killsRequired = 300, raceName = "Crocodiles"},

["tarantula"] = {questStarted = 14008, questStorage = 14008, creatureStorage = 15017, killsRequired = 300, raceName = "Tarantulas"},

["carniphila"] = {questStarted = 14009, questStorage = 14009, creatureStorage = 15018, killsRequired = 150, raceName = "Carniphilas"},

["stone golem"] = {questStarted = 14010, questStorage = 14010, creatureStorage = 15019, killsRequired = 200, raceName = "Stone Golems"},

["mammoth"] = {questStarted = 14011, questStorage = 14011, creatureStorage = 15020, killsRequired = 300, raceName = "Mammoths"},

["ice golem"] = {questStarted = 14012, questStorage = 14012, creatureStorage = 15021, killsRequired = 300, raceName = "Ice Golems"},

["quara predator scout"] = {questStarted = 14013, questStorage = 14013, creatureStorage = 15022, killsRequired = 300, raceName = "Quaras Scout"},

["quara constrictor scout"] = {questStarted = 14013, questStorage = 14013, creatureStorage = 15023, killsRequired = 300, raceName = "Quaras Scout"},

["quara hydromancer scout"] = {questStarted = 14013, questStorage = 14013, creatureStorage = 15024, killsRequired = 300, raceName = "Quaras Scout"},

["quara mantassin scout"] = {questStarted = 14013, questStorage = 14013, creatureStorage = 15025, killsRequired = 300, raceName = "Quaras Scout"},

["quara pincher scout"] = {questStarted = 14013, questStorage = 14013, creatureStorage = 15026, killsRequired = 300, raceName = "Quaras Scout"},

["quara predator"] = {questStarted = 14014, questStorage = 14014, creatureStorage = 15027, killsRequired = 300, raceName = "Quaras"},

["quara constrictor"] = {questStarted = 14014, questStorage = 14014, creatureStorage = 15028, killsRequired = 300, raceName = "Quaras"},

["quara hydromancer"] = {questStarted = 14014, questStorage = 14014, creatureStorage = 15029, killsRequired = 300, raceName = "Quaras"},

["quara mantassin"] = {questStarted = 14014, questStorage = 14014, creatureStorage = 15030, killsRequired = 300, raceName = "Quaras"},

["quara pincher"] = {questStarted = 14014, questStorage = 14014, creatureStorage = 15031, killsRequired = 300, raceName = "Quaras"},

["water elemental"] = {questStarted = 14015, questStorage = 14015, creatureStorage = 15032, killsRequired = 70, raceName = "Water Elementals"},

["roaring water elemental"] = {questStarted = 14015, questStorage = 14015, creatureStorage = 15033, killsRequired = 70, raceName = "Water Elementals"},

["slick water elemental"] = {questStarted = 14015, questStorage = 14015, creatureStorage = 15034, killsRequired = 70, raceName = "Water Elementals"},

["massive water elemental"] = {questStarted = 14015, questStorage = 14015, creatureStorage = 15035, killsRequired = 70, raceName = "Water Elementals"},

["earth elemental"] = {questStarted = 14016, questStorage = 14016, creatureStorage = 15036, killsRequired = 70, raceName = "Earth Elementals"},

["jagged earth elemental"] = {questStarted = 14016, questStorage = 14016, creatureStorage = 15037, killsRequired = 70, raceName = "Earth Elementals"},

["massive earth elemental"] = {questStarted = 14016, questStorage = 14016, creatureStorage = 15038, killsRequired = 70, raceName = "Earth Elementals"},

["muddy earth elemental"] = {questStarted = 14016, questStorage = 14016, creatureStorage = 15039, killsRequired = 70, raceName = "Earth Elementals"},

["energy elemental"] = {questStarted = 14017, questStorage = 14017, creatureStorage = 15040, killsRequired = 70, raceName = "Energy Elementals"},

["charged energy elemental"] = {questStarted = 14017, questStorage = 14017, creatureStorage = 15041, killsRequired = 70, raceName = "Energy Elementals"},

["massive energy elemental"] = {questStarted = 14017, questStorage = 14017, creatureStorage = 15042, killsRequired = 70, raceName = "Energy Elementals"},

["overcharged energy elemental"] = {questStarted = 14017, questStorage = 14017, creatureStorage = 15043, killsRequired = 70, raceName = "Energy Elementals"},

["fire elemental"] = {questStarted = 14018, questStorage = 14018, creatureStorage = 15044, killsRequired = 70, raceName = "Fire Elementals"},

["blazing fire elemental"] = {questStarted = 14018, questStorage = 14018, creatureStorage = 15045, killsRequired = 70, raceName = "Fire Elementals"},

["blistering fire elemental"] = {questStarted = 14018, questStorage = 14018, creatureStorage = 15046, killsRequired = 70, raceName = "Fire Elementals"},

["massive fire elemental"] = {questStarted = 14018, questStorage = 14018, creatureStorage = 15047, killsRequired = 70, raceName = "Fire Elementals"},

["mutated rat"] = {questStarted = 14019, questStorage = 14019, creatureStorage = 15048, killsRequired = 200, raceName = "Mutated Rats"},

["giant spider"] = {questStarted = 14020, questStorage = 14020, creatureStorage = 15049, killsRequired = 500, raceName = "Giant Spiders"},

["hydra"] = {questStarted = 14021, questStorage = 14021, creatureStorage = 15050, killsRequired = 2000, raceName = "Hydras"},

["sea serpent"] = {questStarted = 14001, questStorage = 14001, creatureStorage = 15051, killsRequired = 2000, raceName = "Sea Serpents"},

["behemoth"] = {questStarted = 14022, questStorage = 14022, creatureStorage = 15052, killsRequired = 2000, raceName = "Behemoths"},

["serpent spawn"] = {questStarted = 14002, questStorage = 14002, creatureStorage = 15053, killsRequired = 1500, raceName = "Serpents Spawn"},

["green djinn"] = {questStarted = 65022, questStorage = 65022, creatureStorage = 15054, killsRequired = 500, raceName = "Green Djinns"},

["efreet"] = {questStarted = 65022, questStorage = 65022, creatureStorage = 15055, killsRequired = 500, raceName = "Green Djinns"},

["blue djinn"] = {questStarted = 65023, questStorage = 65023, creatureStorage = 15056, killsRequired = 500, raceName = "Blue Djinns"},

["marid"] = {questStarted = 65023, questStorage = 65023, creatureStorage = 15057, killsRequired = 500, raceName = "Blue Djinns"},

["pirate buccaneer"] = {questStarted = 65024, questStorage = 65024, creatureStorage = 15058, killsRequired = 3000, raceName = "Pirates"},

["pirate corsair"] = {questStarted = 65024, questStorage = 65024, creatureStorage = 15059, killsRequired = 3000, raceName = "Pirates"},

["pirate cutthroat"] = {questStarted = 65024, questStorage = 65024, creatureStorage = 15060, killsRequired = 3000, raceName = "Pirates"},

["pirate ghost"] = {questStarted = 65024, questStorage = 65024, creatureStorage = 15061, killsRequired = 3000, raceName = "Pirates"},

["pirate marauder"] = {questStarted = 65024, questStorage = 65024, creatureStorage = 15062, killsRequired = 3000, raceName = "Pirates"},

["pirate skeleton"] = {questStarted = 65024, questStorage = 65024, creatureStorage = 15063, killsRequired = 3000, raceName = "Pirates"},

["pirate buccaneer"] = {questStarted = 65025, questStorage = 65025, creatureStorage = 15064, killsRequired = 3000, raceName = "Pirates"},

["pirate corsair"] = {questStarted = 65025, questStorage = 65025, creatureStorage = 15065, killsRequired = 3000, raceName = "Pirates"},

["pirate cutthroat"] = {questStarted = 65025, questStorage = 65025, creatureStorage = 15066, killsRequired = 3000, raceName = "Pirates"},

["pirate ghost"] = {questStarted = 65025, questStorage = 65025, creatureStorage = 15067, killsRequired = 3000, raceName = "Pirates"},

["pirate marauder"] = {questStarted = 65025, questStorage = 65025, creatureStorage = 15068, killsRequired = 3000, raceName = "Pirates"},

["pirate skeleton"] = {questStarted = 65025, questStorage = 65025, creatureStorage = 15069, killsRequired = 3000, raceName = "Pirates"},

["minotaur"] = {questStarted = 14004, questStorage = 14004, creatureStorage = 15070, killsRequired = 5000, raceName = "Minotaurs"},

["necromancer"] = {questStarted = 14003, questStorage = 14003, creatureStorage = 15071, killsRequired = 4000, raceName = "Magicians"},

["priestess"] = {questStarted = 14003, questStorage = 14003, creatureStorage = 15072, killsRequired = 4000, raceName = "Magicians"},

["necromancer"] = {questStarted = 14103, questStorage = 14103, creatureStorage = 15073, killsRequired = 1000, raceName = "Magicians"},

["priestess"] = {questStarted = 14103, questStorage = 14103, creatureStorage = 15074, killsRequired = 1000, raceName = "Magicians"},

["demon"] = {questStarted = 14023, questStorage = 14023, creatureStorage = 15075, killsRequired = 6666, raceName = "Demons"}

}

local msgType = MESSAGE_STATUS_CONSOLE_ORANGE

function onKill(cid, target, lastHit)

local creature = questCreatures[getCreatureName(target):lower()]

if creature then

if isPlayer(target) then return true end

if getCreatureStorage(cid, creature.questStarted) > 0 then

if getCreatureStorage(cid, creature.questStorage) < creature.killsRequired then

if getCreatureStorage(cid, creature.questStorage) < 0 then

doCreatureSetStorage(cid, creature.questStorage, 0)

end

if getCreatureStorage(cid, creature.creatureStorage) < 0 then

doCreatureSetStorage(cid, creature.creatureStorage, 0)

end

doCreatureSetStorage(cid, creature.questStorage, getCreatureStorage(cid, creature.questStorage) + 1)

doCreatureSetStorage(cid, creature.creatureStorage, getCreatureStorage(cid, creature.creatureStorage) + 1)

doPlayerSendTextMessage(cid, msgType, getCreatureStorage(cid, creature.creatureStorage) .. " " .. getCreatureName(target) .. " defeated. Total [" .. getCreatureStorage(cid, creature.questStorage) .. "/" .. creature.killsRequired .. "] " .. creature.raceName .. ".")

end

end

end

return true

end

 

 

dps vá em creaturescripts.xml e coloke isso <event type="kill" name="KillingInTheNameOf" event="script" value="killinginthenameof.lua"/>

 

2° Na mesma pasta procure longin.lua abra e cole isso dentro

registerCreatureEvent(cid, "KillingInTheNameOf")

 

 

3° Agora o npc. Procure ou crie um arquivo.xml Grizzly Adams e cole isso dentro

local THESNAPPER_POSITION = {x = 1012, y = 249, z = 7}

local DEMODRAS_POSITION = {x = 19102, y = 18803, z = 7}

local HIDE_POSITION = {x = 995, y = 248, z = 7}

local THEBLOODTUSK_POSITION = {x = 957, y = 252, z = 7}

local SHARDHEAD_POSITION = {x = 960, y = 223, z = 7}

local THUL_POSITION = {x = 1009, y = 225, z = 7}

local ESMERALDA_POSITION = {x = 995, y = 198, z = 7}

local THEOLDWIDOW_POSITION = {x = 1067, y = 250, z = 7}

local THEMANY_POSITION = {x = 1056, y = 202, z = 7}

local LEVIATHAN_POSITION = {x = 1035, y = 174, z = 7}

local STONECRACKER_POSITION = {x = 993, y = 167, z = 7}

local THENOXIUSSPAWN_POSITION = {x = 1033, y = 127, z = 7}

local MERIKHTHESLAUGHTERER_POSITION = {x = 1056, y = 185, z = 7}

local FAHIMTHEWISE_POSITION = {x = 1080, y = 184, z = 7}

local RANDOMPIRATEBOSS_POSITION = {x = 1025, y = 211, z = 7}

local THEHORNEDFOX_POSITION = {x = 1057, y = 233, z = 7}

local NECROPHARUS_POSITION = {x = 977, y = 197, z = 7}

 

 

local tasks =

{

[1] = {questStarted = 65000, questStorage = 65000, killsRequired = 100, raceName = "Trolls", rewards = {{enable = true, type = "exp", values = 40000}, {enable = true, type = "money", values = 40000}}},

 

[2] = {questStarted = 65001, questStorage = 65001, killsRequired = 150, raceName = "Goblins", rewards = {{enable = true, type = "exp", values = 70000}, {enable = true, type = "money", values = 50000}}},

 

[3] = {questStarted = 65002, questStorage = 65002, killsRequired = 300, raceName = "Rotworms", rewards = {{enable = true, type = "exp", values = 100000}, {enable = true, type = "money", values = 60000}}},

 

[4] = {questStarted = 65003, questStorage = 65003, killsRequired = 500, raceName = "Cyclops", rewards = {{enable = true, type = "exp", values = 150000}, {enable = true, type = "money", values = 80000}}},

 

[5] = {questStarted = 14007, questStorage = 14007, killsRequired = 300, raceName = "Crocodiles", rewards = {{enable = true, type = "exp", values = 100000}, {enable = true, type = "boss", values = THESNAPPER_POSITION}, {enable = true, type = "points", values = 7}}},

 

[6] = {questStarted = 14008, questStorage = 14008, killsRequired = 300, raceName = "Tarantulas", rewards = {{enable = true, type = "exp", values = 150000}, {enable = true, type = "boss", values = HIDE_POSITION}, {enable = true, type = "points", values = 2}}},

 

[7] = {questStarted = 14009, questStorage = 14009, killsRequired = 150, raceName = "Carniphilas", rewards = {{enable = true, type = "exp", values = 250000}, {enable = true, type = "money", values = 150000}}},

 

[8] = {questStarted = 14010, questStorage = 14010, killsRequired = 200, raceName = "Stone Golems", rewards = {{enable = true, type = "exp", values = 200000}, {enable = true, type = "money", values = 150000}}},

 

[9] = {questStarted = 14011, questStorage = 14011, killsRequired = 300, raceName = "Mammoths", rewards = {{enable = true, type = "exp", values = 150000}, {enable = true, type = "boss", values = THEBLOODTUSK_POSITION}, {enable = true, type = "points", values = 2}}},

 

[10] = {questStarted = 14012, questStorage = 14012, killsRequired = 300, raceName = "Ice Golems", rewards = {{enable = true, type = "exp", values = 150000}, {enable = true, type = "boss", values = SHARDHEAD_POSITION}, {enable = true, type = "points", values = 2}}},

 

[11] = {questStarted = 14013, questStorage = 14013, killsRequired = 300, raceName = "Quaras Scout", rewards = {{enable = true, type = "exp", values = 250000}, {enable = true, type = "money", values = 250000}}},

 

[12] = {questStarted = 14014, questStorage = 14014, killsRequired = 300, raceName = "Quaras", rewards = {{enable = true, type = "exp", values = 300000}, {enable = true, type = "boss", values = THUL_POSITION}, {enable = true, type = "points", values = 2}}},

 

[13] = {questStarted = 14015, questStorage = 14015, killsRequired = 70, raceName = "Water Elementals", rewards = {{enable = true, type = "exp", values = 200000}, {enable = true, type = "money", values = 200000}}},

 

[14] = {questStarted = 14016, questStorage = 14016, killsRequired = 70, raceName = "Earth Elementals", rewards = {{enable = true, type = "exp", values = 200000}, {enable = true, type = "money", values = 200000}}},

 

[15] = {questStarted = 14017, questStorage = 14017, killsRequired = 70, raceName = "Energy Elementals", rewards = {{enable = true, type = "exp", values = 200000}, {enable = true, type = "money", values = 200000}}},

 

[16] = {questStarted = 14018, questStorage = 14018, killsRequired = 70, raceName = "Fire Elementals", rewards = {{enable = true, type = "exp", values = 200000}, {enable = true, type = "money", values = 200000}}},

 

[17] = {questStarted = 14019, questStorage = 14019, killsRequired = 200, raceName = "Mutated Rats", rewards = {{enable = true, type = "exp", values = 150000}, {enable = true, type = "boss", values = ESMERALDA_POSITION}, {enable = true, type = "points", values = 2}}},

 

[18] = {questStarted = 14020, questStorage = 14020, killsRequired = 500, raceName = "Giant Spiders", rewards = {{enable = true, type = "exp", values = 250000}, {enable = true, type = "boss", values = THEOLDWIDOW_POSITION}, {enable = true, type = "points", values = 2}}},

 

[19] = {questStarted = 14021, questStorage = 14021, killsRequired = 2000, raceName = "Hydras", rewards = {{enable = true, type = "boss", values = THEMANY_POSITION}, {enable = true, type = "points", values = 4}}},

 

[20] = {questStarted = 14001, questStorage = 14001, killsRequired = 2000, raceName = "Sea Serpents", rewards = {{enable = true, type = "boss", values = LEVIATHAN_POSITION}, {enable = true, type = "points", values = 4}}},

 

[21] = {questStarted = 14022, questStorage = 14022, killsRequired = 2000, raceName = "Behemoths", rewards = {{enable = true, type = "boss", values = STONECRACKER_POSITION}, {enable = true, type = "points", values = 4}}},

 

[22] = {questStarted = 14002, questStorage = 14002, killsRequired = 1500, raceName = "Serpents Spawn", rewards = {{enable = true, type = "teleport", values = THENOXIUSSPAWN_POSITION}, {enable = true, type = "points", values = 4}}},

 

[23] = {questStarted = 65022, questStorage = 65022, killsRequired = 500, raceName = "Green Djinns", rewards = {{enable = true, type = "exp", values = 230000}, {enable = true, type = "money", values = 5000}, {enable = true, type = "boss", values = MERIKHTHESLAUGHTERER_POSITION}}},

 

[24] = {questStarted = 65023, questStorage = 65023, killsRequired = 500, raceName = "Blue Djinns", rewards = {{enable = true, type = "exp", values = 230000}, {enable = true, type = "money", values = 5000}, {enable = true, type = "boss", values = FAHIMTHEWISE_POSITION}}},

 

[25] = {questStarted = 65024, questStorage = 65024, killsRequired = 3000, raceName = "Pirates1", rewards = {{enable = true, type = "exp", values = 300000}, {enable = true, type = "money", values = 400000}, {enable = true, type = "boss", values = RANDOMPIRATEBOSS_POSITION}}},

 

[26] = {questStarted = 65025, questStorage = 65025, killsRequired = 3000, raceName = "Pirates", rewards = {{enable = true, type = "exp", values = 300000}, {enable = true, type = "money", values = 400000}}},

 

[27] = {questStarted = 14004, questStorage = 14004, killsRequired = 5000, raceName = "Minotaurs", rewards = {{enable = true, type = "boss", values = THEHORNEDFOX_POSITION}}},

 

[28] = {questStarted = 14003, questStorage = 14003, killsRequired = 4000, raceName = "Necromancer", rewards = {{enable = true, type = "boss", values = NECROPHARUS_POSITION}}},

 

[29] = {questStarted = 14103, questStorage = 14103, killsRequired = 1000, raceName = "Magicians2", rewards = {{enable = true, type = "exp", values = 400000}}},

[30] = {questStarted = 65030, questStorage = 65030, killsRequired = 2000, raceName = "Dragons", rewards = {{enable = true, type = "boss", values = DEMODRAS_POSITION}, {enable = true, type = "exp", values = 400000}}},

[31] = {questStarted = 14023, questStorage = 14023, killsRequired = 6666, raceName = "Demons", rewards = {{enable = true, type = "exp", values = 1000000}, {enable = true, type = "money", values = 1000000}}}}

 

local rankStorage = 32150

local choose = {}

 

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 getTasksStarted(cid)

local tmp = {}

for k, v in pairs(tasks) do

if getCreatureStorage(cid, v.questStarted) == 1 then

table.insert(tmp, k)

end

end

return tmp

end

 

function getTaskByName(name)

for k, v in pairs(tasks) do

if v.raceName:lower() == name:lower() then

return k

end

end

return false

end

 

function creatureSayCallback(cid, type, msg)

 

if(not npcHandler:isFocused(cid)) then

return false

end

local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_PRIVATE and 0 or cid

if isInArray({"task", "tasks"}, msg:lower()) then

selfSay("There you can see the following tasks, please tell me the number of the task that you want to do.", cid)

local text = ""

for i = 1, table.maxn(tasks) do

text = text .. (text == "" and "" or "\n") .. i .. " - " .. tasks.raceName .. (getCreatureStorage(cid, tasks.questStarted) == 1 and " [...]" or getCreatureStorage(cid, tasks.questStarted) == 2 and " [x]" or "")

end

return doShowTextDialog(cid, 5956, text)

 

elseif getTaskByName(msg) or tasks[tonumber(msg)] then

msg = (getTaskByName(msg) or tonumber(msg))

if getCreatureStorage(cid, tasks[msg].questStarted) == 1 then

selfSay("You already started this task.", cid)

talkState[talkUser] = 0

elseif getCreatureStorage(cid, tasks[msg].questStarted) == 2 then

selfSay("You already finished this task.", cid)

talkState[talkUser] = 0

can = false

elseif tasks[msg].level and getPlayerLevel(cid) < tasks[msg].level then

selfSay("You need level " .. tasks[msg].level .. " or higher to make this task.", cid)

talkState[talkUser] = 0

else

selfSay("Are you sure that do you want to start the task number " .. msg .. "? In this task you will need to defeat " .. tasks[msg].killsRequired .. " " .. tasks[msg].raceName .. ".", cid)

choose[cid] = msg

talkState[talkUser] = 1

end

elseif msgcontains(msg, "yes") and talkState[talkUser] == 1 then

doCreatureSetStorage(cid, tasks[choose[cid]].questStarted, 1)

selfSay("You have started the task number " .. choose[cid] .. ", remember... in this task you will need to defeat " .. tasks[choose[cid]].killsRequired .. " " .. tasks[choose[cid]].raceName .. ". Good luck!", cid)

talkState[talkUser] = 0

return true

 

elseif msg:lower() == "report" then

local t = getTasksStarted(cid)

local response = "You are currently making " .. (#t > 1 and "these" or "this") .. " task" .. (#t > 1 and "s" or "") .. ":\n"

if table.maxn(t) > 0 then

for _, tsk in ipairs(t) do

if getCreatureStorage(cid, tasks[tsk].questStorage) < 0 then doCreatureSetStorage(cid, tasks[tsk].questStorage, 0) end

response = response .. " Name: " .. tasks[tsk].raceName .. " Kills: " .. getCreatureStorage(cid, tasks[tsk].questStorage) .. " - " .. tasks[tsk].killsRequired .. ".\n"

end

response = response .. "Please say report and the name of the task that do you want to report, example: 'Report Trolls'."

return selfSay(response, cid)

else

return selfSay("You need to start at least one task first.", cid)

end

elseif string.sub(msg:lower(), 0, 6) == "report" then

local t = getTaskByName(string.sub(msg, 8, string.len(msg)))

if not t then

return selfSay("That task does not exists.", cid)

end

 

if getCreatureStorage(cid, tasks[t].questStarted) == 2 then

return selfSay("You already finished this task.", cid)

end

 

if getCreatureStorage(cid, tasks[t].questStarted) < 1 then

return selfSay("You don't have started this task.", cid)

end

 

if tasks[t].killsRequired > getCreatureStorage(cid, tasks[t].questStorage) then

return selfSay("Current " .. getCreatureStorage(cid, tasks[t].questStorage) .. " " .. tasks[t].raceName .. " killed, you need to kill " .. tasks[t].killsRequired .. ".", cid)

end

for i = 1, table.maxn(tasks[t].rewards) do

if(tasks[t].rewards.enable) then

if isInArray({"boss", "teleport", 1}, tasks[t].rewards.type) then

doTeleportThing(cid, tasks[t].rewards.values)

elseif isInArray({"exp", "experience", 2}, tasks[t].rewards.type) then

doPlayerAddExperience(cid, tasks[t].rewards.values)

elseif isInArray({"item", 3}, tasks[t].rewards.type) then

doPlayerAddItem(cid, v.rewards.values[1], tasks[t].rewards.values[2])

elseif isInArray({"money", 4}, tasks[t].rewards.type) then

doPlayerAddMoney(cid, tasks[t].rewards.values)

elseif isInArray({"storage", "stor", 5}, tasks[t].rewards.type) then

doCreatureSetStorage(cid, tasks[t].rewards.values[1], tasks[t].rewards.values[2])

elseif isInArray({"points", "rank", 2}, tasks[t].rewards.type) then

doCreatureSetStorage(cid, rankStorage, getCreatureStorage(cid, rankStorage) + tasks[t].rewards.values)

else

print("[Warning - Npc::KillingInTheNameOf] Wrong reward type: " .. (tasks[t].rewards.type or "nil") .. ", reward could not be loaded.")

end

end

end

local rank = getCreatureStorage(cid, rankStorage)

selfSay("Great!... you have finished the task number " .. t .. "" .. (rank > 4 and ", you are a " or "") .. "" .. (((rank > 4 and rank < 10) and ("Huntsman") or (rank > 9 and rank < 20) and ("Ranger") or (rank > 19 and rank < 30) and ("Big Game Hunter") or (rank > 29 and rank < 50) and ("Trophy Hunter") or (rank > 49) and ("Elite Hunter")) or "") .. ". Good job.", cid)

return doCreatureSetStorage(cid, tasks[t].questStarted, 2)

end

return true

end

 

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)

npcHandler:addModule(FocusModule:new())

 

 

 

5° Agora a parte mais xata que tem nessa bagaça. Em cada monstro da task adcione ou em baixo de imunnities ou em cima de loot essa linha

<script>

<event name="KillingInTheNameOf"/>

</script>

 

 

6° Agora o mais importante que quase ngm tem funfando perfeitamente. Va na pasta xml e procure um arquivo.xml com nome quests e substitua pelo arquivo que eu acabei de postar ai e pronto.

 

OBS: O sistema esta configurado com os bosses nos lugares em que eles aparecem no global e em breve vou colocar o resto das tasks e postarei em breve os monstros com a tag

<script>

<event name="KillingInTheNameOf"/>

</script>

adicionada em todos eles e tambem os outros npcs de task(Lugri, Budrik, Raymond Striker, Gabel, Malor, Daniel Steelsoul).

 

Bom como prometi os monstros e os npcs estao ai, mas sao da versao 9.81 entao cuidado na hora de add no seu server de preferencia q seja global.

 

Espero que gostem!

 

Creditos: Eu 100%

quest log.rar

monster.rar

task npcs.rar

Editado por UchihaNear
Link para o comentário
Compartilhar em outros sites

  • 2 months later...

Vlw cara, muito bom, postado a 3 dias e nenhum coment, que tenso isso, por isso xtibia não vai pra frente, por falta de incentivo aos membros que ainda tentam ajudar. Vou testar e depois edito pra falar se ta bom.

 

Concórdo cara...

Já ví tópicos com mais de 30 visualizações e nada de comentários.

Você disse tudo, eu já fiz um desabafo em um tópico meu com mais de

20 linhas de texto, kkk'

Link para o comentário
Compartilhar em outros sites

Testei aqui mais nao ta dando certo amigo... ele ta no sistema de QUEST tal tudo Bonitinho, MASSSSS ele nao ta acrescentando os bixos na contagem.

 

You Already hunted 1/2000 hydras.

 

Fica sempre No nª "1/2000" Nunca Muda

Da uma olhada ae onde add alinha e mesmo assim nao Funciona.

 

Nao vai levar meu REP

 

<script>

<event name="KillingInTheNameOf"/>

</script>

 

[i]<?xml version="1.0" encoding="UTF-8"?>
<monster name="Hydra" nameDescription="a hydra" race="blood" experience="2100" speed="260" manacost="0">
<health now="2350" max="2350"/>
<look type="121" corpse="6048"/>
<targetchange interval="5000" chance="8"/>
<strategy attack="100" defense="0"/>
<flags>
 <flag summonable="0"/>
 <flag attackable="1"/>
 <flag hostile="1"/>
 <flag illusionable="1"/>
 <flag convinceable="0"/>
 <flag pushable="0"/>
 <flag canpushitems="1"/>
 <flag canpushcreatures="1"/>
 <flag targetdistance="1"/>
 <flag staticattack="90"/>
 <flag runonhealth="300"/>
</flags>
<attacks>
 <attack name="melee" interval="2000" skill="80" attack="60"/>
 <attack name="speed" interval="1000" chance="17" range="7" radius="4" target="1" speedchange="-600" duration="15000">
  <attribute key="shootEffect" value="poison"/>
  <attribute key="areaEffect" value="greenbubble"/>
 </attack>
 <attack name="physical" interval="3000" chance="17" length="8" spread="3" min="-150" max="-250">
  <attribute key="areaEffect" value="bluebubble"/>
 </attack>
 <attack name="poison" interval="2000" chance="20" length="8" spread="3" min="-60" max="-300">
  <attribute key="areaEffect" value="poison"/>
 </attack>
</attacks>
<defenses armor="25" defense="35">
 <defense name="healing" interval="1000" chance="25" min="200" max="400">
  <attribute key="areaEffect" value="blueshimmer"/>
 </defense>
</defenses>
<elements>
 <element earthPercent="100"/>
 <element icePercent="40"/>
 <element holyPercent="25"/>
 <element physicalPercent="-15"/>
 <element energyPercent="-10"/>
</elements>
<immunities>
 <immunity lifedrain="1"/>
 <immunity paralyze="1"/>
 <immunity invisible="1"/>
</immunities>[/i]
[b]<script>
<event name="KillingInTheNameOf"/>
</script>[/b]
[i]<voices interval="5000" chance="10">
 <voice sentence="FCHHHHH"/>
 <voice sentence="HISSSS"/>
</voices>
<loot>
 <item id="2148" countmax="90" chance="24000"/><!-- gold coin -->
 <item id="2148" countmax="80" chance="24000"/><!-- gold coin -->
 <item id="2148" countmax="80" chance="24000"/><!-- gold coin -->
 <item id="2666" countmax="4" chance="37500"/><!-- meat -->
 <item id="2671" countmax="4" chance="25000"/><!-- ham -->
 <item id="7589" chance="200"/><!-- strong mana potion -->
 <item id="2177" chance="500"/><!-- life crystal -->
 <item id="2197" chance="900"/><!-- stone skin amulet -->
 <item id="2146" chance="5000"/><!-- small sapphire -->
 <item id="4850" chance="600"/><!-- hydra egg -->
 <item id="2214" chance="1050"/><!-- ring of healing -->
 <item id="2475" chance="1000"/><!-- warrior helmet -->
 <item id="2476" chance="1200"/><!-- knight armor -->
 <item id="2536" chance="200"/><!-- medusa shield -->
 <item id="2498" chance="200"/><!-- royal helmet -->
 <item id="2195" chance="120"/><!-- boots of haste -->[/i]
[i]</loot>
</monster>[/i]

Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...