Merge branch 'develop' into paglias/bs3

This commit is contained in:
Matteo Pagliazzi
2014-02-01 16:47:32 +01:00
9 changed files with 71 additions and 53 deletions
+4 -2
View File
@@ -539,9 +539,11 @@ api.questAccept = function(req, res) {
// If ?key=xxx is provided, we're starting a new quest and inviting the party. Otherwise, we're a party member accepting the invitation
if (key) {
if (!shared.content.quests[key]) return res.json(404,{err:'Quest ' + key + ' not found'});
var quest = shared.content.quests[key];
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"
+1
View File
@@ -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':