Stats Component Overview
Last updated
Last updated
It has two timers that react on two events Spell Cast Event: When a spell is cast it reduces the mana, based on the spell cost and starts a timer to slowly restore mana
On Take Any Damage Event: When the owner takes damage, it reduces the HP by the damage amount and starts a timer to slowly restore HP, It also fires an event that can be listened to when the player dies
Refresh Mana
Used by the timer, it restores mana over time by the gain rate defined in the settings
Refresh Health
Used by the timer, it restores hp over time by the gain rate defined in the settings
Add mana (Server)
This can be used from outside to add mana to the owner's pool, could be for example if the owner uses a mana potion then this event can be called from the potion logic
Add HP (Server)
This can be used from outside to add HP to the owner's pool, could be for example if the owner uses a Health potion then this event can be called from the potion logic
Remove mana (Server)
This can be used from outside to remove mana from the owner's pool, could be for example if the owner affected by a mana burn spell or trap, then this event can be called from the logic
Remove HP (Server)
This can be used from outside to remove HP from the owner's pool, could be for example if the owner affected by a damage tick event (burning) then this function can be called from that logic