xNMExReject
Member
- Joined
- Oct 31, 2009
- Messages
- 33
- Reaction score
- 11
Lua:
-- Quest: The Lost Treasure
local config = {
questName = "The Lost Treasure",
questArea = {from = {x = 32000, y = 32000, z = 7}, to = {x = 32001, y = 32001, z = 7}},
questStorage = 50000,
firstItemId = 2342,
secondItemId = 2343,
rewardExp = 15000,
rewardMoney = 100000
}
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
if item.itemid == config.firstItemId and player:getStorageValue(config.questStorage) == -1 then
player:sendTextMessage(MESSAGE_INFO_DESCR, "You have found a map leading to a lost treasure. Will you accept this quest?")
player:setStorageValue(config.questStorage, 0)
elseif item.itemid == config.secondItemId and player:getStorageValue(config.questStorage) == 0 then
player:sendTextMessage(MESSAGE_INFO_DESCR, "You have found the treasure! You have completed the quest and have been rewarded.")
player:addExperience(config.rewardExp)
player:addMoney(config.rewardMoney)
player:setStorageValue(config.questStorage, 1)
else
player:sendTextMessage(MESSAGE_INFO_DESCR, "You have already completed this quest.")
end
return true
end