Browse Source

Blood Barrier gives a shield effect for the frenzy duration

merge-requests/579/head
kckckc 2 years ago
parent
commit
22e4031306
2 changed files with 28 additions and 2 deletions
  1. +20
    -0
      src/server/config/effects/effectShield.js
  2. +8
    -2
      src/server/mods/class-necromancer/spells/spellBloodBarrier.js

+ 20
- 0
src/server/config/effects/effectShield.js View File

@@ -0,0 +1,20 @@
module.exports = {
type: 'shield',

amount: 0,
maxAmount: 0,

events: {
beforeTakeDamage: function (damage, source) {
if (this.amount > 0) {
let mitigatedAmount = Math.min(damage.amount, this.amount);
damage.amount -= mitigatedAmount;
this.amount -= mitigatedAmount;
}

if (this.amount <= 0)
this.destroyed = true;
}
}
};

+ 8
- 2
src/server/mods/class-necromancer/spells/spellBloodBarrier.js View File

@@ -39,8 +39,14 @@ module.exports = {
obj.stats.takeDamage(damage, 0, obj);

amount = amount * this.shieldMultiplier;
const heal = { amount };
target.stats.getHp(heal, obj);
target.effects.addEffect({
type: 'shield',
ttl: this.frenzyDuration,
new: true,
noMsg: true,
amount: amount,
maxAmount: amount
});

//Only reset the first spell's cooldown if it's an auto attack and not a spell
const firstSpell = target.spellbook.spells[0];


Loading…
Cancel
Save