Parcourir la 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 il y a 7 ans
Parent
révision
c83374209a
7 fichiers modifiés avec 31 ajouts et 3 suppressions
  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 Voir le fichier

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


this.quests.push(quest); 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) { complete: function(id) {


+ 2
- 1
src/server/config/quests/questBuilder.js Voir le fichier

@@ -61,7 +61,8 @@ define([
quest.obj = obj; quest.obj = obj;
quest.zoneName = zoneName; 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 Voir le fichier

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


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

return true;
}, },


events: { events: {


+ 7
- 0
src/server/config/quests/templates/questKillX.js Voir le fichier

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

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

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


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

return true;
}, },


events: { events: {


+ 2
- 0
src/server/config/quests/templates/questLoot.js Voir le fichier

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


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

return true;
}, },


events: { events: {


+ 7
- 0
src/server/config/quests/templates/questLootGen.js Voir le fichier

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

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

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


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

return true;
}, },


oComplete: function() { oComplete: function() {


+ 5
- 1
src/server/config/quests/templates/questTemplate.js Voir le fichier

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

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


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

return true;
}, },


ready: function() { ready: function() {


Chargement…
Annuler
Enregistrer