What you could do, is when they type the message, save the unit's current mana in a variable, wait one seconds, set variable manregen = current mana, set unit's mana back to the mana variable+manaregen, display message. Only problem is it takes a second to get results and the unit will have no mana for 1 second.
Edit:
I've refined my method of doing it - it now takes only 0.01 seconds and is completely accurate. It is also completely MPI and leakfree (I think, I'm not great at leak checking GUI). The only thing that could go wrong is if the unit has more mana regeneration than its maximum mana, when it will say the mana regeneration rate is equal to its maximum mana. It takes 3 triggers - initialization, the trigger which detects the chat message and starts the timer, and the trigger which gets the mana regeneration rate and displays it to the player who typed the message. Enjoy!
-
init
-
Events
-
Conditions
-
Actions
-
Set Units[1] = <Player 1's Unit>
-
Set Units[2] = <Player 2's Unit>
-
Set Units[3] = <Player 3's Unit>
-
Set Units[4] = <Player 4's Unit>
-
Set Units[5] = <Player 5's Unit>
-
Set Units[6] = <Player 6's Unit>
-
Set Units[7] = <Player 7's Unit>
-
Set Units[8] = <Player 8's Unit>
-
Set Units[9] = <Player 9's Unit>
-
Set Units[10] = <Player 10's Unit>
-
Set Units[11] = <Player 11's Unit>
-
Set Units[12] = <Player 12's Unit>
-
manregen1
-
Events
-
Player - Player 1 (Red) types a chat message containing -mr as An exact match
-
Player - Player 2 (Blue) types a chat message containing -mr as An exact match
-
Player - Player 3 (Teal) types a chat message containing -mr as An exact match
-
Player - Player 4 (Purple) types a chat message containing -mr as An exact match
-
Player - Player 5 (Yellow) types a chat message containing -mr as An exact match
-
Player - Player 6 (Orange) types a chat message containing -mr as An exact match
-
Player - Player 7 (Green) types a chat message containing -mr as An exact match
-
Player - Player 8 (Pink) types a chat message containing -mr as An exact match
-
Player - Player 9 (Gray) types a chat message containing -mr as An exact match
-
Player - Player 10 (Light Blue) types a chat message containing -mr as An exact match
-
Player - Player 11 (Dark Green) types a chat message containing -mr as An exact match
-
Player - Player 12 (Brown) types a chat message containing -mr as An exact match
-
Conditions
-
Actions
-
Set mana[(Player number of (Triggering player))] = (Mana of Units[(Player number of (Triggering player))])
-
Unit - Set mana of Units[(Player number of (Triggering player))] to 0.00
-
Countdown Timer - Start ManaTimers[(Player number of (Triggering player))] as a One-shot timer that will expire in 0.01 seconds
-
manaregen2
-
Events
-
Time - ManaTimers[1] expires
-
Time - ManaTimers[2] expires
-
Time - ManaTimers[3] expires
-
Time - ManaTimers[4] expires
-
Time - ManaTimers[5] expires
-
Time - ManaTimers[6] expires
-
Time - ManaTimers[7] expires
-
Time - ManaTimers[8] expires
-
Time - ManaTimers[9] expires
-
Time - ManaTimers[10] expires
-
Time - ManaTimers[11] expires
-
Time - ManaTimers[12] expires
-
Conditions
-
Actions
-
For each (Integer A) from 1 to 12, do (Actions)
-
Loop - Actions
-
Set temp_playergroup = (Player group((Player((Integer A)))))
-
Custom script: set udg_temp_bool = GetExpiredTimer() == udg_ManaTimers[bj_forLoopAIndex]
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Then - Actions
-
Set manaregen = ((Mana of Units[(Integer A)]) x 100.00)
-
Unit - Set mana of Units[(Integer A)] to mana[(Integer A)]
-
Game - Display to temp_playergroup the text: (Your mana regeneration rate is + ((String(manaregen)) + .))
-
Custom script: call DestroyForce(udg_temp_playergroup)
-
Custom script: exitwhen true
-
Else - Actions
If you can't get it to work, PM me and I'll send you my test map.