local config = {
["carniphila"] = {storage = 9999, ace_name = "carniphilas", begin_storage_value = 1, finished_storage_value = 2, count = 150},
["crocodile"] = {storage = 9998, race_name = "crocodiles", begin_storage_value = 3, finished_storage_value = 4, count = 300},
["tarantula"] = {storage = 9997, race_name = "tarantulas", begin_storage_value = 5, finished_storage_value = 6, count = 300},
["stone golem"] = {storage = 9996, race_name = "stone golems", begin_storage_value = 7, finished_storage_value = 8, count = 200},
["mammoth"] = {storage = 9995, race_name = "mammoths", begin_storage_value = 9, finished_storage_value = 10, count = 300},
["ice golem"] = {storage = 9994, race_name = "ice golems", begin_storage_value = 11, finished_storage_value = 12, count = 300},
["quara constrictor scout"] = {storage = 9993, race_name = "quara scouts", begin_storage_value = 26, finished_storage_value = 27, count = 300},
["quara hydromancer scout"] = {storage = 9993, race_name = "quara scouts", begin_storage_value = 26, finished_storage_value = 27, count = 300},
["quara mantassin scout"] = {storage = 9993, race_name = "quara scouts", begin_storage_value = 26, finished_storage_value = 27, count = 300},
["quara pincher scout"] = {storage = 9993, race_name = "quara scouts", begin_storage_value = 26, finished_storage_value = 27, count = 300},
["quara predator scout"] = {storage = 9993, race_name = "quara scouts", begin_storage_value = 26, finished_storage_value = 27, count = 300},
["quara constrictor"] = {storage = 9992, race_name = "quaras", begin_storage_value = 24, finished_storage_value = 25, count = 300},
["quara hydromancer"] = {storage = 9992, race_name = "quaras", begin_storage_value = 24, finished_storage_value = 25, count = 300},
["quara mantassin"] = {storage = 9992, race_name = "quaras", begin_storage_value = 24, finished_storage_value = 25, count = 300},
["quara pincher"] = {storage = 9992, race_name = "quaras", begin_storage_value = 24, finished_storage_value = 25, count = 300},
["quara predator"] = {storage = 9992, race_name = "quaras", begin_storage_value = 24, finished_storage_value = 25, count = 300},
["fire elemental"] = {storage = 9991, race_name = "fire elementals", begin_storage_value = 28, finished_storage_value = 29, count = 7},
["massive fire elemental"] = {storage = 9991, race_name = "fire elementals", begin_storage_value = 28, finished_storage_value = 29, count = 70},
["water elemental"] = {storage = 9990, race_name = "water elementals", begin_storage_value = 30, finished_storage_value = 31, count = 70},
["massive water elemental"] = {storage = 9990, race_name = "water elementals", begin_storage_value = 30, finished_storage_value = 31, count = 70},
["earth elemental"] = {storage = 9989, race_name = "earth elementals", begin_storage_value = 32, finished_storage_value = 33, count = 70},
["massive earth elemental"] = {storage = 9989, race_name = "earth elementals", begin_storage_value = 32, finished_storage_value = 33, count = 70},
["energy elemental"] = {storage = 9988, race_name = "energy elementals", begin_storage_value = 34, finished_storage_value = 35, count = 70},
["massive energy elemental"] = {storage = 9988, race_name = "energy elementals", begin_storage_value = 34, finished_storage_value = 35, count = 70},
["mutated rat"] = {storage = 9987, race_name = "mutated rats", begin_storage_value = 13, finished_storage_value = 14, count = 200},
["giant spider"] = {storage = 9986, race_name = "giant spiders", begin_storage_value = 15, finished_storage_value = 16, count = 500},
["hydra"] = {storage = 9985, race_name = "hydras", begin_storage_value = 17, finished_storage_value = 18, count = 2000},
["sea serpent"] = {storage = 9984, race_name = "sea serpents", begin_storage_value = 19, finished_storage_value = 20, count = 2000},
["behemoth"] = {storage = 9983, race_name = "behemoths", begin_storage_value = 21, finished_storage_value = 22, count = 20},
["serpent spawn"] = {storage = 9982, race_name = "serpent spawns", begin_storage_value = 23, finished_storage_value = 24, count = 1500},
["demon"] = {boss = "no", begin_storage_main_value = 36, finished_storage_main_value = 37, special_storage = 10007, storage = 9981, begin_special_task_boss_storage_value = 0, finished_special_task_boss_storage_value = 1, count = 6666},
--bosses
["demodras"] = {boss = "yes", special_storage = 10005, begin_special_task_boss_storage_value = 0, finished_special_task_boss_storage_value = 1},
["tiquandas revenge"] = {boss = "yes", special_storage = 10006, begin_special_task_boss_storage_value = 0, finished_special_task_boss_storage_value = 1},
["the snapper"] = {storage = 9978, begin_boss_storage_value = 1, finished_boss_storage_value = 2},
["hide"] = {storage = 9977, begin_boss_storage_value = 3, finished_boss_storage_value = 4},
["the bloodtusk"] = {storage = 9976, begin_boss_storage_value = 5, finished_boss_storage_value = 6},
["shardhead"] = {storage = 9975, begin_boss_storage_value = 7, finished_boss_storage_value = 8},
["esmeralda"] = {storage = 9973, begin_boss_storage_value = 9, finished_boss_storage_value = 10},
["the old widow"] = {storage = 9972, begin_boss_storage_value = 11, finished_boss_storage_value = 12},
["the many"] = {storage = 9971, begin_boss_storage_value = 13, finished_boss_storage_value = 14},
["leviathan"] = {storage = 9970, begin_boss_storage_value = 15, finished_boss_storage_value = 16},
["stonecracker"] = {storage = 9969, begin_boss_storage_value = 17, finished_boss_storage_value = 18},
["the noxious spawn"] = {storage = 9968, begin_boss_storage_value = 19, finished_boss_storage_value = 20},
["thul"] = {storage = 9974, begin_boss_storage_value = 21, finished_boss_storage_value = 22}
}
local points = 10002
local main_storage = 10001
local bosses_storage = 10003
function onKill(cid, target)
local mob = config[getCreatureName(target)]
if not(mob and isPlayer(target) ~= true) then
return true
end
local killedMonsters = getPlayerStorageValue(cid, mob.storage)
local totalpoints = getPlayerStorageValue(cid, points)
if(totalpoints == -1) then
totalpoints = 0
end
if getPlayerStorageValue(cid, main_storage) == mob.begin_storage_value then
if killedMonsters <= mob.count then
doPlayerSetStorageValue(cid, mob.storage, getPlayerStorageValue(cid, mob.storage) + 1)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You have killed "..getPlayerStorageValue(cid, mob.storage).." of "..mob.count.." "..mob.race_name..".")
if getPlayerStorageValue(cid, mob.storage) == mob.count then
doPlayerSetStorageValue(cid, main_storage, mob.finished_storage_value)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Congratulations! You have killed enough "..mob.race_name..".")
if totalpoints < 50 then
if mob.count < 1500 then
doPlayerSetStorageValue(cid, points, totalpoints + 1)
doPlayerSendTextMessage(cid, TALKTYPE_ORANGE_1, "Your total points is "..getPlayerStorageValue(cid, points)..".")
else
doPlayerSetStorageValue(cid, points, totalpoints + 3)
doPlayerSendTextMessage(cid, TALKTYPE_ORANGE_1, "Your total points is "..getPlayerStorageValue(cid, points)..".")
end
end
end
elseif getPlayerStorageValue(cid, bosses_storage) == mob.begin_boss_storage_value then
if killedMonsters > -1 and killedMonsters < 1 then
doPlayerSetStorageValue(cid, bosses_storage, mob.finished_boss_storage_value)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Congratulations! You have killed "..getCreatureName(target)..".")
if totalpoints < 50 then
doPlayerSetStorageValue(cid, points, totalpoints + 1)
doPlayerSendTextMessage(cid, TALKTYPE_ORANGE_1, "Your total points is "..getPlayerStorageValue(cid, points)..".")
end
elseif getPlayerStorageValue(cid, mob.special_storage) == mob.begin_special_task_boss_storage_value then
if mob.boss == "no" then
if killedMonsters <= mob.count and getPlayerStorageValue(cid, main_storage) == mob.begin_storage_main_value then
doPlayerSetStorageValue(cid, mob.storage, killedMonsters + 1)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You have killed "..getPlayerStorageValue(cid, mob.storage).." of "..mob.count.." "..getCreatureName(target).."s.")
if getPlayerStorageValue(cid, mob.storage) == mob.count then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Congratulations! You have killed enough "..getCreatureName(target).."s.")
doPlayerSetStorageValue(cid, mob.special_storage, mob.finished_special_task_boss_storage_value)
doPlayerSetStorageValue(cid, storages.main_storage, mob.finished_storage_main_value)
end
end
elseif mob.boss == "yes" then
if killedMonsters > -1 and killedMonsters < 1 then
doPlayerSetStorageValue(cid, mob.special_storage, mob.finished_special_task_boss_storage_value)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Congratulations! You have killed "..getCreatureName(target)..".")
end
end
end
return true
end