Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function onKill(cid, target)
- local MONSTERS = {
- ["Rotworn"] = {storage = 38290, check = 30000, needKills = 100, rewards = {2160, 1}},
- ["Dragon"] = {storage = 38291, check = 30001, needKills = 250, rewards = {2160, 25}}
- }
- local name = getCreatureName(target)
- local TB = MONSTERS[name]
- local STOR = getPlayerStorageValue(cid, TB.storage) < 0 and 0 or getPlayerStorageValue(cid, TB.storage)
- if TB then
- if isMonster(target) then
- if STOR < TB.needKills then
- setPlayerStorageValue(cid, TB.storage, STOR + 1)
- doPlayerSendTextMessage(cid, 27, name .. "[" .. STOR .. "/" .. TB.needKills .. "]")
- else
- if getPlayerStorageValue(cid, TB.check) < 1 then
- doPlayerSendTextMessage(cid, 28, name .. " task completed.")
- doPlayerAddItem(cid, TB.rewards[1], TB.rewards[2])
- setPlayerStorageValue(cid, TB.check, 1)
- end
- end
- end
- end
- return true
- end
Advertisement
Add Comment
Please, Sign In to add comment