diff --git a/src/server/components/aggro.js b/src/server/components/aggro.js index 568fa0d7..636d3f6b 100644 --- a/src/server/components/aggro.js +++ b/src/server/components/aggro.js @@ -178,7 +178,7 @@ module.exports = { this.ignoreList.spliceWhere(o => o === obj); }, - tryEngage: function (source, amount, threatMult) { + tryEngage: function (source, amount, threatMult = 1) { let obj = this.obj; //Don't aggro yourself, stupid @@ -204,7 +204,7 @@ module.exports = { let list = this.list; amount = (amount || 0); - let threat = (amount / obj.stats.values.hpMax) * (threatMult || 1); + let threat = (amount / obj.stats.values.hpMax) * threatMult; let exists = list.find(l => l.obj.id === oId); if (!exists) { @@ -237,7 +237,7 @@ module.exports = { return null; }, - die: function () { + reset: function () { let list = this.list; let lLen = list.length; @@ -259,6 +259,10 @@ module.exports = { this.list = []; }, + die: function () { + this.reset(); + }, + unAggro: function (obj, amount) { let list = this.list; let lLen = list.length;