• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

CreatureEvent [CreatureEvent/Npc] Killing in the name of. [Now player can start more than one task]

when i add reward Item i got error and the player can do task again and again, without killing and they get reward (no item just exp, i add 2 rewards.)


[24/01/2012 17:23:37] data/npc/scripts/killinginthenameof.lua:138: in function 'callback'
[24/01/2012 17:23:37] data/npc/lib/npcsystem/npchandler.lua:390: in function 'onCreatureSay'
[24/01/2012 17:23:37] data/npc/scripts/killinginthenameof.lua:43: in function <data/npc/scripts/killinginthenameof.lua:43>
 
Hey I tried to customise this to different monsters, and suddenly it doesn't work?

All I changed were the names of the monsters in both scripts (NPC and global) etc..

Example:

Lua:
[1] = {questStarted = 1510, questStorage = 65000, killsRequired = 100, raceName = "Rotworms", rewards = {{enable = true, type = "exp", values = 200}, {enable = true, type = "money", values = 200}}},

Lua:
["rotworm"] = {questStarted = 1510, questStorage = 65000, creatureStorage = 15000, killsRequired = 100, raceName = "Rotworms"},
	["carrion worm"] = {questStarted = 1510, questStorage = 65000, creatureStorage = 15001, killsRequired = 100, raceName = "Rotworms"},

As you can see, that used to be trolls, now they're rotworms. For some reason, it doesn't work. The original script works, but why not when I customise it? There's no errors in the console, either.

Can anyone help me?

PS - Using TFS 0.4
(I can give full edited files on request if needed, too)
 
Change this line:
Lua:
elseif tasks[tonumber(msg)] then

By this:
Lua:
elseif tasks[msg] then

It will works only if the task name ~= the raceName, for example, the code you posted will work because the task name ~= the raceName (rotworm ~= rotworms)
 
So I did that, and it still didn't fix it to the 'custom list'.

I know everything else is right, since the tasks actually work (well, tasks 1 and 2 [Trolls and Goblins worked] but not Rotworms or any other...).
It pops up with the list, all the new names etc. But nothing.

Anyway, here's my files I have

NPC File
Lua:
local tasks =
{
	[1] = {questStarted = 1510, questStorage = 65000, killsRequired = 100, raceName = "Rotworms", rewards = {{enable = true, type = "exp", values = 200}, {enable = true, type = "money", values = 200}}},
 
	[2] = {questStarted = 1511, questStorage = 65001, killsRequired = 150, raceName = "Wyverns", rewards = {{enable = true, type = "exp", values = 300}, {enable = true, type = "money", values = 250}}},
 
	[3] = {questStarted = 1512, questStorage = 65002, killsRequired = 300, raceName = "Vampires", rewards = {{enable = true, type = "exp", values = 1000}, {enable = true, type = "money", values = 400}}},
 
	[4] = {questStarted = 1513, questStorage = 65003, killsRequired = 200, raceName = "Souleaters", rewards = {{enable = true, type = "exp", values = 3000}, {enable = true, type = "money", values = 800}}},
 
	[5] = {questStarted = 1514, questStorage = 65004, killsRequired = 300, raceName = "Hydras", rewards = {{enable = true, type = "exp", values = 800}, {enable = true, type = "boss", values = THESNAPPER_POSITION}, {enable = true, type = "points", values = 2}}},
 
	[6] = {questStarted = 1515, questStorage = 65005, killsRequired = 300, raceName = "Nightmares", rewards = {{enable = true, type = "money", values = 1500}, {enable = true, type = "boss", values = HIDE_POSITION}, {enable = true, type = "points", values = 2}}},
 
	[7] = {questStarted = 1516, questStorage = 65006, killsRequired = 75, raceName = "Hellspawns", rewards = {{enable = true, type = "exp", values = 1500}, {enable = true, type = "points", values = 1}}},
 
	[8] = {questStarted = 1517, questStorage = 65007, killsRequired = 200, raceName = "Lizards", rewards = {{enable = true, type = "exp", values = 2000}, {enable = true, type = "points", values = 1}}},
 
	[9] = {questStarted = 1518, questStorage = 65008, killsRequired = 300, raceName = "Drakens", rewards = {{enable = true, type = "exp", values = 4000}, {enable = true, type = "boss", values = THEBLOODTUSK_POSITION}, {enable = true, type = "points", values = 2}}},
 
	[10] = {questStarted = 1519, questStorage = 65009, killsRequired = 300, raceName = "Undead Jesters", rewards = {{enable = true, type = "exp", values = 15000}, {enable = true, type = "boss", values = SHARDHEAD_POSITION}, {enable = true, type = "points", values = 2}}},
 
	[11] = {questStarted = 1520, questStorage = 65010, killsRequired = 300, raceName = "Quagmires", rewards = {{enable = true, type = "exp", values = 10000}, {enable = true, type = "points", values = 1}}},
 
	[12] = {questStarted = 1521, questStorage = 65011, killsRequired = 300, raceName = "Elves", rewards = {{enable = true, type = "exp", values = 12000}, {enable = true, type = "boss", values = THUL_POSITION}, {enable = true, type = "points", values = 2}}},
 
	[13] = {questStarted = 1522, questStorage = 65012, killsRequired = 150, raceName = "Hellhounds", rewards = {{enable = true, type = "exp", values = 7000}, {enable = true, type = "points", values = 1}}},
 
	[14] = {questStarted = 1523, questStorage = 65013, killsRequired = 350, raceName = "Grim Reapers", rewards = {{enable = true, type = "exp", values = 10000}, {enable = true, type = "points", values = 1}}},
 
	[15] = {questStarted = 1524, questStorage = 65014, killsRequired = 100, raceName = "Tarragons", rewards = {{enable = true, type = "exp", values = 10000}, {enable = true, type = "points", values = 1}}},
 
	[16] = {questStarted = 1525, questStorage = 65015, killsRequired = 70, raceName = "Lich Banes", rewards = {{enable = true, type = "exp", values = 7000}, {enable = true, type = "points", values = 1}}},
 
	[17] = {questStarted = 1526, questStorage = 65016, killsRequired = 200, raceName = "Molten Golems", rewards = {{enable = true, type = "exp", values = 10000}, {enable = true, type = "boss", values = ESMERALDA_POSITION}, {enable = true, type = "points", values = 2}}},
 
	[18] = {questStarted = 1527, questStorage = 65017, killsRequired = 200, raceName = "Vipers", rewards = {{enable = true, type = "exp", values = 5000}, {enable = true, type = "boss", values = THEOLDWIDOW_POSITION}, {enable = true, type = "points", values = 2}}},
 
	[19] = {questStarted = 1528, questStorage = 65018, killsRequired = 250, raceName = "King Kongs", rewards = {{enable = true, type = "boss", values = THEMANY_POSITION}, {enable = true, type = "points", values = 4}}},
 
	[20] = {questStarted = 1529, questStorage = 65019, killsRequired = 250, raceName = "Death Reapers", rewards = {{enable = true, type = "boss", values = LEVIATHAN_POSITION}, {enable = true, type = "points", values = 4}}},
 
	[21] = {questStarted = 1530, questStorage = 65020, killsRequired = 300, raceName = "Elder Wizards", rewards = {{enable = true, type = "boss", values = STONECRACKER_POSITION}, {enable = true, type = "points", values = 4}}},
 
	[22] = {questStarted = 1531, questStorage = 65021, killsRequired = 500, raceName = "Lost Mages", rewards = {{enable = true, type = "teleport", values = THENOXIUSSPAWN_POSITION}, {enable = true, type = "points", values = 4}}},
 
	[23] = {questStarted = 1532, questStorage = 65022, killsRequired = 5, raceName = "Orshabaals", rewards = {{enable = true, type = "exp", values = 10000}, {enable = true, type = "money", values = 5000}, {enable = true, type = "boss", values = MERIKHTHESLAUGHTERER_POSITION}}},
 
	[24] = {questStarted = 1533, questStorage = 65023, killsRequired = 500, raceName = "Blue Djinns", rewards = {{enable = true, type = "exp", values = 10000}, {enable = true, type = "money", values = 5000}, {enable = true, type = "boss", values = FAHIMTHEWISE_POSITION}}},
 
	[25] = {questStarted = 1534, questStorage = 65024, killsRequired = 100, raceName = "Pirates", rewards = {{enable = true, type = "exp", values = 10000}, {enable = true, type = "money", values = 5000}, {enable = true, type = "boss", values = RANDOMPIRATEBOSS_POSITION}}},
 
	[26] = {questStarted = 1535, questStorage = 65025, killsRequired = 20, raceName = "Goliaths", rewards = {{enable = true, type = "exp", values = 10000}, {enable = true, type = "money", values = 5000}}},
 
	[27] = {questStarted = 1536, questStorage = 65026, killsRequired = 100, raceName = "Elite Hunters", rewards = {{enable = true, type = "boss", values = THEHORNEDFOX_POSITION}}},
 
	[28] = {questStarted = 1537, questStorage = 65027, killsRequired = 100, raceName = "Islanders", rewards = {{enable = true, type = "boss", values = NECROPHARUS_POSITION}}},
 
	[29] = {questStarted = 1538, questStorage = 65028, killsRequired = 1, raceName = "Ferumbras", rewards = {{enable = true, type = "exp", values = 40000}}},
	
	[30] = {questStarted = 1539, questStorage = 65029, killsRequired = 50, raceName = "Succubus", rewards = {{enable = true, type = "exp", values = 40000}}},
	
	[31] = {questStarted = 1540, questStorage = 65030, killsRequired = 50, raceName = "Devanagari", rewards = {{enable = true, type = "exp", values = 40000}}},
	
	[32] = {questStarted = 1541, questStorage = 65031, killsRequired = 50, raceName = "Azreal", rewards = {{enable = true, type = "exp", values = 40000}}},
		
	[33] = {questStarted = 1542, questStorage = 65032, killsRequired = 50, raceName = "Kelpie", rewards = {{enable = true, type = "exp", values = 40000}}},
			
	[34] = {questStarted = 1543, questStorage = 65033, killsRequired = 50, raceName = "Thing", rewards = {{enable = true, type = "exp", values = 40000}}},
 
	[35] = {questStarted = 1544, questStorage = 65034, killsRequired = 6666, raceName = "Beelzebub", rewards = {{enable = true, type = "storage", values = {65535, 1}}}}
}
 
local rankStorage = 32150
local choose = {}
 
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 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 msgcontains(msg, "task") 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 = "Number  -  Name"
		for i = 1, table.maxn(tasks) do
			text = text .. "\n" .. i .. "  -  " .. tasks[i].raceName .. (getCreatureStorage(cid, tasks[i].questStarted) == 2 and " [Done]" or "")
		end
		doShowTextDialog(cid, 5956, text)
 
	elseif tasks[msg] then
		msg = tonumber(msg)
		if getCreatureStorage(cid, tasks[msg].questStarted) == 1 then
			selfSay("You are already making this task.", cid)
			talkState[talkUser] = 0
			return true
		end
		if getCreatureStorage(cid, tasks[msg].questStarted) == 2 then
			selfSay("You already finished this task.", cid)
			talkState[talkUser] = 0
			return true
		end
		if 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
			return true
		end
		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
	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
 
	elseif msgcontains(msg, "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 tell me the name of the task that do you want to report."
			selfSay(response, cid)
		else
			selfSay("You need to start at least one task first.", cid)
		end
	elseif getTaskByName(msg) then
		local t = getTaskByName(msg)
		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[i].enable) then
				if isInArray({"boss", "teleport", 1}, tasks[t].rewards[i].type) then
					doTeleportThing(cid, tasks[t].rewards[i].values)
				elseif isInArray({"exp", "experience", 2}, tasks[t].rewards[i].type) then
					doPlayerAddExperience(cid, tasks[t].rewards[i].values)
				elseif isInArray({"item", 3}, tasks[t].rewards[i].type) then
					doPlayerAddItem(cid, v.rewards[i].values[1], tasks[t].rewards[i].values[2])
				elseif isInArray({"money", 4}, tasks[t].rewards[i].type) then
					doPlayerAddMoney(cid, tasks[t].rewards[i].values)
				elseif isInArray({"storage", "stor", 5}, tasks[t].rewards[i].type) then
					doCreatureSetStorage(cid, tasks[t].rewards[i].values[1], tasks[t].rewards[i].values[2])
				elseif isInArray({"points", "rank", 2}, tasks[t].rewards[i].type) then
					doCreatureSetStorage(cid, rankStorage, getCreatureStorage(cid, rankStorage) + tasks[t].rewards[i].values)
				else
					print("[Warning - Error::Killing in the name of::Tasks config] Bad reward type: " .. tasks[t].rewards[i].type .. ", 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)
		doCreatureSetStorage(cid, tasks[t].questStarted, 2)
	end
	return true
end
 
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

Creaturescripts file
Lua:
local questCreatures =
{
	["rotworm"] = {questStarted = 1510, questStorage = 65000, creatureStorage = 15000, killsRequired = 100, raceName = "Rotworms"},
	["carrion worm"] = {questStarted = 1510, questStorage = 65000, creatureStorage = 15001, killsRequired = 100, raceName = "Rotworms"},
 
	["wyvern"] = {questStarted = 1511, questStorage = 65001, creatureStorage = 15002, killsRequired = 150, raceName = "Wyverns"},
	 
	["vampire"] = {questStarted = 1512, questStorage = 65002, creatureStorage = 15003, killsRequired = 300, raceName = "Vampires"},
	["vampire bride"] = {questStarted = 1512, questStorage = 65002, creatureStorage = 15004, killsRequired = 300, raceName = "Vampires"},
 
	["souleater"] = {questStarted = 1513, questStorage = 65003, creatureStorage = 15005, killsRequired = 200, raceName = "Souleaters"},
	 
	["hydra"] = {questStarted = 1514, questStorage = 65004, creatureStorage = 15006, killsRequired = 300, raceName = "Hydras"},
 
	["nightmare"] = {questStarted = 1515, questStorage = 65005, creatureStorage = 15007, killsRequired = 300, raceName = "Nightmares"},
 
	["hellspawn"] = {questStarted = 1516, questStorage = 65006, creatureStorage = 15008, killsRequired = 75, raceName = "Hellspawns"},
 
	["lizard legionare"] = {questStarted = 1517, questStorage = 65007, creatureStorage = 15009, killsRequired = 500, raceName = "Lizards"},
    ["lizard high guard"] = {questStarted = 1517, questStorage = 65007, creatureStorage = 15020, killsRequired = 500, raceName = "Lizards"},
	["lizard chosen"] = {questStarted = 1517, questStorage = 65007, creatureStorage = 15021, killsRequired = 500, raceName = "Lizards"},
	["lizard dragon priest"] = {questStarted = 1517, questStorage = 65007, creatureStorage = 15022, killsRequired = 500, raceName = "Lizards"},
	["lizard zaogun"] = {questStarted = 1517, questStorage = 65007, creatureStorage = 15023, killsRequired = 500, raceName = "Lizards"},
 
	["draken warmaster"] = {questStarted = 1518, questStorage = 65008, creatureStorage = 15024, killsRequired = 300, raceName = "Drakens"},
 	["draken spellweaver"] = {questStarted = 1518, questStorage = 65008, creatureStorage = 15025, killsRequired = 300, raceName = "Drakens"},
	["draken abomonation"] = {questStarted = 1518, questStorage = 65008, creatureStorage = 15026, killsRequired = 300, raceName = "Drakens"},
	["draken conqueror"] = {questStarted = 1518, questStorage = 65008, creatureStorage = 15027, killsRequired = 300, raceName = "Drakens"},
	["draken elite"] = {questStarted = 1518, questStorage = 65008, creatureStorage = 15028, killsRequired = 300, raceName = "Drakens"},
 
	["undead jester"] = {questStarted = 1519, questStorage = 65009, creatureStorage = 15029, killsRequired = 300, raceName = "Undead Jesters"},
 
	["quagmire"] = {questStarted = 1520, questStorage = 65010, creatureStorage = 15030, killsRequired = 300, raceName = "Quagmires"},
	 
	["elf occulist"] = {questStarted = 1521, questStorage = 65011, creatureStorage = 15031, killsRequired = 300, raceName = "Elves"},
	["elfin"] = {questStarted = 1521, questStorage = 65011, creatureStorage = 15032, killsRequired = 300, raceName = "Elves"},
	["elf vanguard"] = {questStarted = 1521, questStorage = 65011, creatureStorage = 15033, killsRequired = 300, raceName = "Elves"},
 
	["hellhound"] = {questStarted = 1522, questStorage = 65012, creatureStorage = 15034, killsRequired = 150, raceName = "Hellhounds"},
 
	["grim reaper"] = {questStarted = 1523, questStorage = 65013, creatureStorage = 15035, killsRequired = 350, raceName = "Grim Reapers"},
	 
	["tarragon"] = {questStarted = 1524, questStorage = 65014, creatureStorage = 15036, killsRequired = 100, raceName = "Tarragons"},
	 
	["lich bane"] = {questStarted = 1525, questStorage = 65015, creatureStorage = 15037, killsRequired = 150, raceName = "Lich Banes"},
	 
	["molten golem"] = {questStarted = 1526, questStorage = 65016, creatureStorage = 15038, killsRequired = 200, raceName = "Molten Golems"},
 
	["viper"] = {questStarted = 1527, questStorage = 65017, creatureStorage = 15039, killsRequired = 200, raceName = "Vipers"},
 
	["king kong"] = {questStarted = 1528, questStorage = 65018, creatureStorage = 15040, killsRequired = 250, raceName = "King Kongs"},
 
	["death reaper"] = {questStarted = 1529, questStorage = 65019, creatureStorage = 15041, killsRequired = 250, raceName = "Death Reaper"},
 
	["elder wizard"] = {questStarted = 1530, questStorage = 65020, creatureStorage = 15042, killsRequired = 300, raceName = "Elder Wizards"},
 
	["lost mage"] = {questStarted = 1531, questStorage = 65021, creatureStorage = 15043, killsRequired = 500, raceName = "Lost Mages"},
 
	["orshabaal"] = {questStarted = 1532, questStorage = 65022, creatureStorage = 15044, killsRequired = 10, raceName = "Orshabaal"},
 
	["hesiod"] = {questStarted = 1533, questStorage = 65023, creatureStorage = 15046, killsRequired = 50, raceName = "Hesiods"},
 
	["pirate ravager"] = {questStarted = 1534, questStorage = 65024, creatureStorage = 15046, killsRequired = 200, raceName = "Pirates"},
	["picaroon"] = {questStarted = 1534, questStorage = 65024, creatureStorage = 15047, killsRequired = 200, raceName = "Pirates"},
	["long john silver"] = {questStarted = 1534, questStorage = 65024, creatureStorage = 15048, killsRequired = 200, raceName = "Pirates"},
	["black beard"] = {questStarted = 1534, questStorage = 65024, creatureStorage = 15049, killsRequired = 200, raceName = "Pirates"},
	["pirate marauder"] = {questStarted = 1534, questStorage = 65024, creatureStorage = 15050, killsRequired = 200, raceName = "Pirates"},
	["pirate skeleton"] = {questStarted = 1534, questStorage = 65024, creatureStorage = 15051, killsRequired = 200, raceName = "Pirates"},
 
	["goliath"] = {questStarted = 1535, questStorage = 65025, creatureStorage = 15052, killsRequired = 30, raceName = "Goliaths"},
	 
	["elite hunter"] = {questStarted = 1536, questStorage = 65026, creatureStorage = 15053, killsRequired = 100, raceName = "Elite Hunters"},
 
	["islander"] = {questStarted = 1537, questStorage = 65027, creatureStorage = 15054, killsRequired = 4000, raceName = "Islanders"},
 
	["ferumbras"] = {questStarted = 1538, questStorage = 65028, creatureStorage = 15055, killsRequired = 1, raceName = "Ferumbras"},
	 
	["succubus"] = {questStarted = 1539, questStorage = 65029, creatureStorage = 15056, killsRequired = 50, raceName = "Succubus"},
	
	["devagari"] = {questStarted = 1540, questStorage = 65030, creatureStorage = 15057, killsRequired = 50, raceName = "Devagari"},
	
	["azreal"] = {questStarted = 1541, questStorage = 65031, creatureStorage = 15058, killsRequired = 50, raceName = "Azreal"},
	
	["kelpie"] = {questStarted = 1542, questStorage = 65032, creatureStorage = 15059, killsRequired = 50, raceName = "Kelpie"},
	
	["thing"] = {questStarted = 1543, questStorage = 65033, creatureStorage = 15060, killsRequired = 50, raceName = "Thing"},
		
	["beelzebub"] = {questStarted = 1544, questStorage = 65034, creatureStorage = 15061, killsRequired = 6666, raceName = "Beelzebub"},
}
 
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

So I go on a normal char and try the new monsters:
22:14 Grizzly Adams: There you can see the following tasks, please tell me the number of the task that you want to do.
22:14 Suss [75]: rotworms
22:14 Grizzly Adams: You don't have started this task.

Also, I've completed task 1&2 when they were Trolls and Goblins on another char.. (Vampires is the 3rd task) now this happens:

22:13 Grizzly Adams: There you can see the following tasks, please tell me the number of the task that you want to do.
22:13 Mark [999]: vampires
22:13 Grizzly Adams: You don't have started this task.


What have I got wrong here?
I've probably made a noob mistake knowing me..
 
how do you change the number of times you can do each task? and how would i make it so if you die by boss u can do it again?
 
I edited this script for Mystic Spirit 9.31. Thanks for the release!
 
Back
Top