| 04-03-2007, 10:37 PM | #1 |
Hi! I have a problem with a skill of mine. The skill is based on devour. It should devour the unit like the original but it shall have more effects. Like adding an exact % (which will change with lvls) of the target unit's max hp to the max hp of the casting unit. So far I messed myself a lot with triggers yet I can't find the way to do this I ask for your help |
| 04-03-2007, 10:45 PM | #2 |
http://www.wc3jass.com/viewtopic.php?t=2652 this allows you to modify the max health and mana of units. |
| 04-04-2007, 01:10 AM | #3 |
Isn't there a way to do it without using JASS? |
| 04-04-2007, 01:32 AM | #4 |
I think he means to say when he eats the target he gains a % of it's max hp. It's just simple triggering and can be done in GUI. Just set a real variable to the unit's max hp then multiply by 0.10, then add that value to the caster's hp. |
| 04-04-2007, 01:36 AM | #5 | |
Quote:
|
| 04-04-2007, 01:54 AM | #6 |
Earth Fury's right here. Let's say it's set to 10%. The hero has 500 max hp, eats a unit with 500 max hp and boooom he now has (10x500/100=50) 550 max hp yet the idea of using JASS doesn't suit me at all. Isn't there an easier way? ![]() |
| 04-04-2007, 02:49 AM | #7 |
Stick the code i linked to in your maps header, make the proper abilitys, and use this single custom script line to change a units max life: JASS:call SetUnitMaxState(GetTriggerUnit(), UNIT_STATE_MAX_LIFE, 123456) you can replace GetTriggerUnit() (Triggering Unit is the GUI equivilent) with a global variable of type unit. (globals, in jass, have the prefix "udg_", so "myInteger" becomes "udg_myInteger") "123456" is the new maximum life of the unit. You can also use a global here, or a global and basic math, like: (10*udg_UnitsLife/100) + udg_OtherUnitsLife JASS:call SetUnitMaxState(udg_OtherUnit, UNIT_STATE_MAX_LIFE, (10*udg_UnitsLife/100) + udg_OtherUnitsLife) |
| 04-04-2007, 10:45 AM | #8 |
Thank you. I'll try it as soon as I get my hands on my PC again (I wont be home for a shot period of time) Once again thanks ![]() |
