BlueMirage
Trust, but doubt.
- Reaction score
- 39
I'm sure this has been asked tons of times, but I'ma take a different approach.
A lot of people say that the manacost of a skill is something that you can't retrieve when it's been cast. I was wondering if one of these two theories might work?
1: Use "A unit starts the effect of an ability". Save the unit and its mana to some variable, start a zero-timer then measure its mana.
2: For every unit in the map, create a trigger with the event "TriggerRegisterUnitManaEvent()", checking whenever the mana of the unit changes to ">= 0". Save the unit and its current to a hashtable with the parent key being the trigger's HandleId. For the actions, update the mana variable and set another that is equal to the difference between the old mana and the new mana. A "A unit starts the ability of a spell" could then retrieve this difference and it should be equal to the manacost of the skill.
Would any of these two work?
A lot of people say that the manacost of a skill is something that you can't retrieve when it's been cast. I was wondering if one of these two theories might work?
1: Use "A unit starts the effect of an ability". Save the unit and its mana to some variable, start a zero-timer then measure its mana.
2: For every unit in the map, create a trigger with the event "TriggerRegisterUnitManaEvent()", checking whenever the mana of the unit changes to ">= 0". Save the unit and its current to a hashtable with the parent key being the trigger's HandleId. For the actions, update the mana variable and set another that is equal to the difference between the old mana and the new mana. A "A unit starts the ability of a spell" could then retrieve this difference and it should be equal to the manacost of the skill.
Would any of these two work?