You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

24 lines
556 B

  1. module.exports = {
  2. events: {
  3. onGetText: function (item) {
  4. let rolls = item.effects.find(e => (e.type === 'freezeOnHit')).rolls;
  5. return `${rolls.chance}% chance on hit to freeze target for ${rolls.duration} ticks`;
  6. },
  7. afterDealDamage: function (item, { damage, target }) {
  8. let rolls = item.effects.find(e => (e.type === 'freezeOnHit')).rolls;
  9. let chanceRoll = Math.random() * 100;
  10. if (chanceRoll >= rolls.chance)
  11. return;
  12. target.effects.addEffect({
  13. type: 'slowed',
  14. chance: 1,
  15. ttl: rolls.duration
  16. });
  17. }
  18. }
  19. };