| 09-08-2004, 01:45 AM | #1 |
I am trying to create a spell based off drunken haze that causes a unit to take damage when it uses an ability, based on how much mana is used (Level 1- 1 damage per point of mana used, Level 2- 1.5, etc.). Is there any way I can track the amount of mana used when any spell is cast by any unit and cause it to take damage equal or multiplied by that amount? |
| 09-08-2004, 03:01 AM | #2 |
ok, this is possible. the obvious and reliant yet extremely ineffecient way is to make each skill and depending on what skill it is deal the damage. but.. there are a few different event handlers for casting spells. #1 Unit begins casting an ability #2 Unit finishes casting an ability #3 Unit starts the effect of an ability #4 Unit finishes the effect of an ability at least im pretty sure those are them. now im not totaly sure but, Unit starts the effect of the ability fires before stuff like mana reduction. so it may be possible to detect the mana of the hero as soon as it starts the effect and then wait a 1-2 seconds and then get the new mana, subtract the values, and thats your reduced mana value. This is all relying on the fact that mana is lost sometime after the unit starts the effect of an ability |
