Yanfly Item Durability has the ability to universally affect all weapons when setting the durability lost through physical or magical actions. However, I would like to have a specific weapon type to lose durability when using magical actions.
For example. Using magical attacks when using sword does not affect the durability, but using magical attacks when using staves does affect the durability.
I tried using a few evals in the Magical Action Parameter:
if ($gameActors.actor(this.actorId()).isWtypeEquipped(2) === true) { -1; }
if ($gameActors.actor(this.actorId()).isWtypeEquipped(2) === true) { -1; if (this.actorId().equips()[0].durability <= 0) {this.actorId().durabilityBreakItem(this.actorId().equips()[0]);} }
if ($gameActors.actor(this.actorId()).isWtypeEquipped(2) === true) { return -1; }
However, all of these turns the weapon in question into unbreakable equipment, rather than lowering it.
Are there any issues with the eval, or an alternative way to do this?
For example. Using magical attacks when using sword does not affect the durability, but using magical attacks when using staves does affect the durability.
I tried using a few evals in the Magical Action Parameter:
if ($gameActors.actor(this.actorId()).isWtypeEquipped(2) === true) { -1; }
if ($gameActors.actor(this.actorId()).isWtypeEquipped(2) === true) { -1; if (this.actorId().equips()[0].durability <= 0) {this.actorId().durabilityBreakItem(this.actorId().equips()[0]);} }
if ($gameActors.actor(this.actorId()).isWtypeEquipped(2) === true) { return -1; }
However, all of these turns the weapon in question into unbreakable equipment, rather than lowering it.
Are there any issues with the eval, or an alternative way to do this?
