| 08-17-2004, 01:54 AM | #1 |
I'm having trouble with a trigger. I created an ability based off of cripple and i set it to use negative damage reduction to also give the hero positive damage, and slow its movement speed. I made a trigger increase the units size and health. Code:
ability
Events
Unit - A unit Begins casting an ability
Conditions
(Ability being cast) Equal to Growth
Actions
Animation - Change (Casting unit)'s size to (300.00%, 300.00%, 300.00%) of its original size
Set pic1health = (Max life of (Triggering unit))
Wait 120.00 seconds
Animation - Change (Casting unit)'s size to (100.00%, 100.00%, 100.00%) of its original sizeThe problem is, pic1health is a Real variable. Now I wanted to do a: Advanced Unit - Change Unit's Max Life because i wanted to double the hit points of the casting unit. The trigger is For triggering unit, increase max life by x. I wanted to place pic1health in the place of X, but the function only allows integer variables, when integer variables cannot hold data for units max health, so I'm in a bind. Any help? Or should I base it off of another ability and take an alternate route? |
| 08-17-2004, 01:56 AM | #2 |
Why don't base it off of bloodlust, and just have the unit size there, remove the attack speed stuff. |
| 08-17-2004, 02:00 AM | #3 |
Becuase I would still have the same problem involving hit points. |
| 08-17-2004, 03:05 AM | #4 |
I may have read wrong but i think I see your problem. Use Conversion- Convert integer to real, or Convert real to integer, whichever solves your problem. It will tell you to set the integer and the real, do that, and done. |
| 08-17-2004, 04:32 AM | #5 |
avatar does everything you want. |
| 08-17-2004, 07:24 AM | #6 | |
Quote:
Question.. where in the trigger editor do you see that??? I can't seem to find it. And Tiki, I know about Avatar, however avatar increases Hit points by a set integer. I want to increase HP by a percentage of its current HP, therefore I'd still have to use the trigger I'm having trouble with, and be stuck right back here where I am. |
| 08-17-2004, 07:40 AM | #7 |
sorry i didnt know it was a percentage. |
| 08-17-2004, 07:45 AM | #8 |
Here's what you do. Make a interger variable. Make it set to the heroes current life. Make another interger variable, which takes the number the first variable calculated and then make it times that number by .05 for 5%, .1 for 10%, .15 for 15%, and .2 for 20% and this goes on till 100% and such. Hope I helped. |
| 08-17-2004, 09:33 AM | #9 | |
Quote:
I'm not exactly sure what you mean. If I set it to his current life, then if he is at only about 20 HP, its not gonna give a very big bonus. |
| 08-17-2004, 12:20 PM | #10 | |
Quote:
I think what he's trying to say is replace the percentage variable you have now with a with an integer percentage like 50% = 0.5 look at critical strike's percentage, you might see what i'am on about |
| 08-17-2004, 02:14 PM | #11 | |
Quote:
|
| 08-18-2004, 12:16 AM | #12 |
It's an integer, AND a real function. For integer it's convert real to integer, for real it's convert integer to real. |
