• 🏆 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!

Restoring Hp Based on Missing Hp

Status
Not open for further replies.
Level 1
Joined
Apr 12, 2020
Messages
5
Hello!

I am having trouble with this: I want to heal each unit in a unit group for 15% of their missing hp. However, after testing it a bit, war3 says my max life is always same as life of a unit?

What am I doing wrong?

  • Apply Healing
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Blood
    • Actions
      • Set xxx_bloodloc = (Position of (Item being manipulated))
      • Set xxx_drawbloodgroup = (Units within 600.00 of xxx_bloodloc matching (((Matching unit) belongs to an ally of (Owner of (Triggering unit))) Equal to True))
      • Unit Group - Pick every unit in xxx_drawbloodgroup and do (Actions)
        • Loop - Actions
          • Unit - Set life of (Picked unit) to ((Life of (Picked unit)) + (0.15 x ((Max life of (Picked unit)) - (Life of (Picked unit)))))
          • Special Effect - Create a special effect attached to the chest of (Picked unit) using Abilities\Spells\Human\Heal\HealTarget.mdl
          • Special Effect - Destroy (Last created special effect)
      • Custom script: call RemoveLocation(udg_xxx_bloodloc)
      • Custom script: call DestroyGroup(udg_xxx_drawbloodgroup)
 
Level 1
Joined
Apr 12, 2020
Messages
5
I checked percentage life as well, it always returns 100.000, except when unit is very low on hp. Really don't know whats going on. Corrupt files?
 
Level 1
Joined
Apr 12, 2020
Messages
5
Thank you I figured it out...after so many tests and debugs, I forgot to remove heal from my consumable.
 
Status
Not open for further replies.
Top