| 07-18-2004, 09:44 PM | #1 |
Working on a triggered spell that would be channeled. While its active all units around the caster have a buff that when they cast a spell an amount of damage based on either the casting cost of the spell or the damage/effect level of the spell. The only way i can think of would be to - everytime a unit casts an ability in this area It would be set to an unoccupied slot in a large array unit variable, then after waiting the casting time it would take the unit's current mana again. IF I were to do that could I see an example of a loop that would check to see if a particular slot in an array was filled and if so add 1 to the number and check again? But the real question is because that's an all around bad idea (you could chug a mana pot while you cast and the hero using this ability would then be healed negatively) is there another way to find the mana cost of any given spell via trigger? Sorry if I sound like an idiot who doesn't know jass and is just wasting your time : /. |
| 07-18-2004, 10:06 PM | #2 |
Your spell sounds a lot like mana flare. So where is the difference that makes it worth triggering ? The actual implementation should rather use either gamecache or the custom values of the units to store the info. |
| 07-19-2004, 12:43 AM | #3 |
If I could base it off of mana flare it would be wonderful but that would require some serious changing of the spell in hardcore programming. What i want is for the CASTER of 'manaflare' to gain health based on the units casting in the area. Unless there's a way to detect the manaflare effect hitting a unit refer back to my previous post to see the problem. |
| 07-19-2004, 06:15 AM | #4 |
ok, then you need triggering. But it will not be simple as there is no direct way to find out mana cost. What you can do is using the different events of casting. Check if at the point when the "starts the effect of an ability" event fires the mana cost has already been removed. If not, then it is likely fired after a timer of 0 seconds so you could check the mana reduction between these two points. If the mana is already removed then check between the events "starts casting" and "starts the effect". To store the mana value (so you can compare them), you can either use storing it in the custom data value of the unit or use the gamecache together with the return bug. |
