• 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 [CreatureEvent/Npc] Killing in the name of... [All monsters, all tasks with rewards]

I get this error
Code:
[28/08/2010 00:52:13] [Error - LuaScriptInterface::loadFile] data/creaturescripts/scripts/killinginthenameof.lua:136: 'end' expected (to close 'function' at line 113) near '<eof>'
[28/08/2010 00:52:13] [Warning - Event::loadScript] Cannot load script (data/creaturescripts/scripts/killinginthenameof.lua)
[28/08/2010 00:52:13] data/creaturescripts/scripts/killinginthenameof.lua:136: 'end' expected (to close 'function' at line 113) near '<eof>'
 
I keep getting this error on my server when I try todo the quest

[14/09/2010 17:27:38] data/npc/scripts/quest.lua:80: attempt to call global 'getCreatureStorage' (a nil value)
[14/09/2010 17:27:38] stack traceback:
[14/09/2010 17:27:38] data/npc/scripts/quest.lua:80: in function 'callback'
[14/09/2010 17:27:38] data/npc/lib/npcsystem/npchandler.lua:383: in function 'onCreatureSay'
[14/09/2010 17:27:38] data/npc/scripts/quest.lua:75: in function <data/npc/scripts/quest.lua:75>
 
Actually there is a problem - when you are supposed to go kill boss - after you kill the boss - it allows the person to spam reward over and over and over again to get more reward. Any ideas about this bug?
 
Actually there is a problem - when you are supposed to go kill boss - after you kill the boss - it allows the person to spam reward over and over and over again to get more reward. Any ideas about this bug?

Please explain better

@Xoriak?

Your distro don't have the functions "getCreatureStorage" and "doCreatureSetStorage", change it to "getPlayerStorageValue" and "doPlayerSetStorageValue"
 
I'm trying really hard to make it work, but no success until now.

Problem: When I kill a monster (e.g Troll), the counting of killed monsters won't change, like this:

Grizzly Adams: Current 0 Trolls killed, you need to kill 100.

I have read every single post of this thread, tried all solutions but nothing seems to work.

Distro: 01:55 The Forgotten Server, version 0.3_SVN (Crying Damson)
01:55 Compiled at: Aug 20 2010, 20:38:35.

All scripts and lines in the main page are here, I have changed somethings trying to fix (E.g onDeath instead of onKill), but I've put the original files back again

So, I tried a different combinations of names in monsters.xml and in the scripts (lower case etc), it didn't worked...

I really don't know what might be happening, if someone have any idea I would be grateful

PS: If someone want to see an specific file of me, just ask

Thanks a lot, great script darkhaos!
 
Do you've registered the event at login.lua? also have you asked for the task?

I tested all the scripts, all the tasks in TFS 0.3.6PL1 and works perfect.

Are you getting errors at console?
 
Do you've registered the event at login.lua? also have you asked for the task?

I tested all the scripts, all the tasks in TFS 0.3.6PL1 and works perfect.

Are you getting errors at console?

Yes, I have asked for the task, I have registered entries at login.lua and I'm not receiving any error on console

It's really a mistery lol, I'll continue trying tomorrow and tell here if I succeed

Thanks for your attemption
 
hmm, no luck 'til now

I have done everything correctly, BUT I have tried other scripts like this before, it might be causing an malfunction dtk

Here's my files:

creaturescripts/scripts/killinginthenameof.lua (Default, as in the first page, changed nothing here)
Lua:
local questCreatures =
{
	["troll"] = {questStarted = 1510, questStorage = 65000, creatureStorage = 15000, killsRequired = 100, raceName = "Trolls"},
	["frost troll"] = {questStarted = 1510, questStorage = 65000, creatureStorage = 15001, killsRequired = 100, raceName = "Trolls"},
	["furious troll"] = {questStarted = 1510, questStorage = 65000, creatureStorage = 15002, killsRequired = 100, raceName = "Trolls"},
	["island troll"] = {questStarted = 1510, questStorage = 65000, creatureStorage = 15003, killsRequired = 100, raceName = "Trolls"},
	["swamp troll"] = {questStarted = 1510, questStorage = 65000, creatureStorage = 15004, killsRequired = 100, raceName = "Trolls"},
	["troll champion"] = {questStarted = 1510, questStorage = 65000, creatureStorage = 15005, killsRequired = 100, raceName = "Trolls"},
	["troll legionnaire"] = {questStarted = 1510, questStorage = 65000, creatureStorage = 15006, killsRequired = 100, raceName = "Trolls"},
 
	["goblin"] = {questStarted = 1511, questStorage = 65001, creatureStorage = 15007, killsRequired = 150, raceName = "Goblins"},
	["goblin assassin"] = {questStarted = 1511, questStorage = 65001, creatureStorage = 15008, killsRequired = 150, raceName = "Goblins"},
	["goblin leader"] = {questStarted = 1511, questStorage = 65001, creatureStorage = 15009, killsRequired = 150, raceName = "Goblins"},
	["goblin scavenger"] = {questStarted = 1511, questStorage = 65001, creatureStorage = 15010, killsRequired = 150, raceName = "Goblins"},
 
	["rotworm"] = {questStarted = 1512, questStorage = 65002, creatureStorage = 15011, killsRequired = 300, raceName = "Rotworms"},
	["carriom worm"] = {questStarted = 1512, questStorage = 65002, creatureStorage = 15012, killsRequired = 300, raceName = "Rotworms"},
 
	["cyclops"] = {questStarted = 1513, questStorage = 65003, creatureStorage = 15013, killsRequired = 500, raceName = "Cyclops"},
	["cyclops smith"] = {questStarted = 1513, questStorage = 65003, creatureStorage = 15014, killsRequired = 500, raceName = "Cyclops"},
	["cyclops drone"] = {questStarted = 1513, questStorage = 65003, creatureStorage = 15015, killsRequired = 500, raceName = "Cyclops"},
 
 
	["crocodile"] = {questStarted = 1514, questStorage = 65004, creatureStorage = 15016, killsRequired = 300, raceName = "Crocodiles"},
 
	["tarantula"] = {questStarted = 1515, questStorage = 65005, creatureStorage = 15017, killsRequired = 300, raceName = "Tarantulas"},
 
	["carniphila"] = {questStarted = 1516, questStorage = 65006, creatureStorage = 15018, killsRequired = 150, raceName = "Carniphilas"},
 
	["stone golem"] = {questStarted = 1517, questStorage = 65007, creatureStorage = 15019, killsRequired = 200, raceName = "Stone Golems"},
 
	["mammoth"] = {questStarted = 1518, questStorage = 65008, creatureStorage = 15020, killsRequired = 300, raceName = "Mammoths"},
 
	["ice golem"] = {questStarted = 1519, questStorage = 65009, creatureStorage = 15021, killsRequired = 300, raceName = "Ice Golems"},
 
	["quara predator scout"] = {questStarted = 1520, questStorage = 65010, creatureStorage = 15022, killsRequired = 300, raceName = "Quaras Scout"},
	["quara constrictor scout"] = {questStarted = 1520, questStorage = 65010, creatureStorage = 15023, killsRequired = 300, raceName = "Quaras Scout"},
	["quara hydromancer scout"] = {questStarted = 1520, questStorage = 65010, creatureStorage = 15024, killsRequired = 300, raceName = "Quaras Scout"},
	["quara mantassin scout"] = {questStarted = 1520, questStorage = 65010, creatureStorage = 15025, killsRequired = 300, raceName = "Quaras Scout"},
	["quara pincher scout"] = {questStarted = 1520, questStorage = 65010, creatureStorage = 15026, killsRequired = 300, raceName = "Quaras Scout"},
 
	["quara predator"] = {questStarted = 1521, questStorage = 65011, creatureStorage = 15027, killsRequired = 300, raceName = "Quaras"},
	["quara constrictor"] = {questStarted = 1521, questStorage = 65011, creatureStorage = 15028, killsRequired = 300, raceName = "Quaras"},
	["quara hydromancer"] = {questStarted = 1521, questStorage = 65011, creatureStorage = 15029, killsRequired = 300, raceName = "Quaras"},
	["quara mantassin"] = {questStarted = 1521, questStorage = 65011, creatureStorage = 15030, killsRequired = 300, raceName = "Quaras"},
	["quara pincher"] = {questStarted = 1521, questStorage = 65011, creatureStorage = 15031, killsRequired = 300, raceName = "Quaras"},
 
	["water elemental"] = {questStarted = 1522, questStorage = 65012, creatureStorage = 15032, killsRequired = 70, raceName = "Water Elementals"},
	["roaring water elemental"] = {questStarted = 1522, questStorage = 65012, creatureStorage = 15033, killsRequired = 70, raceName = "Water Elementals"},
	["slick water elemental"] = {questStarted = 1522, questStorage = 65012, creatureStorage = 15034, killsRequired = 70, raceName = "Water Elementals"},
	["massive water elemental"] = {questStarted = 1522, questStorage = 65012, creatureStorage = 15035, killsRequired = 70, raceName = "Water Elementals"},
 
	["earth elemental"] = {questStarted = 1523, questStorage = 65013, creatureStorage = 15036, killsRequired = 70, raceName = "Earth Elementals"},
	["jagged earth elemental"] = {questStarted = 1523, questStorage = 65013, creatureStorage = 15037, killsRequired = 70, raceName = "Earth Elementals"},
	["massive earth elemental"] = {questStarted = 1523, questStorage = 65013, creatureStorage = 15038, killsRequired = 70, raceName = "Earth Elementals"},
	["muddy earth elemental"] = {questStarted = 1523, questStorage = 65013, creatureStorage = 15039, killsRequired = 70, raceName = "Earth Elementals"},
 
	["energy elemental"] = {questStarted = 1524, questStorage = 65014, creatureStorage = 15040, killsRequired = 70, raceName = "Energy Elementals"},
	["charged energy elemental"] = {questStarted = 1524, questStorage = 65014, creatureStorage = 15041, killsRequired = 70, raceName = "Energy Elementals"},
	["massive energy elemental"] = {questStarted = 1524, questStorage = 65014, creatureStorage = 15042, killsRequired = 70, raceName = "Energy Elementals"},
	["overcharged energy elemental"] = {questStarted = 1524, questStorage = 65014, creatureStorage = 15043, killsRequired = 70, raceName = "Energy Elementals"},
 
	["fire elemental"] = {questStarted = 1525, questStorage = 65015, creatureStorage = 15044, killsRequired = 70, raceName = "Fire Elementals"},
	["blazing fire elemental"] = {questStarted = 1525, questStorage = 65015, creatureStorage = 15045, killsRequired = 70, raceName = "Fire Elementals"},
	["blistering fire elemental"] = {questStarted = 1525, questStorage = 65015, creatureStorage = 15046, killsRequired = 70, raceName = "Fire Elementals"},
	["massive fire elemental"] = {questStarted = 1525, questStorage = 65015, creatureStorage = 15047, killsRequired = 70, raceName = "Fire Elementals"},
 
	["mutated rat"] = {questStarted = 1526, questStorage = 65016, creatureStorage = 15048, killsRequired = 200, raceName = "Mutated Rats"},
 
	["giant spider"] = {questStarted = 1527, questStorage = 65017, creatureStorage = 15049, killsRequired = 500, raceName = "Giant Spiders"},
 
	["hydra"] = {questStarted = 1528, questStorage = 65018, creatureStorage = 15050, killsRequired = 2000, raceName = "Hydras"},
 
	["sea serpent"] = {questStarted = 1529, questStorage = 65019, creatureStorage = 15051, killsRequired = 2000, raceName = "Sea Serpents"},
 
	["behemoth"] = {questStarted = 1530, questStorage = 65020, creatureStorage = 15052, killsRequired = 2000, raceName = "Behemoths"},
 
	["serpent spawn"] = {questStarted = 1531, questStorage = 65021, creatureStorage = 15053, killsRequired = 1500, raceName = "Serpents Spawn"},
 
	["green djinn"] = {questStarted = 1532, questStorage = 65022, creatureStorage = 15054, killsRequired = 500, raceName = "Green Djinns"},
	["efreet"] = {questStarted = 1532, questStorage = 65022, creatureStorage = 15055, killsRequired = 500, raceName = "Green Djinns"},
 
	["blue djinn"] = {questStarted = 1533, questStorage = 65023, creatureStorage = 15056, killsRequired = 500, raceName = "Blue Djinns"},
	["marid"] = {questStarted = 1533, questStorage = 65023, creatureStorage = 15057, killsRequired = 500, raceName = "Blue Djinns"},
 
	["pirate buccaneer"] = {questStarted = 1534, questStorage = 65024, creatureStorage = 15058, killsRequired = 3000, raceName = "Pirates"},
	["pirate corsair"] = {questStarted = 1534, questStorage = 65024, creatureStorage = 15059, killsRequired = 3000, raceName = "Pirates"},
	["pirate cutthroat"] = {questStarted = 1534, questStorage = 65024, creatureStorage = 15060, killsRequired = 3000, raceName = "Pirates"},
	["pirate ghost"] = {questStarted = 1534, questStorage = 65024, creatureStorage = 15061, killsRequired = 3000, raceName = "Pirates"},
	["pirate marauder"] = {questStarted = 1534, questStorage = 65024, creatureStorage = 15062, killsRequired = 3000, raceName = "Pirates"},
	["pirate skeleton"] = {questStarted = 1534, questStorage = 65024, creatureStorage = 15063, killsRequired = 3000, raceName = "Pirates"},
 
	["pirate buccaneer"] = {questStarted = 1535, questStorage = 65025, creatureStorage = 15064, killsRequired = 3000, raceName = "Pirates"},
	["pirate corsair"] = {questStarted = 1535, questStorage = 65025, creatureStorage = 15065, killsRequired = 3000, raceName = "Pirates"},
	["pirate cutthroat"] = {questStarted = 1535, questStorage = 65025, creatureStorage = 15066, killsRequired = 3000, raceName = "Pirates"},
	["pirate ghost"] = {questStarted = 1535, questStorage = 65025, creatureStorage = 15067, killsRequired = 3000, raceName = "Pirates"},
	["pirate marauder"] = {questStarted = 1535, questStorage = 65025, creatureStorage = 15068, killsRequired = 3000, raceName = "Pirates"},
	["pirate skeleton"] = {questStarted = 1535, questStorage = 65025, creatureStorage = 15069, killsRequired = 3000, raceName = "Pirates"},
 
	["minotaur"] = {questStarted = 1536, questStorage = 65026, creatureStorage = 15070, killsRequired = 5000, raceName = "Minotaurs"},
 
	["necromancer"] = {questStarted = 1537, questStorage = 65027, creatureStorage = 15071, killsRequired = 4000, raceName = "Magicians"},
	["priestess"] = {questStarted = 1537, questStorage = 65027, creatureStorage = 15072, killsRequired = 4000, raceName = "Magicians"},
 
	["necromancer"] = {questStarted = 1538, questStorage = 65028, creatureStorage = 15073, killsRequired = 1000, raceName = "Magicians"},
	["priestess"] = {questStarted = 1538, questStorage = 65028, creatureStorage = 15074, killsRequired = 1000, raceName = "Magicians"},
 
	["demon"] = {questStarted = 1539, questStorage = 65029, creatureStorage = 15075, killsRequired = 6666, raceName = "Demons"}
}
 
local msgType = MESSAGE_STATUS_CONSOLE_ORANGE
 
function onKill(cid, target, lastHit)
 
local creature = questCreatures[getCreatureName(target):lower()]
 
	if creature then
		if isPlayer(target) then
			return true
		end
		if getCreatureStorage(cid, creature.questStarted) > 0 then
			if getCreatureStorage(cid, creature.questStorage) < creature.killsRequired then
				if getCreatureStorage(cid, creature.questStorage) < 0 then
					doCreatureSetStorage(cid, creature.questStorage, 0)
				end
 
				if getCreatureStorage(cid, creature.creatureStorage) < 0 then
					doCreatureSetStorage(cid, creature.creatureStorage, 0)
				end
				doCreatureSetStorage(cid, creature.questStorage, getCreatureStorage(cid, creature.questStorage) + 1)
				doCreatureSetStorage(cid, creature.creatureStorage, getCreatureStorage(cid, creature.creatureStorage) + 1)
				doPlayerSendTextMessage(cid, msgType, "" .. getCreatureStorage(cid, creature.creatureStorage) .. " " .. getCreatureName(target) .. " defeated. Total [" .. getCreatureStorage(cid, creature.questStorage) .. "/" .. creature.killsRequired .. "] " .. creature.raceName .. ".")
			end
		end
	end
	return true
end

creaturescripts/scripts/login.lua

Lua:
-- This is the configuration
-- The "type" of message to send to the player (default is white(message_status_default)) (types you can check in "global.lua")
SHOP_MSG_TYPE = MESSAGE_STATUS_DEFAULT
-- time (in seconds) between connections to SQL database by iPACC
SQL_interval = 60
-- Do not change this.
SQL_COMUNICATION_INTERVAL = SQL_interval * 1000

local config = {
	loginMessage = getConfigValue('loginMessage'),
	useFragHandler = getBooleanFromString(getConfigValue('useFragHandler'))
}

function onLogin(cid)
	if(InitShopComunication == 0) then
		local eventServ = addEvent(sql_communication, SQL_COMUNICATION_INTERVAL, {})
		InitShopComunication = eventServ
	end
accountManager = "Account Manager"                       
managerCounter = 0

   for i, player in ipairs(getOnlinePlayers()) do
      if accountManager:lower() == player:lower() then             
      managerCounter = managerCounter + 1
      end 
   end
 
   if managerCounter >= 3 then
      return false
   end
	local loss = getConfigValue('deathLostPercent')
	if(loss ~= nil) then
		doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, loss * 10)
	end

	local accountManager = getPlayerAccountManager(cid)
	if(accountManager == MANAGER_NONE) then
		local lastLogin, str = getPlayerLastLoginSaved(cid), config.loginMessage
		if(lastLogin > 0) then
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
			str = "Your last visit was on " .. os.date("%a %b %d %X %Y", lastLogin) .. "."
		else
			str = str .. " Please choose your outfit."
			doPlayerSendOutfitWindow(cid)
		end

		doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
	elseif(accountManager == MANAGER_NAMELOCK) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, it appears that your character has been namelocked, what would you like as your new name?")
	elseif(accountManager == MANAGER_ACCOUNT) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to manage your account and if you want to start over then type 'cancel'.")
	else
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to create an account or type 'recover' to recover an account.")
	end

	if(not isPlayerGhost(cid)) then
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
	end
	registerCreatureEvent(cid, "VipCheck")

	registerCreatureEvent(cid, "Mail")
	registerCreatureEvent(cid, "GuildMotd")

	registerCreatureEvent(cid, "Idle")
	if(config.useFragHandler) then
		registerCreatureEvent(cid, "SkullCheck")
	end

registerCreatureEvent(cid, "KillingInTheNameOf")
registerCreatureEvent(cid, "ReportBug")
registerCreatureEvent(cid, "AdvanceSave")
registerCreatureEvent(cid, "attackguild")	
registerCreatureEvent(cid, "advance")
registerCreatureEvent(cid, "FimVip")
registerCreatureEvent(cid, "SkullCheck")
registerCreatureEvent(cid, "demonOakLogout")
registerCreatureEvent(cid, "demonOakDeath")
registerCreatureEvent(cid, "ReportBug")
registerCreatureEvent(cid, "VipReceive")
registerCreatureEvent(cid, "PlayerKill")
registerCreatureEvent(cid, "PythiusDead")

    if (InitArenaScript ~= 0) then
    InitArenaScript = 1

        for i = 42300, 42309 do
            setGlobalStorageValue(i, 0)
            setGlobalStorageValue(i+100, 0)
        end
    end

    if getPlayerStorageValue(cid, 42309) < 1 then
        for i = 42300, 42309 do
            setPlayerStorageValue(cid, i, 0)
        end
    end

    if getPlayerStorageValue(cid, 42319) < 1 then
        for i = 42310, 42319 do
            setPlayerStorageValue(cid, i, 0)
        end
    end

    if getPlayerStorageValue(cid, 42329) < 1 then
        for i = 42320, 42329 do
            setPlayerStorageValue(cid, i, 0)
        end
    end
    if getPlayerStorageValue(cid, 42355) == -1 then
        setPlayerStorageValue(cid, 42355, 0)
    end
    setPlayerStorageValue(cid, 42350, 0)
    setPlayerStorageValue(cid, 42352, 0)
	registerCreatureEvent(cid, "Bossy")  
return true
end
if getPlayerVipDays(cid) > 0 then
setPlayerStorageValue(cid, 20500, 1)
 
elseif getPlayerStorageValue(cid, 20500) == 1 and getPlayerVipDays(cid) == 0 then
doTeleportThing(cid, getTownTemplePosition(2))
doPlayerSetTown(cid, 2)
setPlayerStorageValue(cid, 20500, -1)
end
function sql_communication(parameters)
	local result_plr = db.getResult("SELECT * FROM z_ots_comunication WHERE `type` = 'login';")
	if(result_plr:getID() ~= -1) then
		while(true) do
			id = tonumber(result_plr:getDataInt("id"))
            		action = tostring(result_plr:getDataString("action"))
			delete = tonumber(result_plr:getDataInt("delete_it"))
			cid = getPlayerByName(tostring(result_plr:getDataString("name")))
			if isPlayer(cid) == TRUE then
				if action == 'give_item' then
					local itemtogive_id = tonumber(result_plr:getDataInt("param1"))
					local itemtogive_count = tonumber(result_plr:getDataInt("param2"))
					local container_id = tonumber(result_plr:getDataInt("param3"))
					local container_count = tonumber(result_plr:getDataInt("param4"))
					local add_item_type = tostring(result_plr:getDataString("param5"))
					local add_item_name = tostring(result_plr:getDataString("param6"))
					local b_head_slot = getPlayerSlotItem(cid, 1)
					local b_necklace_slot = getPlayerSlotItem(cid, 2)
					local b_backpack_slot = getPlayerSlotItem(cid, 3)
					local b_armor_slot = getPlayerSlotItem(cid, 4)
					local b_right_hand = getPlayerSlotItem(cid, 5)
					local b_left_hand = getPlayerSlotItem(cid, 6)
					local b_legs_slot = getPlayerSlotItem(cid, 7)
					local b_feet_slot = getPlayerSlotItem(cid, 8)
					local b_ring_slot = getPlayerSlotItem(cid, 9)
					local b_arrow_slot = getPlayerSlotItem(cid, 10)
					if b_arrow_slot.itemid == 0 or (b_left_hand.itemid == 0 and b_right_hand.itemid == 0) then
						local full_weight = 0
						if add_item_type == 'container' then
							container_weight = getItemWeight(container_id, 1)
							items_weight = container_count * getItemWeight(itemtogive_id, itemtogive_count)
							full_weight = items_weight + container_weight
						else
							full_weight = 1 
						end
						local free_cap = getPlayerFreeCap(cid)
						if add_item_type == 'container' then
								local new_container = doCreateItemEx(container_id)
								local iter = 0
								while iter ~= container_count do
									doAddContainerItem(new_container, itemtogive_id, itemtogive_count)
									iter = iter + 1
								end
								doPlayerAddItemEx(cid, new_container)
								itemtogive_id = container_id
							else
								local addeditem = doPlayerAddItem(cid, itemtogive_id, itemtogive_count)
							end
							local head_slot = getPlayerSlotItem(cid, 1)
							local necklace_slot = getPlayerSlotItem(cid, 2)
							local backpack_slot = getPlayerSlotItem(cid, 3)
							local armor_slot = getPlayerSlotItem(cid, 4)
							local right_hand = getPlayerSlotItem(cid, 5)
							local left_hand = getPlayerSlotItem(cid, 6)
							local legs_slot = getPlayerSlotItem(cid, 7)
							local feet_slot = getPlayerSlotItem(cid, 8)
							local ring_slot = getPlayerSlotItem(cid, 9)
							local arrow_slot = getPlayerSlotItem(cid, 10)
							if ring_slot.itemid == itemtogive_id or feet_slot.itemid == itemtogive_id or legs_slot.itemid == itemtogive_id or armor_slot.itemid == itemtogive_id or necklace_slot.itemid == itemtogive_id or head_slot.itemid == itemtogive_id or arrow_slot.itemid == itemtogive_id or left_hand.itemid == itemtogive_id or right_hand.itemid == itemtogive_id or backpack_slot.itemid == itemtogive_id then
								if b_ring_slot.uid ~= ring_slot.uid or b_feet_slot.uid ~= feet_slot.uid or b_legs_slot.uid ~= legs_slot.uid or b_armor_slot.uid ~= armor_slot.uid or b_necklace_slot.uid ~= necklace_slot.uid or b_head_slot.uid ~= head_slot.uid or b_backpack_slot.uid ~= backpack_slot.uid or b_right_hand.uid ~= right_hand.uid or b_left_hand.uid ~= left_hand.uid or b_arrow_slot.uid ~= arrow_slot.uid then
								doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, 'You received >> '.. add_item_name ..' << from OTS shop. You should re-login now to become sure your new item will not disappear if any error occur.')
								db.executeQuery("DELETE FROM `z_ots_comunication` WHERE `id` = " .. id .. ";")
								db.executeQuery("UPDATE `z_shop_history_item` SET `trans_state`='realized', `trans_real`=" .. os.time() .. " WHERE id = " .. id .. ";")
								else
									doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, '>> '.. add_item_name ..' << from OTS shop not added. Unknown error occured. Wait about '.. SQL_interval ..' seconds. If error will occur again contact with admin. Error item ID is: '.. id ..'')
								end
							else
								doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, '>> '.. add_item_name ..' << from OTS shop not added. Unknown error occured. Wait about '.. SQL_interval ..' seconds. If error will occur again contact with admin. Error item ID is: '.. id ..'')
							end
					else
						doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, '>> '.. add_item_name ..' << from OTS shop is waiting for you. Please take items from both hands or item from arrow slot and wait about '.. SQL_interval ..' seconds to get it.')
					end
				end
			end
            if not(result_plr:next()) then
				break
			end
		end
		result_plr:free()
    end
	local eventServ = addEvent(sql_communication, SQL_COMUNICATION_INTERVAL, parameters)
end

npc/scripts/killinginthenameof.lua (Default, as in the first page, changed nothing here)

Lua:
local tasks =
{
	[1] = {questStarted = 1510, questStorage = 65000, killsRequired = 100, raceName = "Trolls", rewards = {{enable = true, type = "exp", values = 200}, {enable = true, type = "money", values = 200}}},
 
	[2] = {questStarted = 1511, questStorage = 65001, killsRequired = 150, raceName = "Goblins", rewards = {{enable = true, type = "exp", values = 300}, {enable = true, type = "money", values = 250}}},
 
	[3] = {questStarted = 1512, questStorage = 65002, killsRequired = 300, raceName = "Rotworms", rewards = {{enable = true, type = "exp", values = 1000}, {enable = true, type = "money", values = 400}}},
 
	[4] = {questStarted = 1513, questStorage = 65003, killsRequired = 500, raceName = "Cyclops", rewards = {{enable = true, type = "exp", values = 3000}, {enable = true, type = "money", values = 800}}},
 
	[5] = {questStarted = 1514, questStorage = 65004, killsRequired = 300, raceName = "Crocodiles", 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 = "Tarantulas", 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 = 150, raceName = "Carniphilas", rewards = {{enable = true, type = "exp", values = 1500}, {enable = true, type = "points", values = 1}}},
 
	[8] = {questStarted = 1517, questStorage = 65007, killsRequired = 200, raceName = "Stone Golems", rewards = {{enable = true, type = "exp", values = 2000}, {enable = true, type = "points", values = 1}}},
 
	[9] = {questStarted = 1518, questStorage = 65008, killsRequired = 300, raceName = "Mammoths", 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 = "Ice Golems", 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 = "Quaras Scout", rewards = {{enable = true, type = "exp", values = 10000}, {enable = true, type = "points", values = 1}}},
 
	[12] = {questStarted = 1521, questStorage = 65011, killsRequired = 300, raceName = "Quaras", 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 = 70, raceName = "Water Elementals", rewards = {{enable = true, type = "exp", values = 7000}, {enable = true, type = "points", values = 1}}},
 
	[14] = {questStarted = 1523, questStorage = 65013, killsRequired = 70, raceName = "Earth Elementals", rewards = {{enable = true, type = "exp", values = 10000}, {enable = true, type = "points", values = 1}}},
 
	[15] = {questStarted = 1524, questStorage = 65014, killsRequired = 70, raceName = "Energy Elementals", rewards = {{enable = true, type = "exp", values = 10000}, {enable = true, type = "points", values = 1}}},
 
	[16] = {questStarted = 1525, questStorage = 65015, killsRequired = 70, raceName = "Fire Elementals", rewards = {{enable = true, type = "exp", values = 7000}, {enable = true, type = "points", values = 1}}},
 
	[17] = {questStarted = 1526, questStorage = 65016, killsRequired = 200, raceName = "Mutated Rats", 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 = 500, raceName = "Giant Spiders", 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 = 2000, raceName = "Hydras", rewards = {{enable = true, type = "boss", values = THEMANY_POSITION}, {enable = true, type = "points", values = 4}}},
 
	[20] = {questStarted = 1529, questStorage = 65019, killsRequired = 2000, raceName = "Sea Serpents", rewards = {{enable = true, type = "boss", values = LEVIATHAN_POSITION}, {enable = true, type = "points", values = 4}}},
 
	[21] = {questStarted = 1530, questStorage = 65020, killsRequired = 2000, raceName = "Behemoths", rewards = {{enable = true, type = "boss", values = STONECRACKER_POSITION}, {enable = true, type = "points", values = 4}}},
 
	[22] = {questStarted = 1531, questStorage = 65021, killsRequired = 1500, raceName = "Serpents Spawn", rewards = {{enable = true, type = "teleport", values = THENOXIUSSPAWN_POSITION}, {enable = true, type = "points", values = 4}}},
 
	[23] = {questStarted = 1532, questStorage = 65022, killsRequired = 500, raceName = "Green Djinns", 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 = 3000, 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 = 3000, raceName = "Pirates", rewards = {{enable = true, type = "exp", values = 10000}, {enable = true, type = "money", values = 5000}}},
 
	[27] = {questStarted = 1536, questStorage = 65026, killsRequired = 5000, raceName = "Minotaurs", rewards = {{enable = true, type = "boss", values = THEHORNEDFOX_POSITION}}},
 
	[28] = {questStarted = 1537, questStorage = 65027, killsRequired = 4000, raceName = "Magicians", rewards = {{enable = true, type = "boss", values = NECROPHARUS_POSITION}}},
 
	[29] = {questStarted = 1538, questStorage = 65028, killsRequired = 1000, raceName = "Magicians", rewards = {{enable = true, type = "exp", values = 40000}}},
 
	[30] = {questStarted = 1539, questStorage = 65029, killsRequired = 6666, raceName = "Demons", rewards = {{enable = true, type = "storage", values = {65535, 1}}}}
}
 
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) < 0) then
					doCreatureSetStorage(cid, tasks[s].creatureStorage, 0)
				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 task about " .. tasks[s].raceName .. ".", 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 tasks[s].rewards[i].type == "boss" or tasks[s].rewards[i].type == 1 then
							doTeleportThing(cid, tasks[s].rewards[i].values)
						elseif tasks[s].rewards[i].type == "exp" or tasks[s].rewards[i].type == 2 then
							doPlayerAddExperience(cid, tasks[s].rewards[i].values)
						elseif tasks[s].rewards[i].type == "item" or tasks[s].rewards[i].type == 3 then
							doPlayerAddItem(cid, tasks[s].rewards[i].values[1], tasks[s].rewards[i].values[2])
						elseif tasks[s].rewards[i].type == "money" or tasks[s].rewards[i].type == 4 then
							doPlayerAddMoney(cid, tasks[s].rewards[i].values)
						elseif tasks[s].rewards[i].type == "storage" or tasks[s].rewards[i].type == 5 then
							doCreatureSetStorage(cid, tasks[s].rewards[i].values[1], tasks[s].rewards[i].values[2])
						elseif tasks[s].rewards[i].type == "points" or tasks[s].rewards[i].type == 6 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
				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())

npc/grizzly adams.xml (Default, as in the first page, changed nothing here)

Lua:
<?xml version="1.0" encoding="UTF-8"?>
 
<npc name="Grizzly Adams" script="data/npc/scripts/killinginthenameof.lua" access="3" walkinterval="2000" lookdir="2">
	<mana now="800" max="800"/>
	<health now="200" max="200"/>
<look type="144" head="97" body="97" legs="94" feet="97" addons="3"/>
</npc>

creaturescripts/creaturescripts.xml

Lua:
<?xml version="1.0" encoding="UTF-8"?>
<creaturescripts>
	<!-- XTibia.com -->
	<event type="joinchannel" name="GuildMotd" event="script" value="guildmotd.lua"/>
	<event type="receivemail" name="Mail" event="script" value="mail.lua"/>
	<event type="reportbug" name="SaveReportBug" script="reportbug.lua"/>
	<event type="advance" name="AdvanceSave" event="script" value="advancesave.lua"/>
	<event type="think" name="Idle" event="script" value="idle.lua"/>
	<event type="think" name="SkullCheck" event="script" value="skullcheck.lua"/>
	<event type="death" name="PythiusDead" script="pythius_the_rotten.lua" />
	<event type="death" name="monster2" event="script" value="monster2.lua"/>
	<event type="death" name="inquisitionPortals" script="teleports_inquisition.lua"/>

	
	<!-- Custom systems -->
	<event type="kill" name="PlayerKill" event="script" value="arenakill.lua"/>
	<event type="death" name="inquisitionPortals" event="script" value="inquisitionPortals.lua"/>
	<event type="death" name="bluelegs" event="script" value="bluelegs.lua"/>
	<event type="death" name="PlayerDeath" event="script" value="playerdeath.lua"/>
	<event type="attack" name="AttackGuild" script="attackguild.lua"/>
	<event type="logout" name="demonOakLogout" event="script" value="demonOakLogout.lua"/>
	<event type="death" name="demonOakDeath" event="script" value="demonOakDeath.lua"/> 
	<event type="death" name="Azerus" event="script" value="azerus.lua"/>  
	<event type="kill" name="KillingInTheNameOf" event="script" value="killinginthenameof.lua"/>
	<event type="login" name="VipCheck" event="script" value="vipcheck.lua"/>
</creaturescripts>

Solutions I've tried so far:

Change troll to Troll
Change onKill to onDeath, also on creaturescripts.xml
Created some new characters for testing, dtk if slot is in use by another script that was removed etc
Don't remember now, changed somethings in the script that I thought would make a difference, but I've set it to default again to post here

I don't want to take much time of yours guys, but I really don't know what might be wrong here lol

Any information on the server, script, files etc, just ask.

Thanks a lot.

-- edit --

Also, in the creaturescripts/killinginthenameof.lua there is this line: (line 130)

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

That means I should receive a message when I kill a task monster? 'Cause I'm not getting any
 
Last edited:
I randomly get this message when ppl kill quest mobs

[18/09/2010 15:18:00] Lua Script Error: [CreatureScript Interface]
[18/09/2010 15:18:00] data/creaturescripts/scripts/killinginthenameof.lua:eek:nKill

[18/09/2010 15:18:00] luaGetPlayerStorageValue(). Player not found

[18/09/2010 15:18:00] Lua Script Error: [CreatureScript Interface]
[18/09/2010 15:18:00] data/creaturescripts/scripts/killinginthenameof.lua:eek:nKill

[18/09/2010 15:18:00] data/creaturescripts/scripts/killinginthenameof.lua:85: attempt to compare number with boolean
[18/09/2010 15:18:00] stack traceback:
[18/09/2010 15:18:00] data/creaturescripts/scripts/killinginthenameof.lua:85: in function <data/creaturescripts/scripts/killinginthenameof.lua:77>

local questCreatures =
{
["rotworm"] = {questStarted = 1510, questStorage = 65000, creatureStorage = 15000, killsRequired = 30, raceName = "Rotworms"},
["carrion worm"] = {questStarted = 1510, questStorage = 65000, creatureStorage = 15001, killsRequired = 30, raceName = "Rotworms"},
["rotworm queen"] = {questStarted = 1510, questStorage = 65000, creatureStorage = 15002, killsRequired = 30, raceName = "Rotworms"},

["skeleton"] = {questStarted = 1511, questStorage = 65001, creatureStorage = 15007, killsRequired = 50, raceName = "Undead"},
["skeleton warrior"] = {questStarted = 1511, questStorage = 65001, creatureStorage = 15008, killsRequired = 50, raceName = "Undead"},
["ghoul"] = {questStarted = 1511, questStorage = 65001, creatureStorage = 15009, killsRequired = 50, raceName = "Undead"},
["demon skeleton"] = {questStarted = 1511, questStorage = 65001, creatureStorage = 15010, killsRequired = 50, raceName = "Undead"},

["cyclops"] = {questStarted = 1512, questStorage = 65002, creatureStorage = 15011, killsRequired = 20, raceName = "Cyclops"},
["cyclops smith"] = {questStarted = 1512, questStorage = 65002, creatureStorage = 15012, killsRequired = 20, raceName = "Cyclops"},

["dragon"] = {questStarted = 1513, questStorage = 65003, creatureStorage = 15013, killsRequired = 50, raceName = "Dragons"},
["dragon lord"] = {questStarted = 1513, questStorage = 65003, creatureStorage = 15014, killsRequired = 50, raceName = "Dragons"},
["demodras"] = {questStarted = 1513, questStorage = 65003, creatureStorage = 15015, killsRequired = 50, raceName = "Dragons"},


["giant spider"] = {questStarted = 1514, questStorage = 65004, creatureStorage = 15016, killsRequired = 50, raceName = "Giant Spiders"},

["hero"] = {questStarted = 1515, questStorage = 65005, creatureStorage = 15017, killsRequired = 50, raceName = "Heroes"},

["hydra"] = {questStarted = 1516, questStorage = 65006, creatureStorage = 15018, killsRequired = 20, raceName = "Hydras"},

["demodras"] = {questStarted = 1517, questStorage = 65007, creatureStorage = 15019, killsRequired = 1, raceName = "Demodras"},

["black knight"] = {questStarted = 1518, questStorage = 65008, creatureStorage = 15020, killsRequired = 15, raceName = "black knights"},

["wyrm"] = {questStarted = 1519, questStorage = 65009, creatureStorage = 15021, killsRequired = 40, raceName = "Wyrms"},

["ice witch"] = {questStarted = 1520, questStorage = 65010, creatureStorage = 15022, killsRequired = 50, raceName = "Frozen"},
["frost giant"] = {questStarted = 1520, questStorage = 65010, creatureStorage = 15023, killsRequired = 50, raceName = "Frozen"},
["frost troll"] = {questStarted = 1520, questStorage = 65010, creatureStorage = 15024, killsRequired = 50, raceName = "Frozen"},
["crystal spider"] = {questStarted = 1520, questStorage = 65010, creatureStorage = 15025, killsRequired = 50, raceName = "Frozen"},
["frost dragon"] = {questStarted = 1520, questStorage = 65010, creatureStorage = 15026, killsRequired = 50, raceName = "Frozen"},

["bog raider"] = {questStarted = 1521, questStorage = 65011, creatureStorage = 15027, killsRequired = 40, raceName = "Swamp"},
["massive earth elemental"] = {questStarted = 1521, questStorage = 65011, creatureStorage = 15028, killsRequired = 40, raceName = "Swamp"},
["ancient scarab"] = {questStarted = 1521, questStorage = 65011, creatureStorage = 15029, killsRequired = 40, raceName = "Swamp"},
["larva"] = {questStarted = 1521, questStorage = 65011, creatureStorage = 15030, killsRequired = 40, raceName = "Swamp"},
["scarab"] = {questStarted = 1521, questStorage = 65011, creatureStorage = 15031, killsRequired = 40, raceName = "Swamp"},

["quara pincher"] = {questStarted = 1522, questStorage = 65012, creatureStorage = 15032, killsRequired = 30, raceName = "Underwater"},
["quara mantassin"] = {questStarted = 1522, questStorage = 65012, creatureStorage = 15033, killsRequired = 30, raceName = "Underwater"},
["quara predator"] = {questStarted = 1522, questStorage = 65012, creatureStorage = 15034, killsRequired = 30, raceName = "Underwater"},
["quara hydromancer"] = {questStarted = 1522, questStorage = 65012, creatureStorage = 15035, killsRequired = 30, raceName = "Underwater"},

["earth elemental"] = {questStarted = 1523, questStorage = 65013, creatureStorage = 15036, killsRequired = 30, raceName = "Behemoths"},
["jagged earth elemental"] = {questStarted = 1523, questStorage = 65013, creatureStorage = 15037, killsRequired = 30, raceName = "Behemoths"},
["behemoth"] = {questStarted = 1523, questStorage = 65013, creatureStorage = 15038, killsRequired = 30, raceName = "Behemoths"},
["muddy earth elemental"] = {questStarted = 1523, questStorage = 65013, creatureStorage = 15039, killsRequired = 30, raceName = "Behemoths"},

["warlock"] = {questStarted = 1524, questStorage = 65014, creatureStorage = 15040, killsRequired = 50, raceName = "Warlocks"},
["witch"] = {questStarted = 1524, questStorage = 65014, creatureStorage = 15041, killsRequired = 50, raceName = "Warlocks"},
["enlightened of the cult"] = {questStarted = 1524, questStorage = 65014, creatureStorage = 15042, killsRequired = 50, raceName = "Warlocks"},
["adept of the cult"] = {questStarted = 1524, questStorage = 65014, creatureStorage = 15043, killsRequired = 50, raceName = "Warlocks"},

["betrayed wraith"] = {questStarted = 1525, questStorage = 65015, creatureStorage = 15044, killsRequired = 40, raceName = "Stronger undead"},
["lost soul"] = {questStarted = 1525, questStorage = 65015, creatureStorage = 15045, killsRequired = 60, raceName = "Stronger Undead"},
["destroyer"] = {questStarted = 1525, questStorage = 65015, creatureStorage = 15046, killsRequired = 60, raceName = "Stronger Undead"},
["hand of cursed faith"] = {questStarted = 1525, questStorage = 65015, creatureStorage = 15047, killsRequired = 60, raceName = "Stronger undead"},

["demon"] = {questStarted = 1526, questStorage = 65016, creatureStorage = 15048, killsRequired = 100, raceName = "Demons"},

["juggernaut"] = {questStarted = 1527, questStorage = 65017, creatureStorage = 15049, killsRequired = 60, raceName = "Juggernauts"},

["nightmare"] = {questStarted = 1528, questStorage = 65018, creatureStorage = 15050, killsRequired = 60, raceName = "Nightmares"},

["demon lord"] = {questStarted = 1529, questStorage = 65019, creatureStorage = 15051, killsRequired = 50, raceName = "Demon Lords"},

["hell demon"] = {questStarted = 1530, questStorage = 65020, creatureStorage = 15052, killsRequired = 100, raceName = "Hell demons"},
}

local msgType = MESSAGE_STATUS_CONSOLE_ORANGE

function onKill(cid, target, lastHit)

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

if creature then
if isPlayer(target) then
return true
end
if getPlayerStorageValue(cid, creature.questStarted) > 0 then
if getPlayerStorageValue(cid, creature.questStorage) < creature.killsRequired then
if getPlayerStorageValue(cid, creature.questStorage) < 0 then
doPlayerSetStorageValue(cid, creature.questStorage, 0)
end

if getPlayerStorageValue(cid, creature.creatureStorage) < 0 then
doPlayerSetStorageValue(cid, creature.creatureStorage, 0)
end
doPlayerSetStorageValue(cid, creature.questStorage, getPlayerStorageValue(cid, creature.questStorage) + 1)
doPlayerSetStorageValue(cid, creature.creatureStorage, getPlayerStorageValue(cid, creature.creatureStorage) + 1)
doPlayerSendTextMessage(cid, msgType, "" .. getPlayerStorageValue(cid, creature.creatureStorage) .. " " .. getCreatureName(target) .. " defeated. Total [" .. getPlayerStorageValue(cid, creature.questStorage) .. "/" .. creature.killsRequired .. "] " .. creature.raceName .. ".")
end
end
end
return true
end
 
If you complete a quest, you say report for a reward. But theres a bug where you can keep saying reward and you will keep getting your reward.
 
Hoho new informations!!

By using command /storage player,storageid,number

I was able to test other parts of the script, and I found out that.................... Everything else is working fine *-*

The ONLY bug is that the monster death isn't registered! But when I set monster's task storage to an value, I'm able to receive the reward and go to next task... When I kill a monster, I don't receive any message, and does not count for the counter... I'll keep trying and post here if I manage to do something..

PS: If someone want to help I would be grateful *-*
 
Back
Top