Browse Source

Merge branch 'issue-36' into 'staging'

Issue 36

See merge request !27
tags/v0.1.2
Big Bad Waffle 7 years ago
parent
commit
50e440f581
2 changed files with 16 additions and 0 deletions
  1. +4
    -0
      src/server/components/inventory.js
  2. +12
    -0
      src/server/config/quests/templates/questLootGen.js

+ 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