unction onUse(cid, item, fromPosition, itemEx, toPosition)
local count = {
[1000] = 1
}
local level = {
[1000] = 8
}
local itemid = {
[1000] = 10001
}
local storageid = {
[1000] = 10001
}
local expierence = {
[1000] = 100
}
local exp = expierence[item.uid]
local storage = storageid[item.uid]
local queststatus = getPlayerStorageValue(cid, storage)
local itemid = itemid[item.uid]
local count = count[item.uid]
local itemname = getItemNameById(itemid)
local needlvl = level[item.uid]
local need = "You must have ".. needlvl .." level to get reward."
local found_one = "You have found ".. itemname .."."
local found_more = "You have found ".. count .." of ".. itemname .."."
local empty = "This ".. getItemNameById(item.itemid) .." is empty."
if queststatus == -1 and getPlayerLevel(cid) >= needlvl and count == 1 then
doPlayerSetStorageValue(cid, storage, 1)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, found_one)
doPlayerAddItem(cid, itemid, count)
doPlayerAddExp(cid, exp)
doSendAnimatedText(getCreaturePosition(cid), exp, TEXTCOLOR_WHITE)
return TRUE
elseif queststatus == -1 and getPlayerLevel(cid) >= needlvl and count > 1 then
doPlayerSetStorageValue(cid, storage, 1)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, found_more)
doPlayerAddItem(cid, itemid, count)
doPlayerAddExp(cid, exp)
doSendAnimatedText(getCreaturePosition(cid), exp, TEXTCOLOR_WHITE)
return TRUE
elseif getPlayerLevel(cid) < needlvl then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, need)
elseif queststatus > 0 then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, empty)
end
return TRUE
end
<action actionid="1000" script="quests/quest_system.lua" />
[B]f[/B]unction onUse(cid, item, fromPosition, itemEx, toPosition)
local count = {
[1000] = 1
}
local level = {
[1000] = 8
}
local itemid = {
[1000] = 10001
}
local storageid = {
[1000] = 10001
}
local expierence = {
[1000] = 100
}
local exp = expierence[item.uid]
local storage = storageid[item.uid]
local queststatus = getPlayerStorageValue(cid, storage)
local itemid = itemid[item.uid]
local count = count[item.uid]
local itemname = getItemNameById(itemid)
local needlvl = level[item.uid]
local need = "You must have ".. needlvl .." level to get reward."
local found_one = "You have found ".. itemname .."."
local found_more = "You have found ".. count .." of ".. itemname .."."
local empty = "This ".. getItemNameById(item.itemid) .." is empty."
if queststatus == -1 and getPlayerLevel(cid) >= needlvl and count == 1 then
doPlayerSetStorageValue(cid, storage, 1)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, found_one)
doPlayerAddItem(cid, itemid, count)
doPlayerAddExp(cid, exp)
doSendAnimatedText(getCreaturePosition(cid), exp, TEXTCOLOR_WHITE)
return TRUE
elseif queststatus == -1 and getPlayerLevel(cid) >= needlvl and count > 1 then
doPlayerSetStorageValue(cid, storage, 1)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, found_more)
doPlayerAddItem(cid, itemid, count)
doPlayerAddExp(cid, exp)
doSendAnimatedText(getCreaturePosition(cid), exp, TEXTCOLOR_WHITE)
return TRUE
elseif getPlayerLevel(cid) < needlvl then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, need)
elseif queststatus > 0 then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, empty)
end
return TRUE
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
local count = {
[9658] = 1
}
local level = {
[9658] = 8
}
local itemid = {
[9658] = 2489
}
local storageid = {
[9658] = 10001
}
local expierence = {
[9658] = 0
}
local exp = expierence[item.uid]
local storage = storageid[item.uid]
local queststatus = getPlayerStorageValue(cid, storage)
local itemid = itemid[item.uid]
local count = count[item.uid]
local itemname = getItemNameById(itemid)
local needlvl = level[item.uid]
local need = "You must have ".. needlvl .." level to get reward."
local found_one = "You have found ".. itemname .."."
local found_more = "You have found ".. count .." of ".. itemname .."."
local empty = "This ".. getItemNameById(item.itemid) .." is empty."
if queststatus == -1 and getPlayerLevel(cid) >= needlvl and count == 1 then
doPlayerSetStorageValue(cid, storage, 1)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, found_one)
doPlayerAddItem(cid, itemid, count)
doPlayerAddExp(cid, exp)
doSendAnimatedText(getCreaturePosition(cid), exp, TEXTCOLOR_WHITE)
return TRUE
elseif queststatus == -1 and getPlayerLevel(cid) >= needlvl and count > 1 then
doPlayerSetStorageValue(cid, storage, 1)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, found_more)
doPlayerAddItem(cid, itemid, count)
doPlayerAddExp(cid, exp)
doSendAnimatedText(getCreaturePosition(cid), exp, TEXTCOLOR_WHITE)
return TRUE
elseif getPlayerLevel(cid) < needlvl then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, need)
elseif queststatus > 0 then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, empty)
end
return TRUE
end