I like to make a very complicated spell (to me), I called it "Fusion", my concept is: -Target a non-hero friendly unit -Search for a random friedly unit in 1000 AoE, and move it to the Target -Create a new unit, removing the other 2, with 75% HP of the 1st target and 50% HP of the 2nd target. -Create a floating text saying "FUSION!" (Done)
event, condition here... action: set FusionUnit[1] = spell target unit
there is a unitgroup action that picks a random unit (matching condition) in range of point. ->use that to pick the random unit store it in a variable (FusionUnit[2])
move FusionUnit[2] to (position of FusionUnit[1])
set FusionHP[1] = life of FusionUnit[1] * 0.75 set FusionHP[2] = life of FusionUnit[2] * 0.5
remove FusionUnit[1] remove FusionUnit[2]
create the new unit
and here is what i don't understand: " with 75% HP of the 1st target and 50% HP of the 2nd target."
That's my problem, when I create a new unit. The spell is called Fusion, the concept is create a new unit having 75% HP of the FusionTarget[1] and 50% HP of the FusionTarget[2].Example: -Footman (100 HP) Fused with -Sorceress (200 HP) Results in -Fusion (175 HP, having 75% HP of Footman, and 50% HP of sorceress)
ahh, yes! understood. the anctient proble of setting the unit's max life/mana... well there is no way to set its life to a given value, exept this one by Blade.dk :
download the map at the end of the comment! it's some kind of bug (bless), i don't know. if you don't want to use this, then there stays the horrible solution: the fusion unit must have 99999 life initially, then set its current life to the given value...
The thing is that I don't know NOTHING of JASS, but I'll try. I was thinking in this: Create a fusion unit per each available combination (foot-treant, treant-druid,etc) calculating 75%/50% of each. A pack of fusion units.