You can only bump once in 24 hours btw.
Can't you just add mana to a unit based on their intelligence?
Just make a periodic trigger that takes their int and gives them mana if they have the buff.
Trigger:
- Hashtable - Clear TempHash
Now it's even less MUI... You are loading and saving one value for every unit, not one value per unit, but just one value overall... So now if 30 people cast this spell, they each only get one tick of it...
EDIT: Here, since you're taking forever reading that global hashtable thread, I'ma fix this for you:
Trigger:
- Int Regen Init
- Events
- Map initialization
- Conditions
- Actions
- Hashtable - Create a hashtable
- Set TempHash = (Last created hashtable)
Trigger:
- Int Regeneration Hash
- Events
- Unit - A unit Starts the effect of an ability
- Conditions
- (Ability being cast) Equal to Your_Ability
- Actions
- Hashtable - Save 30 as 1 of Key (Triggering unit) in TempHash
- Unit Group - Add (Triggering unit) to Periodic_Group
- Trigger - Turn on Int Periodic Hash<gen>
Trigger:
- Int Periodic Hash
- Events
- Time - Every 1.00 seconds of game time
- Conditions
- Actions
- Set TempBool = False
- Unit Group - Pick every unit in Periodic_Group and do (Actions)
- Loop - Actions
- Set TempBool = True
- Set TempInt = (Load 1 of Key (Picked unit) from TempHash)
- Hashtable - Save (TempInt - 1) as 1 of Key (Picked unit) in TempHash
- Unit - Set mana of (Picked unit) to ((Mana of (Picked unit)) + ((Real((Intelligence of (Picked unit) (Exclude bonuses)))) x (0.05 x (Real((Level of Your_Ability for (Picked unit)))))))
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (TempInt - 1) Equal to 0
- Then - Actions
- Unit Group - Remove (Picked unit) from Periodic_Group
- Else - Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- TempBool Equal to False
- Then - Actions
- Hashtable - Clear TempHash
- Trigger - Turn off (This trigger)
- Else - Actions
I have 1 problem with this trigger, the "Cooldown" on the spell does not work if this trigger is active . I based my spell on Roar