function onKill(cid, target, lastHit)
local questCreatures =
{
["wolf"] = {questStarted = 1510, questStorage = 65000, creatureStorage = 15000, killsRequired = 200, raceName = "Wolf"},
["demon"] = {questStarted = 1510, questStorage = 65000, creatureStorage = 15001, killsRequired = 200, raceName = "Demon"},
}
local creature = questCreatures[getCreatureName(target)]
if creature then
if(isPlayer(target) == true) 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, MESSAGE_STATUS_CONSOLE_BLUE, "" .. getPlayerStorageValue(cid, creature.creatureStorage) .. " " .. getCreatureName(target) .. " defeated. Total [" .. getPlayerStorageValue(cid, creature.questStorage) .. "/" .. creature.killsRequired .. "] " .. creature.raceName .. ".")
end
end
end
return true
end