Jack Parsons
Member
I've developed a simple quest, and I'd like to share it as a template for you (Perhaps it'll be useful to someone).
You just have to change the chest unique ID (That you've inserted in the map editor), the amount of money for the reward, the amount of XP and the name of the quest (The name of my quest is "Witch Coven", and I'm leaving it there to serve as an example). It's really really simple.
Of course.. don't forget to add the actionid inside actions.xml:
Code:
NOT_CLEARED = -1
CLEARED = 1
function onUse(cid, item, fromPosition, itemEx, toPosition, isHotkey)
local chest = 2500 -- The chest UID / Unique ID.
local moneyReward = 70000 -- The amount of money.
local xpReward = 7000 -- The amount of xp.
local questName = "Witch Coven" -- The name of the quest.
if item.uid == chest then
local p = Player(cid)
isCleared = p:getStorageValue(chest)
if isCleared == NOT_CLEARED then
p:sendTextMessage(MESSAGE_INFO_DESCR, "You've earned 7k for completing the " .. questName .. " Quest.")
p:addMoney(moneyReward)
p:addExperience(xpReward)
p:setStorageValue(chest, CLEARED)
else
p:sendTextMessage(MESSAGE_INFO_DESCR, "The chest is empty.")
end
end
return true
end
You just have to change the chest unique ID (That you've inserted in the map editor), the amount of money for the reward, the amount of XP and the name of the quest (The name of my quest is "Witch Coven", and I'm leaving it there to serve as an example). It's really really simple.
Of course.. don't forget to add the actionid inside actions.xml:
Code:
<action actionid="500" script="quests/witchcoven.lua"/>