• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

[NPC]: Task

kirrebati

New Member
Joined
Jan 27, 2011
Messages
114
Reaction score
1
Hi,
I was wondering if someone could make a Task npc for me. I would really appreciate it.
I know there are many Task npcs out there, like Grizzly Adams etc. But that's not what I am after.

The idea is that you approach him as every other npc, say "hi" and then say "task". Then he says like "Task nr. 1: Kill 100 rotworms. Do you accept this task?"
Then when you go and kill 1 rotworm, it will show in orange text "Rotworms killed 1/100".
After you've killed 100 rotworms, and say "finish" or something, he gives you Money or an Item, and some experience. Then you say "task" to him again, and you're now on task nr 2. So after you've finished a task, there is a new one, a harder one available for you.

Thanks in advance!
Rep+ and a lot of thanks for anyone who can do this, because I'm bad at this.
 
i use that script too,but when a player talk with the npc "Mission" he dont answear but when god talk with he,its works rep+ if help
 
i did as it writed,

- - - Updated - - -

LUA:
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
 
	-- CFG
	local configA = {
		reward = true,
		experience = true,
		skill = true,
		door = true,
		missions = 6 -- Must be more than 1 and under 7 missions (6)
	}
	local rewardE = {{2160, 1}, {2160, 3}} -- item, count
	local experienceE = 680000 -- exp
	local skillE = {{4, 1}, {5, 2}} -- skillid, count
 
	local mission = {
	-- Info about what to kill for every mission. [1] = first mission and [2] second mission and so on...
		[1] = "You have to kill 25 Rotworms, 30 Cyclops.",
		[2] = "You have to kill 40 Wyrms and 40 Demons.",
		[3] = "You have to kill 15 Juggernauts and 10 orshabaals.",
		[4] = "You have to kill 1 Exutive Producer and 5 annoying Guys.",
		[5] = "You have to kill 100 Demons and 30 Assasins.",
		[6] = "You have to kill 1 Mad Chemist and 55 GnarlHounds."
	}
 
	local Cmissions = {
		-- {monsterStorage1, monsterstorage2} (Must be the same in creaturescripts)
		[1] = {101, 102}, -- Enter empty storages
		[2] = {103, 104},
		[3] = {105, 106},
		[4] = {107, 108},
		[5] = {109, 110},
		[6] = {111, 112}
	}
 
	local questStorage = 100 -- Enter empty storage (Must be the same in creaturescripts)
	local questMission = 99 -- Enter empty storage
	local doorStorage = 98 -- Enter empty storage (Must be the same in actions)
 
	-- Don't touch --
	local getStorage = getPlayerStorageValue(cid, questStorage)
	local getMission = getPlayerStorageValue(cid, questMission)
 
	local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
 
	if(msgcontains(msg, 'quest') or msgcontains(msg, 'mission')) then
		if(getStorage < 1) then
			if(getMission < 0) then
				if(configA.missions >= 0) then
					selfSay('You are on your first task. You want to continue?', cid)
					talkState[talkUser] = 1
				end
			end
		elseif(getStorage == 1) then
			selfSay("You aren't done with your task yet. Go and continue.", cid)
			talkState[talkUser] = 0
		elseif(getStorage == 2) then
				setPlayerStorageValue(cid, questStorage, 3)
				setPlayerStorageValue(cid, questMission, 1)
				selfSay("There you are! Talk to me again for more information!", cid)
 
			if(configA.missions == 1) then
			setPlayerStorageValue(cid, questStorage, 18)
				if(configA.reward == true) then
					for i = 1, #rewardE do
						doPlayerAddItem(cid, rewardE[i][1], rewardE[i][2])
					end
				end
				if(configA.experience == true) then
					doPlayerAddExperience(cid, experienceE)
				end
				if(configA.skill == true) then
					for i = 1, #skillE do
						doPlayerAddSkill(cid, skillE[i][1], skillE[i][2])
					end
				end
				if(configA.door == true) then
					setPlayerStorageValue(cid, doorStorage, 1)
				end
			end
 
		elseif(getStorage == 3) then
			if(getMission == 1) then
				if(configA.missions >= 1) then
					selfSay('You are on your second task. You want to continue?', cid)
					talkState[talkUser] = 2
				end
			end
		elseif(getStorage == 4) then
			selfSay("You aren't done with your task yet. Go and continue.", cid)
			talkState[talkUser] = 0
		elseif(getStorage == 5) then
				setPlayerStorageValue(cid, questStorage, 6)
				setPlayerStorageValue(cid, questMission, 2)
				selfSay("There you are! Talk to me again for more information!", cid)
 
			if(configA.missions == 2) then
			setPlayerStorageValue(cid, questStorage, 18)
				if(configA.reward == true) then
					for i = 1, #rewardE do
						doPlayerAddItem(cid, rewardE[i][1], rewardE[i][2])
					end
				end
				if(configA.experience == true) then
					doPlayerAddExperience(cid, experienceE)
				end
				if(configA.skill == true) then
					for i = 1, #skillE do
						doPlayerAddSkill(cid, skillE[i][1], skillE[i][2])
					end
				end
				if(configA.door == true) then
					setPlayerStorageValue(cid, doorStorage, 1)
				end
			end
 
 
		elseif(getStorage == 6) then
			if(getMission == 2) then
				if(configA.missions >= 2) then
					selfSay('You are on your third task. You want to continue?', cid)
					talkState[talkUser] = 3
				end
			end
		elseif(getStorage == 7) then
			selfSay("You aren't done with your task yet. Go and continue.", cid)
			talkState[talkUser] = 0
		elseif(getStorage == 8) then
				setPlayerStorageValue(cid, questStorage, 9)
				setPlayerStorageValue(cid, questMission, 3)
				selfSay("There you are! Talk to me again for more information!", cid)
 
			if(configA.missions == 3) then
			setPlayerStorageValue(cid, questStorage, 18)
				if(configA.reward == true) then
					for i = 1, #rewardE do
						doPlayerAddItem(cid, rewardE[i][1], rewardE[i][2])
					end
				end
				if(configA.experience == true) then
					doPlayerAddExperience(cid, experienceE)
				end
				if(configA.skill == true) then
					for i = 1, #skillE do
						doPlayerAddSkill(cid, skillE[i][1], skillE[i][2])
					end
				end
				if(configA.door == true) then
					setPlayerStorageValue(cid, doorStorage, 1)
				end
			end
 
 
		elseif(getStorage == 9) then
			if(getMission == 3) then
				if(configA.missions >= 3) then
					selfSay('You are on your fourth task. You want to continue?', cid)
					talkState[talkUser] = 4
				end
			end
		elseif(getStorage == 10) then
			selfSay("You aren't done with your task yet. Go and continue.", cid)
			talkState[talkUser] = 0
		elseif(getStorage == 11) then
				setPlayerStorageValue(cid, questStorage, 12)
				setPlayerStorageValue(cid, questMission, 4)
				selfSay("There you are! Talk to me again for more information!", cid)
 
			if(configA.missions == 4) then
			setPlayerStorageValue(cid, questStorage, 18)
				if(configA.reward == true) then
					for i = 1, #rewardE do
						doPlayerAddItem(cid, rewardE[i][1], rewardE[i][2])
					end
				end
				if(configA.experience == true) then
					doPlayerAddExperience(cid, experienceE)
				end
				if(configA.skill == true) then
					for i = 1, #skillE do
						doPlayerAddSkill(cid, skillE[i][1], skillE[i][2])
					end
				end
				if(configA.door == true) then
					setPlayerStorageValue(cid, doorStorage, 1)
				end
			end
 
 
		elseif(getStorage == 12) then
			if(getMission == 4) then
				if(configA.missions >= 4) then
					selfSay('You are on your fifth task. You want to continue?', cid)
					talkState[talkUser] = 5
				end
			end
		elseif(getStorage == 13) then
			selfSay("You aren't done with your task yet. Go and continue.", cid)
			talkState[talkUser] = 0
		elseif(getStorage == 14) then
				setPlayerStorageValue(cid, questStorage, 15)
				setPlayerStorageValue(cid, questMission, 5)
				selfSay("There you are! Talk to me again for more information!", cid)
 
			if(configA.missions == 5) then
			setPlayerStorageValue(cid, questStorage, 18)
				if(configA.reward == true) then
					for i = 1, #rewardE do
						doPlayerAddItem(cid, rewardE[i][1], rewardE[i][2])
					end
				end
				if(configA.experience == true) then
					doPlayerAddExperience(cid, experienceE)
				end
				if(configA.skill == true) then
					for i = 1, #skillE do
						doPlayerAddSkill(cid, skillE[i][1], skillE[i][2])
					end
				end
				if(configA.door == true) then
					setPlayerStorageValue(cid, doorStorage, 1)
				end
			end
 
 
		elseif(getStorage == 15) then
			if(getMission == 5) then
				if(configA.missions >= 5) then
					selfSay('You are on your sixth task. You want to continue?', cid)
					talkState[talkUser] = 6
				end
			end
		elseif(getStorage == 16) then
			selfSay("You aren't done with your task yet. Go and continue.", cid)
			talkState[talkUser] = 0
		elseif(getStorage == 17) then
				setPlayerStorageValue(cid, questStorage, 18)
				setPlayerStorageValue(cid, questMission, 6)
				selfSay("There you are! You have now done the whole mission!", cid)
 
			if(configA.missions == 6) then
			setPlayerStorageValue(cid, questStorage, 18)
				if(configA.reward == true) then
					for i = 1, #rewardE do
						doPlayerAddItem(cid, rewardE[i][1], rewardE[i][2])
					end
				end
				if(configA.experience == true) then
					doPlayerAddExperience(cid, experienceE)
				end
				if(configA.skill == true) then
					for i = 1, #skillE do
						doPlayerAddSkill(cid, skillE[i][1], skillE[i][2])
					end
				end
				if(configA.door == true) then
					setPlayerStorageValue(cid, doorStorage, 1)
				end
			end
 
		elseif(getStorage == 18) then
			selfSay("You have already done all my tasks.", cid)
			talkState[talkUser] = 0
		end
 
	elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 1) then
			selfSay("".. mission[1] .." You want to do it?", cid)
			talkState[talkUser] = 7
	elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 7) then
			for i = 1, #Cmissions[1] do
				setPlayerStorageValue(cid, Cmissions[1][i], 0)
			end
			setPlayerStorageValue(cid, questStorage, 1)
			selfSay("You can go and kill them now!", cid)
			talkState[talkUser] = 0
	elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 2) then
			selfSay("".. mission[2] .." You want to do it?", cid)
			talkState[talkUser] = 8
	elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 8) then
			for i = 1, #Cmissions[2] do
				setPlayerStorageValue(cid, Cmissions[2][i], 0)
			end
			setPlayerStorageValue(cid, questStorage, 4)
			selfSay("You can go and kill them now!", cid)
			talkState[talkUser] = 0
	elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 3) then
			selfSay("".. mission[3] .." You want to do it?", cid)
			talkState[talkUser] = 9
	elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 9) then
			for i = 1, #Cmissions[3] do
				setPlayerStorageValue(cid, Cmissions[3][i], 0)
			end
			setPlayerStorageValue(cid, questStorage, 7)
			selfSay("You can go and kill them now!", cid)
			talkState[talkUser] = 0
	elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 4) then
			selfSay("".. mission[4] .." You want to do it?", cid)
			talkState[talkUser] = 10
	elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 10) then
			for i = 1, #Cmissions[4] do
				setPlayerStorageValue(cid, Cmissions[4][i], 0)
			end
			setPlayerStorageValue(cid, questStorage, 10)
			selfSay("You can go and kill them now!", cid)
			talkState[talkUser] = 0
	elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 5) then
			selfSay("".. mission[5] .." You want to do it?", cid)
			talkState[talkUser] = 11
	elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 11) then
			for i = 1, #Cmissions[5] do
				setPlayerStorageValue(cid, Cmissions[5][i], 0)
			end
			setPlayerStorageValue(cid, questStorage, 13)
			selfSay("You can go and kill them now!", cid)
			talkState[talkUser] = 0
	elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 6) then
			selfSay("".. mission[6] .." You want to do it?", cid)
			talkState[talkUser] = 12
	elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 12) then
			for i = 1, #Cmissions[6] do
				setPlayerStorageValue(cid, Cmissions[6][i], 0)
			end
			setPlayerStorageValue(cid, questStorage, 16)
			selfSay("You can go and kill them now!", cid)
			talkState[talkUser] = 0
	end
	return true
end
 
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
my script,yes i have fixed same monsters in Creaturescripts
XML:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Richard" script="data/npc/scripts/Simple_task.lua" walkinterval="2000" floorchange="0">
    <health now="100" max="100"/>
<look type="73" head="78" body="88" legs="0" feet="88" addons="3"/>
    <parameters>
        <parameter key="message_greet" value="Hi, welcome to Forthefunz World. This will be your very first {mission} you make."/>
        <parameter key="message_farewell" value="Good bye my dear friend."/>
    </parameters>
</npc>
 
Back
Top