Browse Source

Temporary fix for people having too many quest items by allowing you to destroy them

tags/v0.1.2
Big Bad Waffle 7 years ago
parent
commit
8eee7f4f24
3 changed files with 18 additions and 0 deletions
  1. +2
    -0
      src/server/combat/combat.js
  2. +4
    -0
      src/server/components/inventory.js
  3. +12
    -0
      src/server/config/quests/templates/questLootGen.js

+ 2
- 0
src/server/combat/combat.js View File

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

amount *= 1000;

return {
amount: amount,
crit: isCrit,


+ 4
- 0
src/server/components/inventory.js View File

@@ -195,6 +195,8 @@ define([
if (!item)
return;

amount = amount || item.quantity;

if (item.eq)
this.obj.equipment.unequip(id);

@@ -213,6 +215,8 @@ define([
if (this.obj.player)
this.getDefaultAbilities();

this.obj.fireEvent('afterDestroyItem', item, amount);

return item;
},



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

@@ -68,6 +68,18 @@ define([
if (this.have == this.need)
this.ready();

this.description = 'Loot ' + this.have + '/' + this.need + ' ' + this.item.name + ' from ' + this.mobName;
this.obj.syncer.setArray(true, 'quests', 'updateQuests', this.simplify(true));
},

afterDestroyItem: function(item, quantity) {
if (item.name.toLowerCase() != this.item.name.toLowerCase())
return;

this.have -= quantity;
if (this.have < 0)
this.have = 0;

this.description = 'Loot ' + this.have + '/' + this.need + ' ' + this.item.name + ' from ' + this.mobName;
this.obj.syncer.setArray(true, 'quests', 'updateQuests', this.simplify(true));
}


Loading…
Cancel
Save