Browse Source

Merge branch '100-quest-gen-fail-low-level' into 'staging'

Fixes #100

See merge request !58
tags/v0.1.2^2
Big Bad Waffle 7 years ago
parent
commit
c83374209a
7 changed files with 31 additions and 3 deletions
  1. +6
    -1
      src/server/components/quests.js
  2. +2
    -1
      src/server/config/quests/questBuilder.js
  3. +2
    -0
      src/server/config/quests/templates/questGatherResource.js
  4. +7
    -0
      src/server/config/quests/templates/questKillX.js
  5. +2
    -0
      src/server/config/quests/templates/questLoot.js
  6. +7
    -0
      src/server/config/quests/templates/questLootGen.js
  7. +5
    -1
      src/server/config/quests/templates/questTemplate.js

+ 6
- 1
src/server/components/quests.js View File

@@ -30,7 +30,12 @@ define([
quest.active = (this.obj.zoneName == quest.zoneName);

this.quests.push(quest);
quest.init(hideMessage);
if (!quest.init(hideMessage)) {
this.quests.spliceWhere(q => (q == quest));
return false;
}
else
return true;
},

complete: function(id) {


+ 2
- 1
src/server/config/quests/questBuilder.js View File

@@ -61,7 +61,8 @@ define([
quest.obj = obj;
quest.zoneName = zoneName;

oQuests.obtain(quest, !!template);
if (!oQuests.obtain(quest, !!template))
this.obtain(obj, template);
}
};
});

+ 2
- 0
src/server/config/quests/templates/questGatherResource.js View File

@@ -15,6 +15,8 @@ define([
}

this.description = 'Gather ' + this.have + '/' + this.need + ' herbs';

return true;
},

events: {


+ 7
- 0
src/server/config/quests/templates/questKillX.js View File

@@ -37,6 +37,11 @@ define([
(mobBlueprint.level <= ~~(this.obj.stats.values.level * 1.35))
);
}, this);

//No level appropriate mobs found
if (keys.length == 0)
return false;

this.mobType = keys[~~(Math.random() * keys.length)];
var needMax = 8;
this.mobName = this.mobType.replace(/\w\S*/g, function(txt) {
@@ -48,6 +53,8 @@ define([
}

this.description = 'Kill ' + this.have + '/' + this.need + ' ' + this.mobName;

return true;
},

events: {


+ 2
- 0
src/server/config/quests/templates/questLoot.js View File

@@ -17,6 +17,8 @@ define([
}

this.description = 'Loot 1x ' + this.slotName + ' slot item';

return true;
},

events: {


+ 7
- 0
src/server/config/quests/templates/questLootGen.js View File

@@ -26,6 +26,11 @@ define([
(mobBlueprint.level <= (this.obj.stats.values.level * 1.35))
);
}, this);

//No level appropriate mobs found
if (keys.length == 0)
return false;

this.mobType = keys[~~(Math.random() * keys.length)];
var needMax = 8;
this.mobName = this.mobType.replace(/\w\S*/g, function(txt) {
@@ -39,6 +44,8 @@ define([

this.name = this.item.name + ' Gatherer';
this.description = 'Loot ' + this.have + '/' + this.need + ' ' + this.item.name + ' from ' + this.mobName;

return true;
},

oComplete: function() {


+ 5
- 1
src/server/config/quests/templates/questTemplate.js View File

@@ -5,7 +5,9 @@ define([
) {
return {
init: function(hideMessage) {
this.build();
if (!this.build())
return false;

this.obj.syncer.setArray(true, 'quests', 'obtainQuests', this.simplify(true));

if (!hideMessage) {
@@ -17,6 +19,8 @@ define([
}]
}, [this.obj.serverId]);
}

return true;
},

ready: function() {


Loading…
Cancel
Save