• 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!

CreatureEvent Epic daily missions [tasks] mod

Erexo

Kage
Premium User
Joined
Mar 27, 2010
Messages
741
Solutions
5
Reaction score
193
Location
Pr0land
GitHub
Erexo
Hello,
i would like to present my new script, `Daily Missions`, written for 0.3.6pl1.

HOW IT WORKS:
Each day player can ask NPC for a mission, then he will get task for random monster (based on player lv), when he complete the task (kill enough monsters), then he can back to that NPC and finish it, recive expedience and x% chance for an item.

NPC SCRIPT:
Lua:
local daily1 = { --1-30
{["name"] = "Wolf", ["storage"] = 5, ["count"] = 20, ["exp"] = 2000, ["item"] = 2152, ["icount"] = 10, ["chance"] = 75},
{["name"] = "Snake", ["storage"] = 6, ["count"] = 20, ["exp"] = 3000, ["item"] = 2152, ["icount"] = 15, ["chance"] = 75}
}
local daily2 = { --31-70
{["name"] = "Assassin", ["storage"] = 10, ["count"] = 30, ["exp"] = 75000, ["item"] = 2152, ["icount"] = 50, ["chance"] = 67},
{["name"] = "Cursed Wolf", ["storage"] = 11, ["count"] = 30, ["exp"] = 95000, ["item"] = 2152, ["icount"] = 50, ["chance"] = 68}
}
local daily3 = { --71-100
{["name"] = "Stranger", ["storage"] = 17, ["count"] = 30, ["exp"] = 350000, ["item"] = 2160, ["icount"] = 1, ["chance"] = 75},
{["name"] = "Kyokushin",["storage"] = 18, ["count"] = 60, ["exp"] = 350000, ["item"] = 2160, ["icount"] = 1, ["chance"] = 73}
}
local daily4 = { --101-150
{["name"] = "Mutated", ["storage"] = 22, ["count"] = 30, ["exp"] = 550000, ["item"] = 2160, ["icount"] = 2, ["chance"] = 85},
{["name"] = "Samurai", ["storage"] = 23, ["count"] = 40, ["exp"] = 650000, ["item"] = 2160, ["icount"] = 2, ["chance"] = 65}
}
local daily5 = { --151-200
{["name"] = "Elite Samurai", ["storage"] = 26, ["count"] = 50, ["exp"] = 1100000, ["item"] = 2160, ["icount"] = 5, ["chance"] = 73},
{["name"] = "Nukenin", ["storage"] = 27, ["count"] = 50, ["exp"] = 1500000, ["item"] = 2160, ["icount"] = 5, ["chance"] = 77}
}
local daily6 = { --201-250
{["name"] = "Nukenin", ["storage"] = 30, ["count"] = 70, ["exp"] = 2000000, ["item"] = 2160, ["icount"] = 6, ["chance"] = 71},
{["name"] = "Akatsuki Memember", ["storage"] = 31, ["count"] = 40, ["exp"] = 3000000, ["item"] = 2160, ["icount"] = 6, ["chance"] = 73}
}
local daily7 = { --251-300
{["name"] = "Akatsuki Memember", ["storage"] = 34, ["count"] = 70, ["exp"] = 6000000, ["item"] = 2160, ["icount"] = 10, ["chance"] = 65},
{["name"] = "Samurai Master", ["storage"] = 35, ["count"] = 60, ["exp"] = 4000000, ["item"] = 2160, ["icount"] = 12, ["chance"] = 66}
}
local daily8 = { --301-350
{["name"] = "Rikudou Patch", ["storage"] = 38, ["count"] = 70, ["exp"] = 8000000, ["item"] = 2160, ["icount"] = 14, ["chance"] = 73},
{["name"] = "Black Samurai [King]", ["storage"] = 39, ["count"] = 30, ["exp"] = 7000000, ["item"] = 2160, ["icount"] = 15, ["chance"] = 77}
}
local daily11 = { --351-400
{["name"] = "Rikudou Patch", ["storage"] = 61, ["count"] = 70, ["exp"] = 8000000, ["item"] = 2160, ["icount"] = 14, ["chance"] = 73},
{["name"] = "Black Samurai [King]", ["storage"] = 62, ["count"] = 50, ["exp"] = 8500000, ["item"] = 2160, ["icount"] = 16, ["chance"] = 70}
}
local daily9 = { --401-500
{["name"] = "Black Samurai [King]", ["storage"] = 41, ["count"] = 50, ["exp"] = 9000000, ["item"] = 2160, ["icount"] = 16, ["chance"] = 71},
{["name"] = "Black Samurai [King]", ["storage"] = 42, ["count"] = 70, ["exp"] = 11000000, ["item"] = 2160, ["icount"] = 18, ["chance"] = 73}
}
local daily10 = { --500+
{["name"] = "Heaven Guardian", ["storage"] = 46, ["count"] = 50, ["exp"] = 13000000, ["item"] = 2160, ["icount"] = 25, ["chance"] = 90},
{["name"] = "Heaven Guardian", ["storage"] = 47, ["count"] = 70, ["exp"] = 15000000, ["item"] = 2160, ["icount"] = 27, ["chance"] = 76},
{["name"] = "Bug", ["storage"] = 52, ["count"] = 100, ["exp"] = 10000000, ["item"] = 1691, ["icount"] = 1, ["chance"] = 100}
}

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

--Branie Daily
	if(msgcontains(msg, 'mission') or msgcontains(msg, 'daily')) then
	if getPlayerStorageValue(cid,2423) <= 1 then
		if getPlayerLevel(cid) <= 30 then
			rand = math.random(1, #daily1)
			for i = 1, #daily1 do
				if rand == i then
					selfSay('Your mission today is to kill ' .. daily1[i].count .. ' ' .. daily1[i].name .. '\'s. Back when you end.', cid)
					setPlayerStorageValue(cid,2423,daily1[i].storage)
					talkState[talkUser] = 0
					
				end
			end
		elseif getPlayerLevel(cid) > 30 and getPlayerLevel(cid) <= 70 then
			rand = math.random(1, #daily2)
			for i = 1, #daily2 do
				if rand == i then
					selfSay('Your mission today is to kill ' .. daily2[i].count .. ' ' .. daily2[i].name .. '\'s. Back when you end.', cid)
					setPlayerStorageValue(cid,2423,daily2[i].storage)
					talkState[talkUser] = 0
					
				end
			end
		elseif getPlayerLevel(cid) > 70 and getPlayerLevel(cid) <= 100 then
			rand = math.random(1, #daily3)
			for i = 1, #daily3 do
				if rand == i then
					selfSay('Your mission today is to kill ' .. daily3[i].count .. ' ' .. daily3[i].name .. '\'s. Back when you end.', cid)
					setPlayerStorageValue(cid,2423,daily3[i].storage)
					talkState[talkUser] = 0
					
				end
			end
		elseif getPlayerLevel(cid) > 100 and getPlayerLevel(cid) <= 150 then
			rand = math.random(1, #daily4)
			for i = 1, #daily4 do
				if rand == i then
					selfSay('Your mission today is to kill ' .. daily4[i].count .. ' ' .. daily4[i].name .. '\'s. Back when you end.', cid)
					setPlayerStorageValue(cid,2423,daily4[i].storage)
					talkState[talkUser] = 0
					
				end
			end
		elseif getPlayerLevel(cid) > 150 and getPlayerLevel(cid) <= 200 then
			rand = math.random(1, #daily5)
			for i = 1, #daily5 do
				if rand == i then
					selfSay('Your mission today is to kill ' .. daily5[i].count .. ' ' .. daily5[i].name .. '\'s. Back when you end.', cid)
					setPlayerStorageValue(cid,2423,daily5[i].storage)
					talkState[talkUser] = 0
					
				end
			end
		elseif getPlayerLevel(cid) > 200 and getPlayerLevel(cid) <= 250 then
			rand = math.random(1, #daily6)
			for i = 1, #daily6 do
				if rand == i then
					selfSay('Your mission today is to kill ' .. daily6[i].count .. ' ' .. daily6[i].name .. '\'s. Back when you end.', cid)
					setPlayerStorageValue(cid,2423,daily6[i].storage)
					talkState[talkUser] = 0
					
				end
			end
		elseif getPlayerLevel(cid) > 250 and getPlayerLevel(cid) <= 300 then
			rand = math.random(1, #daily7)
			for i = 1, #daily7 do
				if rand == i then
					selfSay('Your mission today is to kill ' .. daily7[i].count .. ' ' .. daily7[i].name .. '\'s. Back when you end.', cid)
					setPlayerStorageValue(cid,2423,daily7[i].storage)
					talkState[talkUser] = 0
					
				end
			end
		elseif getPlayerLevel(cid) > 300 and getPlayerLevel(cid) <= 350 then
			rand = math.random(1, #daily8)
			for i = 1, #daily8 do
				if rand == i then
					selfSay('Your mission today is to kill ' .. daily8[i].count .. ' ' .. daily8[i].name .. '\'s. Back when you end.', cid)
					setPlayerStorageValue(cid,2423,daily8[i].storage)
					talkState[talkUser] = 0
					
				end
			end
		elseif getPlayerLevel(cid) > 350 and getPlayerLevel(cid) <= 400 then
			rand = math.random(1, #daily11)
			for i = 1, #daily11 do
				if rand == i then
					selfSay('Your mission today is to kill ' .. daily11[i].count .. ' ' .. daily11[i].name .. '\'s. Back when you end.', cid)
					setPlayerStorageValue(cid,2423,daily11[i].storage)
					talkState[talkUser] = 0
					
				end
			end
		elseif getPlayerLevel(cid) > 400 and getPlayerLevel(cid) <= 500 then
			rand = math.random(1, #daily9)
			for i = 1, #daily9 do
				if rand == i then
					selfSay('Your mission today is to kill ' .. daily9[i].count .. ' ' .. daily9[i].name .. '\'s. Back when you end.', cid)
					setPlayerStorageValue(cid,2423,daily9[i].storage)
					talkState[talkUser] = 0
					
				end
			end
		elseif getPlayerLevel(cid) > 500 then
			rand = math.random(1, #daily10)
			for i = 1, #daily10 do
				if rand == i then
					selfSay('Your mission today is to kill ' .. daily10[i].count .. 'x ' .. daily10[i].name .. '\'s. Back when you end.', cid)
					setPlayerStorageValue(cid,2423,daily10[i].storage)
					talkState[talkUser] = 0
					
				end
			end
		end

	end
	if getPlayerStorageValue(cid,2423) == 100 then
			selfSay('You have complete today mission! Back tomorrow!', cid)
			talkState[talkUser] = 0
	end
	
	
	
	
	--Oddanie Daily Questa

		for i = 1, #daily1 do
			if getPlayerStorageValue(cid,2423) == daily1[i].storage then
				if getPlayerStorageValue(cid,2425) >= daily1[i].count then
				selfSay('Exelent! You done today mission.', cid)
				doPlayerAddExp(cid,daily1[i].exp)
				setPlayerStorageValue(cid,2423,100)
				if math.random(1,100) <= daily1[i].chance then
					doPlayerAddItem(cid,daily1[i].item,daily1[i].icount)
				end
				talkState[talkUser] = 0
				else
				selfSay('You have dont killed enought ' .. daily1[i].name .. '\'s.', cid)
				talkState[talkUser] = 0
				end
			end
		end
		for i = 1, #daily2 do
			if getPlayerStorageValue(cid,2423) == daily2[i].storage then
				if getPlayerStorageValue(cid,2425) >= daily2[i].count then
				selfSay('Exelent! You done today mission.', cid)
				doPlayerAddExp(cid,daily2[i].exp)
				setPlayerStorageValue(cid,2423,100)
				if math.random(1,100) <= daily2[i].chance then
					doPlayerAddItem(cid,daily2[i].item,daily2[i].icount)
				end
				talkState[talkUser] = 0
				else
				selfSay('You have dont killed enought ' .. daily2[i].name .. '\'s.', cid)
				talkState[talkUser] = 0
				end
			end
		end
		for i = 1, #daily3 do
			if getPlayerStorageValue(cid,2423) == daily3[i].storage then
				if getPlayerStorageValue(cid,2425) >= daily3[i].count then
				selfSay('Exelent! You done today mission.', cid)
				doPlayerAddExp(cid,daily3[i].exp)
				setPlayerStorageValue(cid,2423,100)
				if math.random(1,100) <= daily3[i].chance then
					doPlayerAddItem(cid,daily3[i].item,daily3[i].icount)
				end
				talkState[talkUser] = 0
				else
				selfSay('You have dont killed enought ' .. daily3[i].name .. '\'s.', cid)
				talkState[talkUser] = 0
				end
			end
		end
		for i = 1, #daily4 do
			if getPlayerStorageValue(cid,2423) == daily4[i].storage then
				if getPlayerStorageValue(cid,2425) >= daily4[i].count then
				selfSay('Exelent! You done today mission.', cid)
				doPlayerAddExp(cid,daily4[i].exp)
				setPlayerStorageValue(cid,2423,100)
				if math.random(1,100) <= daily4[i].chance then
					doPlayerAddItem(cid,daily4[i].item,daily4[i].icount)
				end
				talkState[talkUser] = 0
				else
				selfSay('You have dont killed enought ' .. daily4[i].name .. '\'s.', cid)
				talkState[talkUser] = 0
				end
			end
		end
		for i = 1, #daily5 do
			if getPlayerStorageValue(cid,2423) == daily5[i].storage then
				if getPlayerStorageValue(cid,2425) >= daily5[i].count then
				selfSay('Exelent! You done today mission.', cid)
				doPlayerAddExp(cid,daily5[i].exp)
				setPlayerStorageValue(cid,2423,100)
				if math.random(1,100) <= daily5[i].chance then
					doPlayerAddItem(cid,daily5[i].item,daily5[i].icount)
				end
				talkState[talkUser] = 0
				else
				selfSay('You have dont killed enought ' .. daily5[i].name .. '\'s.', cid)
				talkState[talkUser] = 0
				end
			end
		end
		for i = 1, #daily6 do
			if getPlayerStorageValue(cid,2423) == daily6[i].storage then
				if getPlayerStorageValue(cid,2425) >= daily6[i].count then	
				selfSay('Exelent! You done today mission.', cid)
				doPlayerAddExp(cid,daily6[i].exp)
				setPlayerStorageValue(cid,2423,100)
				if math.random(1,100) <= daily6[i].chance then
					doPlayerAddItem(cid,daily6[i].item,daily6[i].icount)
				end
				talkState[talkUser] = 0
				else
				selfSay('You have dont killed enought ' .. daily6[i].name .. '\'s.', cid)
				talkState[talkUser] = 0
				end
			end
		end
		for i = 1, #daily7 do
			if getPlayerStorageValue(cid,2423) == daily7[i].storage then
				if getPlayerStorageValue(cid,2425) >= daily7[i].count then
				selfSay('Exelent! You done today mission.', cid)
				doPlayerAddExp(cid,daily7[i].exp)
				setPlayerStorageValue(cid,2423,100)
				if math.random(1,100) <= daily7[i].chance then
					doPlayerAddItem(cid,daily7[i].item,daily7[i].icount)
				end
				talkState[talkUser] = 0
				else
				selfSay('You have dont killed enought ' .. daily7[i].name .. '\'s.', cid)
				talkState[talkUser] = 0
				end
			end
		end
		for i = 1, #daily8 do
			if getPlayerStorageValue(cid,2423) == daily8[i].storage then
				if getPlayerStorageValue(cid,2425) >= daily8[i].count then
				selfSay('Exelent! You done today mission.', cid)
				doPlayerAddExp(cid,daily8[i].exp)
				setPlayerStorageValue(cid,2423,100)
				if math.random(1,100) <= daily8[i].chance then
					doPlayerAddItem(cid,daily8[i].item,daily8[i].icount)
				end
				talkState[talkUser] = 0
				else
				selfSay('You have dont killed enought ' .. daily8[i].name .. '\'s.', cid)
				talkState[talkUser] = 0
				end
			end
		end
		for i = 1, #daily9 do
			if getPlayerStorageValue(cid,2423) == daily9[i].storage then
				if getPlayerStorageValue(cid,2425) >= daily9[i].count then
				selfSay('Exelent! You done today mission.', cid)
				doPlayerAddExp(cid,daily9[i].exp)
				setPlayerStorageValue(cid,2423,100)
				if math.random(1,100) <= daily9[i].chance then
					doPlayerAddItem(cid,daily9[i].item,daily9[i].icount)
				end
				talkState[talkUser] = 0
				else
				selfSay('You have dont killed enought ' .. daily9[i].name .. '\'s.', cid)
				talkState[talkUser] = 0
				end
			end
		end
		for i = 1, #daily10 do
			if getPlayerStorageValue(cid,2423) == daily10[i].storage then
				if getPlayerStorageValue(cid,2425) >= daily10[i].count then
				selfSay('Exelent! You done today mission.', cid)
				doPlayerAddExp(cid,daily10[i].exp)
				setPlayerStorageValue(cid,2423,100)
				if math.random(1,100) <= daily10[i].chance then
					doPlayerAddItem(cid,daily10[i].item,daily10[i].icount)
				end
				talkState[talkUser] = 0
				else
				selfSay('You have dont killed enought ' .. daily10[i].name .. '\'s.', cid)
				talkState[talkUser] = 0
				end
			end
		end
		for i = 1, #daily11 do
			if getPlayerStorageValue(cid,2423) == daily11[i].storage then
				if getPlayerStorageValue(cid,2425) >= daily11[i].count then
				selfSay('Exelent! You done today mission.', cid)
				doPlayerAddExp(cid,daily11[i].exp)
				setPlayerStorageValue(cid,2423,100)
				if math.random(1,100) <= daily11[i].chance then
					doPlayerAddItem(cid,daily11[i].item,daily11[i].icount)
				end
				talkState[talkUser] = 0
				else
				selfSay('You have dont killed enought ' .. daily11[i].name .. '\'s.', cid)
				talkState[talkUser] = 0
				end
			end
		end
	end

	return true
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
(Example will be below)

creaturescripts.xml
XML:
	<event type="kill" name="dailycounter" script="dailycounter.lua"/>

login.lua
Lua:
registerCreatureEvent(cid, "dailycounter")

dailycounter.lua
Lua:
local config = {
{["name"] = "Wolf", ["storage"] = 5, ["count"] = 20, ["exp"] = 2000, ["item"] = 2152, ["icount"] = 10, ["chance"] = 75},
{["name"] = "Snake", ["storage"] = 6, ["count"] = 20, ["exp"] = 3000, ["item"] = 2152, ["icount"] = 15, ["chance"] = 75},
{["name"] = "Bandit", ["storage"] = 7, ["count"] = 30, ["exp"] = 25000, ["item"] = 2152, ["icount"] = 30, ["chance"] = 90},
{["name"] = "Elite Bandit", ["storage"] = 7, ["count"] = 30, ["exp"] = 25000, ["item"] = 2152, ["icount"] = 30, ["chance"] = 90},
{["name"] = "Fat Ninja", ["storage"] = 8, ["count"] = 30, ["exp"] = 26000, ["item"] = 2152, ["icount"] = 35, ["chance"] = 90},
{["name"] = "Onbaa", ["storage"] = 9, ["count"] = 30, ["exp"] = 30000, ["item"] = 2152, ["icount"] = 35, ["chance"] = 90},
{["name"] = "Assassin", ["storage"] = 10, ["count"] = 30, ["exp"] = 75000, ["item"] = 2152, ["icount"] = 50, ["chance"] = 70},
{["name"] = "Cursed Wolf", ["storage"] = 11, ["count"] = 30, ["exp"] = 95000, ["item"] = 2152, ["icount"] = 50, ["chance"] = 70},
{["name"] = "Cursed Skeleton", ["storage"] = 12, ["count"] = 30, ["exp"] = 130000, ["item"] = 2152, ["icount"] = 60, ["chance"] = 70},
{["name"] = "Vampire", ["storage"] = 13, ["count"] = 30, ["exp"] = 170000, ["item"] = 2152, ["icount"] = 70, ["chance"] = 70},
{["name"] = "Cyborg", ["storage"] = 14, ["count"] = 30, ["exp"] = 90000, ["item"] = 2152, ["icount"] = 50, ["chance"] = 70},
{["name"] = "Elite Cyborg", ["storage"] = 14, ["count"] = 30, ["exp"] = 90000, ["item"] = 2152, ["icount"] = 50, ["chance"] = 70},
{["name"] = "Young Kyokushin", ["storage"] = 15, ["count"] = 50, ["exp"] = 300000, ["item"] = 2152, ["icount"] = 100, ["chance"] = 80},
{["name"] = "Kyokushin", ["storage"] = 15, ["count"] = 50, ["exp"] = 300000, ["item"] = 2152, ["icount"] = 100, ["chance"] = 80},
{["name"] = "Monk", ["storage"] = 16, ["count"] = 50, ["exp"] = 300000, ["item"] = 2152, ["icount"] = 100, ["chance"] = 80},
{["name"] = "Elite Monk", ["storage"] = 16, ["count"] = 50, ["exp"] = 300000, ["item"] = 2152, ["icount"] = 100, ["chance"] = 80},
{["name"] = "Stranger", ["storage"] = 17, ["count"] = 30, ["exp"] = 350000, ["item"] = 2160, ["icount"] = 1, ["chance"] = 70},
{["name"] = "Young Kyokushin",["storage"] = 18, ["count"] = 60, ["exp"] = 350000, ["item"] = 2160, ["icount"] = 1, ["chance"] = 70},
{["name"] = "Kyokushin",["storage"] = 18, ["count"] = 60, ["exp"] = 350000, ["item"] = 2160, ["icount"] = 1, ["chance"] = 70},
{["name"] = "Sound Shinobi", ["storage"] = 19, ["count"] = 30, ["exp"] = 350000, ["item"] = 2160, ["icount"] = 1, ["chance"] = 70},
{["name"] = "Stranger", ["storage"] = 20, ["count"] = 30, ["exp"] = 350000, ["item"] = 2160, ["icount"] = 1, ["chance"] = 70},
{["name"] = "Zombie", ["storage"] = 21, ["count"] = 30, ["exp"] = 370000, ["item"] = 2160, ["icount"] = 1, ["chance"] = 70},
{["name"] = "Mutated", ["storage"] = 22, ["count"] = 30, ["exp"] = 550000, ["item"] = 2160, ["icount"] = 2, ["chance"] = 70},
{["name"] = "Samurai", ["storage"] = 23, ["count"] = 40, ["exp"] = 650000, ["item"] = 2160, ["icount"] = 2, ["chance"] = 70},
{["name"] = "Ice Monster", ["storage"] = 24, ["count"] = 40, ["exp"] = 750000, ["item"] = 2160, ["icount"] = 3, ["chance"] = 70},
{["name"] = "Elite Samurai", ["storage"] = 25, ["count"] = 40, ["exp"] = 1000000, ["item"] = 2160, ["icount"] = 4, ["chance"] = 75},
{["name"] = "Elite Samurai", ["storage"] = 26, ["count"] = 50, ["exp"] = 1100000, ["item"] = 2160, ["icount"] = 5, ["chance"] = 70}
}
function onKill(cid, target, lastHit)
if lastHit == true then
	if(isPlayer(target) ~= TRUE) then

		local master = getCreatureMaster(target)
		if(master and master ~= target) then return TRUE end

		
		for i = 1, #config do
			if getCreatureName(target):lower() == config[i].name:lower() then
				if getPlayerStorageValue(cid, 2423) == config[i].storage then
					setPlayerStorageValue(cid, 2425, getPlayerStorageValue(cid, 2425) + 1)
					if config[i].name == "Black Fowler" then
						if getPlayerStorageValue(cid, 2425) < config[i].count then
							doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Daily Quest: You have killed Fowler [" .. getPlayerStorageValue(cid, 2425) .. " / " .. config[i].count.."]")
						elseif getPlayerStorageValue(cid, 2425) == config[i].count then
							doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Daily Quest: You have killed last Fowler, go back to NPC and report.")
						end
					else
						if getPlayerStorageValue(cid, 2425) < config[i].count then
							doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Daily Quest: You have killed " .. config[i].name .. " [" .. getPlayerStorageValue(cid, 2425) .. " / " .. config[i].count.."]")
						elseif getPlayerStorageValue(cid, 2425) == config[i].count then
							doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Daily Quest: You have killed last " .. config[i].name .. ", go back to NPC and report.")
						end
					end
				end
			end
		end
	end

	return TRUE
end
end

talkaction for check current mission status:
Lua:
local config = {
{["name"] = "Wolf", ["storage"] = 5, ["count"] = 20, ["exp"] = 2000, ["item"] = 2152, ["icount"] = 10, ["chance"] = 75},
{["name"] = "Snake", ["storage"] = 6, ["count"] = 20, ["exp"] = 3000, ["item"] = 2152, ["icount"] = 15, ["chance"] = 75},
{["name"] = "Bandit", ["storage"] = 7, ["count"] = 30, ["exp"] = 25000, ["item"] = 2152, ["icount"] = 30, ["chance"] = 92},
{["name"] = "Fat Ninja", ["storage"] = 8, ["count"] = 30, ["exp"] = 26000, ["item"] = 2152, ["icount"] = 35, ["chance"] = 89},
{["name"] = "Onbaa", ["storage"] = 9, ["count"] = 30, ["exp"] = 30000, ["item"] = 2152, ["icount"] = 35, ["chance"] = 91},
{["name"] = "Assassin", ["storage"] = 10, ["count"] = 30, ["exp"] = 75000, ["item"] = 2152, ["icount"] = 50, ["chance"] = 67},
{["name"] = "Cursed Wolf", ["storage"] = 11, ["count"] = 30, ["exp"] = 95000, ["item"] = 2152, ["icount"] = 50, ["chance"] = 68},
{["name"] = "Cursed Skeleton", ["storage"] = 12, ["count"] = 30, ["exp"] = 130000, ["item"] = 2152, ["icount"] = 60, ["chance"] = 71},
{["name"] = "Vampire", ["storage"] = 13, ["count"] = 30, ["exp"] = 170000, ["item"] = 2152, ["icount"] = 70, ["chance"] = 75},
{["name"] = "Cyborg", ["storage"] = 14, ["count"] = 30, ["exp"] = 90000, ["item"] = 2152, ["icount"] = 50, ["chance"] = 76},
{["name"] = "Kyokushin", ["storage"] = 15, ["count"] = 50, ["exp"] = 300000, ["item"] = 2152, ["icount"] = 100, ["chance"] = 78},
{["name"] = "Monk", ["storage"] = 16, ["count"] = 50, ["exp"] = 300000, ["item"] = 2152, ["icount"] = 100, ["chance"] = 79},
{["name"] = "Stranger", ["storage"] = 17, ["count"] = 30, ["exp"] = 350000, ["item"] = 2160, ["icount"] = 1, ["chance"] = 75},
{["name"] = "Kyokushin",["storage"] = 18, ["count"] = 60, ["exp"] = 350000, ["item"] = 2160, ["icount"] = 1, ["chance"] = 73},
{["name"] = "Sound Shinobi", ["storage"] = 19, ["count"] = 30, ["exp"] = 350000, ["item"] = 2160, ["icount"] = 1, ["chance"] = 71},
{["name"] = "Stranger", ["storage"] = 20, ["count"] = 30, ["exp"] = 350000, ["item"] = 2160, ["icount"] = 1, ["chance"] = 77},
{["name"] = "Zombie", ["storage"] = 21, ["count"] = 30, ["exp"] = 370000, ["item"] = 2160, ["icount"] = 1, ["chance"] = 78},
{["name"] = "Mutated", ["storage"] = 22, ["count"] = 30, ["exp"] = 550000, ["item"] = 2160, ["icount"] = 2, ["chance"] = 85},
{["name"] = "Samurai", ["storage"] = 23, ["count"] = 40, ["exp"] = 650000, ["item"] = 2160, ["icount"] = 2, ["chance"] = 65},
{["name"] = "Ice Monster", ["storage"] = 24, ["count"] = 40, ["exp"] = 750000, ["item"] = 2160, ["icount"] = 3, ["chance"] = 68},
{["name"] = "Elite Samurai", ["storage"] = 25, ["count"] = 40, ["exp"] = 1000000, ["item"] = 2160, ["icount"] = 4, ["chance"] = 74},
{["name"] = "Elite Samurai", ["storage"] = 26, ["count"] = 50, ["exp"] = 1100000, ["item"] = 2160, ["icount"] = 5, ["chance"] = 73}

}


function onSay(cid, words, param)

local pos = getPlayerPosition(cid)

if getPlayerStorageValue(cid,2423) <= 1 then
	doPlayerSendTextMessage(cid, 20,"You doesnt started any mission today.")
end


	for i = 1, #config do
		if getPlayerStorageValue(cid,2423) == config[i].storage then
				if getPlayerStorageValue(cid,2425) < config[i].count then
					doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "[Mission]: You have killed [" .. getPlayerStorageValue(cid, 2425) .. " / " .. config[i].count.."] " .. config[i].name .. "\'s.")
					doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Reward: " .. config[i].exp .. " experience points and " .. config[i].chance .. "% chance to recive " .. config[i].icount .. "x " .. getItemNameById(config[i].item) .. "\'s.")
				else
					doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "[Mission]: You have killed enough " .. config[i].name .. "\'s, go back to NPC.")
				end
		end
	end
if getPlayerStorageValue(cid,2423) == 100 then
	doPlayerSendTextMessage(cid, 20,"You have done a mission today")
end	
	return 1
end

globalevents.xml
XML:
<globalevent name="daily" time="23:59" event="script" value="daily.lua"/>

daliy.lua
Lua:
function onTimer()
	db.executeQuery('INSERT IGNORE INTO `player_storage` SELECT `id`, 2423, 1 FROM `players` WHERE `online` = 0 ON DUPLICATE KEY UPDATE `value` = 1')
	db.executeQuery('INSERT IGNORE INTO `player_storage` SELECT `id`, 2425, 1 FROM `players` WHERE `online` = 0 ON DUPLICATE KEY UPDATE `value` = 0')
	local a = getPlayersOnline()
	for b = 1, #a do
		doCreatureSetStorage(a[b], 2423, 1)
		doCreatureSetStorage(a[b], 2425, 0)
	end
	return true
end
It will just simply reset everyone daily at 23:59. (If server didnt work on midnight, daily will not be restarted!)



How to set config
In each daily u have a numbers, EX: 1-30, that says players with level 1 to 30 can recive those monsters as a daily mission,
then you have:
Lua:
{["name"] = "Wolf", ["storage"] = 5, ["count"] = 20, ["exp"] = 2000, ["item"] = 2152, ["icount"] = 10, ["chance"] = 75},
Name = monster name
storage = keeps your mission, for every daily must be diffrent (exactly its just a Value of storage (2423))
count = number of monsters that you must defeat
exp = how much experience player recive
item = ID of item that player can recive
icount = count of that item
chance = a chance to recive item

And just put same config to every script, and it will works.

Hope someone enjoy my script, i work very hard on this one, ive made it to myself so sorry for mess.

Greetz,
Erexo.
 
Last edited:
Nope, in my opition quest log sucks [i just cannot configure it, so ive saying its sucks]
Thats why ive made mission talkaction.
 
you can add another parameter for the level also the script would be a lot shorter
 
I made this script for personal usage, so i dont need to make it shorter. Anyways I've decided to share it with you guys :)
 
I made this script for personal usage, so i dont need to make it shorter. Anyways I've decided to share it with you guys :)

Thats isn't a good answer, personally, if i'm doing my homework (telling something) I will do it as best I can because I want a good qualification no?
Well, I'm trying to say that, it can be a lot shorter and I will do that (ofc credits to you and to Colandus for fix my error)

Good job anyways :)
 
Your example isnt too good, I'm doing my homework for a teacher, who wanna check my skills, but i can draw whatever i fucking want at last pages of my book becouse noone will ever check this.
Also here, i can do complicated and long as f*ck scripts, becouse its only for me, less job, same results, so I dont see the point to make it shorter. (or if you wanna learn something, then you can do complicated scripts).
Nope, i dont wanna to make it shorter, its mine script.

PS:
Lua:
local config = {
minlv/maxlv,
}
local valTable = {}
local check = 1
for i=1, #config do 
	if getPlayerLevel(cid) >= config[i].minlv and getPlayerLevel(cid) <= config[i].maxlv then
		table.insert(valTable,check,config[i])
		check = check + 1
	end
end
local rand = (#valTable)

for i=1, #valTable do 
	if rand == i then
		--Script here
		break
	end
end
Just for you
 
Nice release, though I can't see it like that :p

Lua:
local config = {
    [{1, 30}] = {
        {["name"] = "Wolf", ["storage"] = 5, ["count"] = 20, ["exp"] = 2000, ["item"] = 2152, ["icount"] = 10, ["chance"] = 75},
        {["name"] = "Snake", ["storage"] = 6, ["count"] = 20, ["exp"] = 3000, ["item"] = 2152, ["icount"] = 15, ["chance"] = 75}
    },
    
    [{31, 70}] = {
        {["name"] = "Assassin", ["storage"] = 10, ["count"] = 30, ["exp"] = 75000, ["item"] = 2152, ["icount"] = 50, ["chance"] = 67},
        {["name"] = "Cursed Wolf", ["storage"] = 11, ["count"] = 30, ["exp"] = 95000, ["item"] = 2152, ["icount"] = 50, ["chance"] = 68}
    },

    [{71, 100}] = {
        {["name"] = "Stranger", ["storage"] = 17, ["count"] = 30, ["exp"] = 350000, ["item"] = 2160, ["icount"] = 1, ["chance"] = 75},
        {["name"] = "Kyokushin",["storage"] = 18, ["count"] = 60, ["exp"] = 350000, ["item"] = 2160, ["icount"] = 1, ["chance"] = 73}
    },
    
    [{101, 150}] = {
        {["name"] = "Mutated", ["storage"] = 22, ["count"] = 30, ["exp"] = 550000, ["item"] = 2160, ["icount"] = 2, ["chance"] = 85},
        {["name"] = "Samurai", ["storage"] = 23, ["count"] = 40, ["exp"] = 650000, ["item"] = 2160, ["icount"] = 2, ["chance"] = 65}
    },
    
    [{151, 200}] = {
        {["name"] = "Elite Samurai", ["storage"] = 26, ["count"] = 50, ["exp"] = 1100000, ["item"] = 2160, ["icount"] = 5, ["chance"] = 73},
        {["name"] = "Nukenin", ["storage"] = 27, ["count"] = 50, ["exp"] = 1500000, ["item"] = 2160, ["icount"] = 5, ["chance"] = 77}
    },
    
    [{201, 250}] = {
        {["name"] = "Nukenin", ["storage"] = 30, ["count"] = 70, ["exp"] = 2000000, ["item"] = 2160, ["icount"] = 6, ["chance"] = 71},
        {["name"] = "Akatsuki Memember", ["storage"] = 31, ["count"] = 40, ["exp"] = 3000000, ["item"] = 2160, ["icount"] = 6, ["chance"] = 73}
    },
    
    [{251, 300}] = {
        {["name"] = "Akatsuki Memember", ["storage"] = 34, ["count"] = 70, ["exp"] = 6000000, ["item"] = 2160, ["icount"] = 10, ["chance"] = 65},
        {["name"] = "Samurai Master", ["storage"] = 35, ["count"] = 60, ["exp"] = 4000000, ["item"] = 2160, ["icount"] = 12, ["chance"] = 66}
    },
    
    [{301, 350}] = {
        {["name"] = "Rikudou Patch", ["storage"] = 38, ["count"] = 70, ["exp"] = 8000000, ["item"] = 2160, ["icount"] = 14, ["chance"] = 73},
        {["name"] = "Black Samurai [King]", ["storage"] = 39, ["count"] = 30, ["exp"] = 7000000, ["item"] = 2160, ["icount"] = 15, ["chance"] = 77}
    },
    
    [{351, 400}] = {
        {["name"] = "Rikudou Patch", ["storage"] = 61, ["count"] = 70, ["exp"] = 8000000, ["item"] = 2160, ["icount"] = 14, ["chance"] = 73},
        {["name"] = "Black Samurai [King]", ["storage"] = 62, ["count"] = 50, ["exp"] = 8500000, ["item"] = 2160, ["icount"] = 16, ["chance"] = 70}
    },
    
    [{401, 500}] = {
        {["name"] = "Black Samurai [King]", ["storage"] = 41, ["count"] = 50, ["exp"] = 9000000, ["item"] = 2160, ["icount"] = 16, ["chance"] = 71},
        {["name"] = "Black Samurai [King]", ["storage"] = 42, ["count"] = 70, ["exp"] = 11000000, ["item"] = 2160, ["icount"] = 18, ["chance"] = 73}
    },

    [{501, math.huge}] = {
       {["name"] = "Heaven Guardian", ["storage"] = 46, ["count"] = 50, ["exp"] = 13000000, ["item"] = 2160, ["icount"] = 25, ["chance"] = 90},
       {["name"] = "Heaven Guardian", ["storage"] = 47, ["count"] = 70, ["exp"] = 15000000, ["item"] = 2160, ["icount"] = 27, ["chance"] = 76},
       {["name"] = "Bug", ["storage"] = 52, ["count"] = 100, ["exp"] = 10000000, ["item"] = 1691, ["icount"] = 1, ["chance"] = 100}
    }    
}

 
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

	if(msgcontains(msg, 'mission') or msgcontains(msg, 'daily')) then
        if getPlayerStorageValue(cid,2423) <= 1 then
            local lv = getPlayerLevel(cid)
            for level, tasks in pairs(config) do
                if lv >= level[1] and lv < level[2] then
                    local randomTask = tasks[math.random(#tasks)]
                    selfSay('Your mission today is to kill ' .. randomTask.count .. ' ' .. randomTask.name .. '\'s. Back when you end.', cid)
                    setPlayerStorageValue(cid, 2423, randomTask.storage)
                    break
                end
            end    
        elseif getPlayerStorageValue(cid,2423) == 100 then
                selfSay('You have complete today mission! Come back tomorrow!', cid)
                return true
        else
            local taskID = getPlayerStorageValue(cid, 2423)
            local killed = getPlayerStorageValue(cid, 2425)
            for level, tasks in pairs(config) do
                for k, t in pairs(tasks) do
                    if t.storage == taskID then
                        if killed >= t.count then
                            selfSay('Exelent! You done today mission.', cid)
                            doPlayerAddExp(cid, t.exp)
                            setPlayerStorageValue(cid, 2423, 100)
                            if math.random(100) <= t.chance then
                                doPlayerAddItem(cid, t.item, t.icount)
                            end
                        else
                            selfSay('You did not kill enough ' .. t.name .. '\'s yet.', cid)
                        end
                        return true
                    end
                end
            end    
        end
    end
 
	return true
end
 
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

less job, same results,
I don't think it is less work. It is even more work to do it with 100 if-blocks etc.
 
Last edited:
also creaturescript:
Lua:
local config = {
["name in lowercase (thanks teckman)"] = { storage = same storage at npc file, count = same count}
}

function onKill(cid, target, lastHit)
	local creature, task, kills = config[getCreatureName(target):lower()], getPlayerStorageValue(cid, 2423), getPlayerStorageValue(cid, 2425)
	local function isSummon(cid)
		return getCreatureMaster(cid) ~= cid or false
	end
	if creature and lastHit then
		if isPlayer(target) or isSummon(target) then return true end
		if task == creature.storage then
			setPlayerStorageValue(cid, 2425, kills + 1)
			if kills < creature.count then
				doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Daily Quest: You have killed " .. getCreatureName(target) .. " [" .. kills .. "/" .. creature.count.."]")
			elseif kills == creature.count then
				doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Daily Quest: You have killed last " .. getCreatureName(target) .. ", go back to NPC and report.")
			end
		end
	end
	return true
end
 
Last edited:
/\

Its nothing negative, shorter more read able :) Anyway!
Great job, looks good :)
 
14:41 Asadfa [60]: daily task
14:41 Tasker: You have dont killed enought Black Knight's.

And I have already killed like 20 black knights...

14:43 [Mission]: You have killed [-1 / 60] Black Knights.
14:43 Reward: 350000 experience points and 73% chance to recive 1x crystal coin's.


Maybe it is because I deleted the (cid, "dailycounter") in:

creaturescripts.xml
XML Code:
<event type="kill" name="dailycounter" script="dailycounter.lua"/>
<event type="login" name="regDaily" script="registerCreatureEvent(cid, "dailycounter")"/>

Because of this error:
 
use this npc:
Lua:
local config = {
    [{1, 30}] = {
        {["name"] = "Wolf", ["storage"] = 5, ["count"] = 20, ["exp"] = 2000, ["item"] = 2152, ["icount"] = 10, ["chance"] = 75},
        {["name"] = "Snake", ["storage"] = 6, ["count"] = 20, ["exp"] = 3000, ["item"] = 2152, ["icount"] = 15, ["chance"] = 75}
    },
 
    [{31, 70}] = {
        {["name"] = "Assassin", ["storage"] = 10, ["count"] = 30, ["exp"] = 75000, ["item"] = 2152, ["icount"] = 50, ["chance"] = 67},
        {["name"] = "Cursed Wolf", ["storage"] = 11, ["count"] = 30, ["exp"] = 95000, ["item"] = 2152, ["icount"] = 50, ["chance"] = 68}
    },
 
    [{71, 100}] = {
        {["name"] = "Cave Rat", ["storage"] = 17, ["count"] = 30, ["exp"] = 350000, ["item"] = 2160, ["icount"] = 1, ["chance"] = 75},
        {["name"] = "Rat",["storage"] = 18, ["count"] = 60, ["exp"] = 350000, ["item"] = 2160, ["icount"] = 1, ["chance"] = 73}
    },
 
    [{101, 150}] = {
        {["name"] = "Mutated", ["storage"] = 22, ["count"] = 30, ["exp"] = 550000, ["item"] = 2160, ["icount"] = 2, ["chance"] = 85},
        {["name"] = "Samurai", ["storage"] = 23, ["count"] = 40, ["exp"] = 650000, ["item"] = 2160, ["icount"] = 2, ["chance"] = 65}
    },
 
    [{151, 200}] = {
        {["name"] = "Elite Samurai", ["storage"] = 26, ["count"] = 50, ["exp"] = 1100000, ["item"] = 2160, ["icount"] = 5, ["chance"] = 73},
        {["name"] = "Nukenin", ["storage"] = 27, ["count"] = 50, ["exp"] = 1500000, ["item"] = 2160, ["icount"] = 5, ["chance"] = 77}
    },
 
    [{201, 250}] = {
        {["name"] = "Nukenin", ["storage"] = 30, ["count"] = 70, ["exp"] = 2000000, ["item"] = 2160, ["icount"] = 6, ["chance"] = 71},
        {["name"] = "Akatsuki Memember", ["storage"] = 31, ["count"] = 40, ["exp"] = 3000000, ["item"] = 2160, ["icount"] = 6, ["chance"] = 73}
    },
 
    [{251, 300}] = {
        {["name"] = "Akatsuki Memember", ["storage"] = 34, ["count"] = 70, ["exp"] = 6000000, ["item"] = 2160, ["icount"] = 10, ["chance"] = 65},
        {["name"] = "Samurai Master", ["storage"] = 35, ["count"] = 60, ["exp"] = 4000000, ["item"] = 2160, ["icount"] = 12, ["chance"] = 66}
    },
 
    [{301, 350}] = {
        {["name"] = "Rikudou Patch", ["storage"] = 38, ["count"] = 70, ["exp"] = 8000000, ["item"] = 2160, ["icount"] = 14, ["chance"] = 73},
        {["name"] = "Black Samurai [King]", ["storage"] = 39, ["count"] = 30, ["exp"] = 7000000, ["item"] = 2160, ["icount"] = 15, ["chance"] = 77}
    },
 
    [{351, 400}] = {
        {["name"] = "Rikudou Patch", ["storage"] = 61, ["count"] = 70, ["exp"] = 8000000, ["item"] = 2160, ["icount"] = 14, ["chance"] = 73},
        {["name"] = "Black Samurai [King]", ["storage"] = 62, ["count"] = 50, ["exp"] = 8500000, ["item"] = 2160, ["icount"] = 16, ["chance"] = 70}
    },
 
    [{401, 500}] = {
        {["name"] = "Black Samurai [King]", ["storage"] = 41, ["count"] = 50, ["exp"] = 9000000, ["item"] = 2160, ["icount"] = 16, ["chance"] = 71},
        {["name"] = "Black Samurai [King]", ["storage"] = 42, ["count"] = 70, ["exp"] = 11000000, ["item"] = 2160, ["icount"] = 18, ["chance"] = 73}
    },
 
    [{501, 600}] = {
       {["name"] = "Heaven Guardian", ["storage"] = 46, ["count"] = 50, ["exp"] = 13000000, ["item"] = 2160, ["icount"] = 25, ["chance"] = 90},
       {["name"] = "Heaven Guardian", ["storage"] = 47, ["count"] = 70, ["exp"] = 15000000, ["item"] = 2160, ["icount"] = 27, ["chance"] = 76},
       {["name"] = "Bug", ["storage"] = 52, ["count"] = 100, ["exp"] = 10000000, ["item"] = 1691, ["icount"] = 1, ["chance"] = 100}
    }    
}
 
 
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
 
	if(msgcontains(msg, 'mission') or msgcontains(msg, 'daily')) then
        if getPlayerStorageValue(cid, 2423) <= 1 then
            local lv = getPlayerLevel(cid)
            for level, tasks in pairs(config) do
                if lv >= level[1] and lv <= level[2] then
                    local randomTask = tasks[math.random(#tasks)]
                    selfSay('Your mission today is to kill ' .. randomTask.count .. ' ' .. randomTask.name .. '\'s. Back when you end.', cid)
                    setPlayerStorageValue(cid, 2423, randomTask.storage)
                    break
                end
            end    
        elseif getPlayerStorageValue(cid,2423) == 100 then
                selfSay('You have complete today mission! Come back tomorrow!', cid)
                return true
        else
            local taskID = getPlayerStorageValue(cid, 2423)
            local killed = getPlayerStorageValue(cid, 2425)
            for level, tasks in pairs(config) do
                for k, t in pairs(tasks) do
                    if t.storage == taskID then
                        if killed >= t.count then
                            selfSay('Exelent! You done today mission.', cid)
                            doPlayerAddExp(cid, t.exp)
                            setPlayerStorageValue(cid, 2423, 100)
                            if math.random(100) <= t.chance then
                                doPlayerAddItem(cid, t.item, t.icount)
                            end
                        else
			    local function getKills(cid) return killed > 0 and killed or 0 end
                            selfSay('You did not kill enough ' .. t.name .. '\'s yet, you have killed ' .. getKills(cid) ..'/' .. t.count .. ' ' .. t.name .. '\'s', cid)
                        end
                        return true
                    end
                end
            end    
        end
    end
 
	return true
end
 
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
 
15:19 Loot of a wolf: nothing.
15:19 A wolf loses 12 hitpoints due to your attack.
15:19 A wolf loses 13 hitpoints due to your attack.
15:19 You gained 135 experience points.
15:19 Loot of a wolf: meat.
15:20 Sasuke [8]: daily task
15:20 Tasker: You did not kill enough Wolf's yet, you have killed 0/2 Wolf's
 
consecutive error:
[03/01/2014 04:12:16] [Error - Npc interface]
[03/01/2014 04:12:16] (Unknown script file)
[03/01/2014 04:12:16] Description:
[03/01/2014 04:12:16] attempt to call a nil value
[03/01/2014 04:12:16] stack traceback:

[03/01/2014 04:12:17] [Error - Npc interface]
[03/01/2014 04:12:17] (Unknown script file)
[03/01/2014 04:12:17] Description:
[03/01/2014 04:12:17] attempt to call a nil value
[03/01/2014 04:12:17] stack traceback:

[03/01/2014 04:12:17] [Error - Npc interface]
[03/01/2014 04:12:17] (Unknown script file)
[03/01/2014 04:12:17] Description:
[03/01/2014 04:12:17] attempt to call a nil value
[03/01/2014 04:12:17] stack traceback:

[03/01/2014 04:12:18] [Error - Npc interface]
[03/01/2014 04:12:18] (Unknown script file)
[03/01/2014 04:12:18] Description:
[03/01/2014 04:12:18] attempt to call a nil value
[03/01/2014 04:12:18] stack traceback:

Help please
 
Fixed reemplazing

local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}
function onCreatureAppear(cid) npcHandler:eek:nCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler:eek:nCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler:eek:nCreatureSay(cid, type, msg) end
function onThink() npcHandler:eek:nThink() end
function creatureSayCallback(cid, type, msg)
if(not npcHandler:isFocused(cid)) then
return false
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


BY THAT


local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}
function onCreatureAppear(cid) npcHandler:eek:nCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler:eek:nCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler:eek:nCreatureSay(cid, type, msg) end
function onThink() npcHandler:eek:nThink() 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


LOL
 
Back
Top