mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-08-05 03:52:14 +00:00
feat(quests): allow dropping scrolls in quests
This commit is contained in:
parent
800231cf64
commit
54064debf3
2 changed files with 2 additions and 1 deletions
|
|
@ -543,7 +543,7 @@ api.questAccept = function(req, res) {
|
|||
if (!quest) return res.json(404,{err:'Quest ' + key + ' not found'});
|
||||
if (quest.lvl && user.stats.lvl < quest.lvl) return res.json(400, {err: "You must be level "+quest.lvl+" to being this quest."});
|
||||
if (group.quest.key) return res.json(400, {err: 'Party already on a quest (and only have one quest at a time)'});
|
||||
if (!user.items.quests[key]) return res.json(401, {err: "You don't own that quest scroll"});
|
||||
if (!user.items.quests[key]) return res.json(400, {err: "You don't own that quest scroll"});
|
||||
group.quest.key = key;
|
||||
group.quest.members = {};
|
||||
// Invite everyone. true means "accepted", false="rejected", undefined="pending". Once we click "start quest"
|
||||
|
|
|
|||
|
|
@ -148,6 +148,7 @@ GroupSchema.methods.finishQuest = function(quest, cb) {
|
|||
case 'eggs':
|
||||
case 'food':
|
||||
case 'hatchingPotions':
|
||||
case 'quests':
|
||||
updates['$inc']['items.'+item.type+'.'+dropK] = _.where(quest.drop.items,{type:item.type,key:item.key}).length;
|
||||
break;
|
||||
case 'pets':
|
||||
|
|
|
|||
Loading…
Reference in a new issue