• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Task script <<help

AizenRPG

New Member
Joined
Jan 26, 2012
Messages
4
Reaction score
0
Hi, i have problem.
I want to make a tasks npc who'll print on:
Tasks >
You can choose between : Goblins, rat, minotaurs cyclops and tarantula.
If i done this all tasks then onmsg 'tasks' he will show me next five monsters
Please guys, help me :<

I want to edite this script:
Code:
local tasks =
{
	[1] = {questStarted = 1510, questStorage = 65000, killsRequired = 70, raceName = "Trolls", rewards = {{enable = true, type = "exp", values = 3000}, {enable = true, type = "money", values = 1000}}},
 
	[2] = {questStarted = 1511, questStorage = 65001, killsRequired = 80, raceName = "Goblins", rewards = {{enable = true, type = "exp", values = 5000}, {enable = true, type = "money", values = 1250}}},

	[3] = {questStarted = 1512, questStorage = 65002, killsRequired = 120, raceName = "Rotworms", rewards = {{enable = true, type = "exp", values = 9000}, {enable = true, type = "money", values = 2000}}},
 
	[4] = {questStarted = 1513, questStorage = 65003, killsRequired = 120, raceName = "Cyclops", rewards = {{enable = true, type = "exp", values = 15000}, {enable = true, type = "money", values = 2600}}},

	[5] = {questStarted = 1514, questStorage = 65004, killsRequired = 150, raceName = "Minotaurs", rewards = {{enable = true, type = "exp", values = 30000}, {enable = true, type = "money", values = 3000}}},

	[6] = {questStarted = 1515, questStorage = 65005, killsRequired = 60, raceName = "Tarantulas", rewards = {{enable = true, type = "exp", values = 50000}, {enable = true, type = "money", values = 3200}}},

	[7] = {questStarted = 1516, questStorage = 65006, killsRequired = 100, raceName = "Orcs", rewards = {{enable = true, type = "exp", values = 100000}, {enable = true, type = "money", values = 3300}}},

	[8] = {questStarted = 1517, questStorage = 65007, killsRequired = 120, raceName = "Elfs", rewards = {{enable = true, type = "exp", values = 120000}, {enable = true, type = "money", values = 5000}}},

	[9] = {questStarted = 1518, questStorage = 65008, killsRequired = 80, raceName = "Mammoths", rewards = {{enable = true, type = "exp", values = 190000}, {enable = true, type = "money", values = 5200}}},

	[10] = {questStarted = 1519, questStorage = 65009, killsRequired = 150, raceName = "Tortoises", rewards = {{enable = true, type = "exp", values = 250000}, {enable = true, type = "money", values = 10000}}},
  
	[11] = {questStarted = 1520, questStorage = 65010, killsRequired = 105, raceName = "Lizards", rewards = {{enable = true, type = "exp", values = 350000}, {enable = true, type = "money", values = 13000}}},

	[12] = {questStarted = 1522, questStorage = 65012, killsRequired = 150, raceName = "Beholders", rewards = {{enable = true, type = "exp", values = 410000}, {enable = true, type = "money", values = 20000}}},

	[13] = {questStarted = 1521, questStorage = 65011, killsRequired = 180, raceName = "Quara Scouts", rewards = {{enable = true, type = "exp", values = 450000}, {enable = true, type = "money", values = 22000}}},

	[14] = {questStarted = 1523, questStorage = 65013, killsRequired = 200, raceName = "Pirates", rewards = {{enable = true, type = "exp", values = 490000}, {enable = true, type = "money", values = 30000}}},

	[15] = {questStarted = 1524, questStorage = 65014, killsRequired = 300, raceName = "Dragons", rewards = {{enable = true, type = "exp", values = 550000}, {enable = true, type = "money", values = 46000}}},

	[16] = {questStarted = 1525, questStorage = 65015, killsRequired = 200, raceName = "Nightmares", rewards = {{enable = true, type = "exp", values = 600000}, {enable = true, type = "money", values = 50000}}},

	[17] = {questStarted = 1526, questStorage = 65016, killsRequired = 50, raceName = "Necromancers", rewards = {{enable = true, type = "exp", values = 650000}, {enable = true, type = "money", values = 53000}}},

	[18] = {questStarted = 1527, questStorage = 65017, killsRequired = 220, raceName = "Bog Raiders", rewards = {{enable = true, type = "exp", values = 700000}, {enable = true, type = "money", values = 58000}}},

	[19] = {questStarted = 1528, questStorage = 65018, killsRequired = 150, raceName = "Giant Spiders", rewards = {{enable = true, type = "exp", values = 730000}, {enable = true, type = "money", values = 60000}}},

	[20] = {questStarted = 1529, questStorage = 65019, killsRequired = 100, raceName = "Hydras", rewards = {{enable = true, type = "exp", values = 600000}, {enable = true, type = "money", values = 50000}}},

	[21] = {questStarted = 1530, questStorage = 65020, killsRequired = 150, raceName = "Quaras", rewards = {{enable = true, type = "exp", values = 730000}, {enable = true, type = "money", values = 60000}}},

	[22] = {questStarted = 1531, questStorage = 65021, killsRequired = 145, raceName = "Behemoths", rewards = {{enable = true, type = "exp", values = 790000}, {enable = true, type = "money", values = 65000}}},

	[23] = {questStarted = 1532, questStorage = 65022, killsRequired = 100, raceName = "Serpent Spawns", rewards = {{enable = true, type = "exp", values = 840000}, {enable = true, type = "money", values = 69000}}},

	[24] = {questStarted = 1533, questStorage = 65023, killsRequired = 400, raceName = "Dragon Lords", rewards = {{enable = true, type = "exp", values = 1000000}, {enable = true, type = "money", values = 80000}}},

	[25] = {questStarted = 1534, questStorage = 65024, killsRequired = 200, raceName = "Hellspawns", rewards = {{enable = true, type = "exp", values = 1000000}, {enable = true, type = "money", values = 80000}}},

	[26] = {questStarted = 1535, questStorage = 65025, killsRequired = 400, raceName = "Frost Dragons", rewards = {{enable = true, type = "exp", values = 1300000}, {enable = true, type = "money", values = 85000}}},

	[27] = {questStarted = 1536, questStorage = 65026, killsRequired = 150, raceName = "Infernalists", rewards = {{enable = true, type = "exp", values = 1600000}, {enable = true, type = "money", values = 90000}}},

	[28] = {questStarted = 1537, questStorage = 65027, killsRequired = 200, raceName = "Medusas", rewards = {{enable = true, type = "exp", values = 180000}, {enable = true, type = "money", values = 95000}}},

	[29] = {questStarted = 1538, questStorage = 65028, killsRequired = 350, raceName = "Grim Reapers", rewards = {{enable = true, type = "exp", values = 1800000}, {enable = true, type = "money", values = 100000}}},

	[30] = {questStarted = 1539, questStorage = 65029, killsRequired = 50, raceName = "Plaguesmiths", rewards = {{enable = true, type = "exp", values = 2000000}, {enable = true, type = "money", values = 100000}}},

	[31] = {questStarted = 1540, questStorage = 65030, killsRequired = 50, raceName = "Hellhounds", rewards = {{enable = true, type = "exp", values = 2000000}, {enable = true, type = "money", values = 100000}}},

	[32] = {questStarted = 1541, questStorage = 65031, killsRequired = 360, raceName = "Demons", rewards = {{enable = true, type = "exp", values = 2500000}, {enable = true, type = "money", values = 130000}}},

	[33] = {questStarted = 1542, questStorage = 65032, killsRequired = 50, raceName = "Juggernauts", rewards = {{enable = true, type = "exp", values = 3000000}, {enable = true, type = "money", values = 150000}}},

	[34] = {questStarted = 1543, questStorage = 65033, killsRequired = 1, raceName = "Necropharuss", rewards = {{enable = true, type = "exp", values = 3000000}, {enable = true, type = "money", values = 150000}}},

	[35] = {questStarted = 1544, questStorage = 65034, killsRequired = 1, raceName = "The Horned Foxs", rewards = {{enable = true, type = "exp", values = 3000000}, {enable = true, type = "money", values = 150000}}},

	[36] = {questStarted = 1545, questStorage = 65035, killsRequired = 1, raceName = "Demodrass", rewards = {{enable = true, type = "exp", values = 200000}, {enable = true, type = "money", values = 1500000}}},

	[37] = {questStarted = 1546, questStorage = 65036, killsRequired = 1, raceName = "Orshabaals", rewards = {{enable = true, type = "exp", values = 200000}, {enable = true, type = "money", values = 1500000}}},

	[38] = {questStarted = 1547, questStorage = 65037, killsRequired = 1, raceName = "Morgaroths", rewards = {{enable = true, type = "exp", values = 200000}, {enable = true, type = "money", values = 1500000}}},

	[39] = {questStarted = 1548, questStorage = 65038, killsRequired = 1, raceName = "Ghazbarans", rewards = {{enable = true, type = "exp", values = 200000}, {enable = true, type = "money", values = 1500000}}},

	[40] = {questStarted = 1549, questStorage = 65039, killsRequired = 1, raceName = "Ferumbrass", rewards = {{enable = true, type = "exp", values = 250000}, {enable = true, type = "money", values = 3500000}}}
}
 
local rankStorage = 32150
local storage = 64521
 
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}
local voc = {}
 
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)
 
	local s = getCreatureStorage(cid, storage)
 
	if(not npcHandler:isFocused(cid)) then
		return false
	end
	local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_PRIVATE and 0 or cid
	if msgcontains(msg, "task") then
 
		if(s < 1) then
			doCreatureSetStorage(cid, storage, 1)
			s = getCreatureStorage(cid, storage)
		end
 
		if(getCreatureStorage(cid, rankStorage) < 1) then
			doCreatureSetStorage(cid, rankStorage, 0)
		end
 
		if tasks[s] then
			if(getCreatureStorage(cid, tasks[s].questStarted) < 1) then
				if(getCreatureStorage(cid, tasks[s].creatureStorage) < 6) then
					doCreatureSetStorage(cid, tasks[s].creatureStorage, 1,2,3,4,5)
				end
 
				if(getCreatureStorage(cid, tasks[s].questStorage) < 0) then
					doCreatureSetStorage(cid, tasks[s].questStorage, 0)
				end
 
				doCreatureSetStorage(cid, tasks[s].questStarted, 1)
				selfSay("You have started the task number " .. getPlayerStorageValue(cid, storage) .. ", in this task you need to kill " .. tasks[s].killsRequired .. " " .. tasks[s].raceName .. ".", cid)
			else
				selfSay("You are currently making the task about " .. tasks[s].raceName .. ", task number " .. getPlayerStorageValue(cid, storage) .. "/40.", cid)
			end
		else
			print("[Warning - Error::Killing in the name of::Tasks config] Something is wrong.")
		end
 
	elseif msgcontains(msg, "report") then
		if tasks[s] and tasks[s].questStarted > 0 then
			if(getCreatureStorage(cid, tasks[s].creatureStorage) < 0) then
				doCreatureSetStorage(cid, tasks[s].creatureStorage, 0)
			end
 
			if(getCreatureStorage(cid, tasks[s].questStorage) < 0) then
				doCreatureSetStorage(cid, tasks[s].questStorage, 0)
			end
 
			if(getCreatureStorage(cid, tasks[s].questStorage) >= tasks[s].killsRequired) then
				for i = 1, table.maxn(tasks[s].rewards) do
					if(tasks[s].rewards[i].enable) then
						if isInArray({"boss", "teleport", 1}, tasks[s].rewards[i].type) then
							doTeleportThing(cid, tasks[s].rewards[i].values)
						elseif isInArray({"exp", "experience", 2}, tasks[s].rewards[i].type) then
							doPlayerAddExperience(cid, tasks[s].rewards[i].values)
						elseif isInArray({"item", 3}, tasks[s].rewards[i].type) then
							doPlayerAddItem(cid, tasks[s].rewards[i].values[1], tasks[s].rewards[i].values[2])
						elseif isInArray({"money", 4}, tasks[s].rewards[i].type) then
							doPlayerAddMoney(cid, tasks[s].rewards[i].values)
						elseif isInArray({"storage", "stor", 5}, tasks[s].rewards[i].type) then
							doCreatureSetStorage(cid, tasks[s].rewards[i].values[1], tasks[s].rewards[i].values[2])
						elseif isInArray({"points", "rank", 2}, tasks[s].rewards[i].type) then
							doCreatureSetStorage(cid, rankStorage, getCreatureStorage(cid, rankStorage) + tasks[s].rewards[i].values)
						else
							print("[Warning - Error::Killing in the name of::Tasks config] Bad reward type: " .. tasks[s].rewards[i].type .. ", reward could not be loaded.")
						end
					end
				end

		if getPlayerStorageValue(cid, 65051) > 0 then
			selfSay('You have already all task!!', cid)
		end
				local rank = getCreatureStorage(cid, rankStorage)
				selfSay("Great!... you have finished the task number " .. s .. "" .. (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)
				doCreatureSetStorage(cid, storage, s + 1)
			else
				selfSay("Current " .. getCreatureStorage(cid, tasks[s].questStorage) .. " " .. tasks[s].raceName .. " killed, you need to kill " .. tasks[s].killsRequired .. ".", cid)
			end
		else
			selfSay("You do not have started any task.", cid)
		end
	end
	return true
end
 
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
 
But i want to make it like this:
(0 task's complete)
You can choose between Orc,etc,etc,etc,etc.
(After 5 tasks complete)
Next five monsters
(Afert 10)
Next Five
ETC.
 
Back
Top