zydent
Member
As I can make this script do not use storage:
Some kind person who can help me is appreciated.
Reissued*
Code:
local quests =
{
{ 1111, "Rat", 1, 2160, 10, "Congratulations! You finished a first quest of Rats!" }, -- storage of starts quest, monster, count to kill, gift id, gift count, message on finish
{ 1112, "Demon", 1, 2400, 1, "Congratulations!" },
{ 1113, "Rat", 5, 2160, 2, "Congratulations! You finished a second quest of Rats!" }
}
function onKill(cid, target, lastHit)
if (not isMonster(target)) then
return false
end
for i=1, #quests do
if (getCreatureName(target) == quests[i][2] and not (getPlayerStorageValue(cid, quests[i][1]) > quests[i][3])) then
if (getPlayerStorageValue(cid, quests[i][1]) == -1) then
doPlayerSetStorageValue(cid, quests[i][1], 0)
end
doPlayerSetStorageValue(cid, quests[i][1], (getPlayerStorageValue(cid, quests[i][1])+1))
if (getPlayerStorageValue(cid, quests[i][1]) == quests[i][3]) then
doPlayerAddItem(cid, quests[i][4], quests[i][5])
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, quests[i][6])
end
return true
end
end
return true
end
Some kind person who can help me is appreciated.
Reissued*
Last edited: