Hello everyone,
I am in the process of creating a Mod which adds numerous magical items to the game and am looking for some help. These items, when equipped, add abilities to the player (in the form of a Lesser Power) which mimic various standard and custom spell effects.
For example:
Ring of Firebolt - the player can launch a Fire Bolt (per the spell)
Ring of Fire Cloak - the player can activate a Fire Cloak (per the spell) for 1m or so
Amulet of Healing - the player can heal themselves
My challenge is that I would like to balance these magic items by only letting the player use the power a certain # times per day, or have to wait a certain # seconds or minutes between uses.
My first question is, does anyone know how to temporarily "disable" a Lesser Power? Ideally, I'd just like to have it greyed out in the magic menu and when you press your "activate" button, nothing happens.
My next question is, how might I go about timing the use of an item?
I have tried a couple of methods, with only limited success:
1) used a timed magic effect - when the Lesser Power's spell is cast, in addition to the Item's main effects (like a firebolt, cloak, or healing), have a "recharge" magic effect on the player. If this recharge effect is present, do not do the item's main effects. This works well if the item only effects the player (healing, cloak, etc) - although the "spell" is still cast - it just does nothing. This does not work if the magic effect is targeted.
2) use a script and global variables - the idea being when the Lesser Power is cast, a global variable is updated to the current time. If not enough time has past, do not fire the spell. I have not got this to work as my scripting talents are very rusty. I have not been able to detect when the spell is cast (and thus set the variables), let alone figure out how to prevent the spell from being cast in the first place!
Does anyone have any ideas or experience with this?
The community's help is much appreciated!