Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[ Quest system
- Fácil configuração para você criar suas quest, muito simples
- Author : Skymagnum or Skyforever
- Contact : TibiaKing.com / Xtibia.com
- ENJOY IT!
- ]]--
- function CompleteQuest(player, configuration)
- if getPlayerStorageValue(player, configuration.storage) > 0 then
- doSendMagicEffect(getThingPos(player), configuration.failEff)
- return doPlayerSendTextMessage(cid, 25, "You already complete this quest.")
- end
- local item = nil
- for _, T in pairs(configuration.items) do
- if getPlayerFreeCap(player) < (getItemWeight(T[1]) * T[2]) then
- item = doPlayerAddItem(player, T[1], T[2])
- doSendMagicEffect(getThingPos(player), configuration.completeEff)
- else
- item = doCreateItemEx(T[1], T[2])
- doPlayerSendMailByName(getCreatureName(player), item)
- doSendMagicEffect(getThingPos(player), configuration.depotEff)
- doPlayerSendTextMessage(cid, 22, "You don't have capacity, item send to depot.")
- end
- end
- end
- In your quest script you take it:
- function onUse(cid, item, fromPosition, itemEx, toPosition)
- return CompleteQuest(cid, config)
- end
- where config is:
- local config = {
- storage = 329302,
- failEff = 9,
- items = {{2160, 10}, {2159, 30}},
- completeEff = 28,
- depotEff = 30,
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement