• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Please help!

Status
Not open for further replies.
Level 6
Joined
Oct 26, 2005
Messages
190
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)

Help needed and welcome
 
Level 11
Joined
Jul 12, 2005
Messages
764
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."

create the floating text...
 
Level 6
Joined
Oct 26, 2005
Messages
190
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)
 
Level 11
Joined
Jul 12, 2005
Messages
764
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 :

http://www.wc3jass.com/viewtopic.php?t=2652

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... :?

no other suggestions.
 
Level 6
Joined
Oct 26, 2005
Messages
190
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.
 
Status
Not open for further replies.
Top