Electroblob's Wizardry

Electroblob's Wizardry

18M Downloads

[Code Request] Mana use event

itsmeow opened this issue ยท 4 comments

commented

Someone I know wants me to make an addon for this mod that adds an enchant for armor that reduces total mana use in general, but there's no event for mana use. It's hardcoded. I simply want a cancelable event with non-final mana value (a pre event for before armor reduction is applied and a post for after).

commented

I was looking at this exact thing just yesterday, in fact. I'm converting cost over to be part of the modifiers system, so you'll be able to edit it in SpellCastEvent.Pre (this will also be how the armour does it, so you'll be able to use event priority to control whether your changes are applied before or after the armour reductions).

In the meantime, you can achieve the same result by modifying the wand's durability in SpellCastEvent.Post. Obviously that's not ideal but it'll work for now!

commented

Nevermind that. I am actually blind.

commented

The cost variable is private.

commented

Cost modifiers have been implemented in the 4.2.0 release, use these in conjunction with SpellCastEvent.Pre to modify mana use.