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

[Trigger] Need Tutorial about Healing Abilities

Status
Not open for further replies.
Level 6
Joined
May 11, 2013
Messages
205
Hello! I want to know how i can make for example Holy Light. Each Heal must to be shown with green values in game. I searched in tutorials but i haven't found any tutorial about how to make this happen. Please show me how
 

Chaosy

Tutorial Reviewer
Level 40
Joined
Jun 9, 2011
Messages
13,183
  • Heal
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Some Ability
    • Actions
      • -------- heals for 100 --------
      • Unit - Set life of (Target unit of ability being cast) to ((Life of (Target unit of ability being cast)) + 100.00)
      • -------- text --------
      • Floating Text - Create floating text that reads +100 above (Target unit of ability being cast) with Z offset 0.00, using font size 10.00, color (0.00%, 100.00%, 0.00%), and 0.00% transparency
      • Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
      • Floating Text - Change (Last created floating text): Disable permanence
      • Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
      • Floating Text - Change the fading age of (Last created floating text) to 1.00 seconds
 
Level 6
Joined
May 11, 2013
Messages
205
Thank you, for this helpful tutorial, but how em i suppose to continue this trigger if my holy light has more than 3 levels? I just have to repeate the same or what?
I repeat the steps and it worked, but now i have to face this problem.
 
Level 25
Joined
Sep 26, 2009
Messages
2,378
There is a function which returns level of ability being cast (it's an integer number).
You just calculate the amount via a formula.
For example if your Holy Light heals 100/150/200, then the formula is basically 50 + ( [level of ability being cast] * 50)
Level 1: 50 + (1*50) = 100
Level 2: 50 + (2*50) = 150
Level 3: 50 + (3*50) = 200.

In many cases, you can find the formula easily. It may be harder for some - e.g. Holy Light heals 100/150/250.

Of course if the spell heals like this: 100/139/232.25, then you may have pretty hard time figuring out the formula, in which case it may simply be batter to save each amount of heal in an array and set the values upon map initialization.

----
Health of a unit is a real number (number with decimal point - e.g. '10.850'), however the function for finding level of ability returns an integer number (number without decimal point - e.g. '5').
So when you are setting up how much you want to heal unit (when you're setting the real number), also choose the function called 'Conversion - Convert integer into real' which does exactly what you want - it converts an integer number into real number.

The function for finding out level of ability is in list of functions for integer number and is called something like 'Unit - Level of ability for unit'.
 
Level 6
Joined
May 11, 2013
Messages
205
Solved thanks to Waterknight. Not only that Holy Light shows exact healing points with green texts in game, but also shows damaged dealed to the undead targets with yellow color.
 

Chaosy

Tutorial Reviewer
Level 40
Joined
Jun 9, 2011
Messages
13,183
if target is an enemy make the color yellow, else make it green.

  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • ((Target unit of ability being cast) belongs to an ally of (Owner of (Triggering unit))) Equal to True
    • Then - Actions
      • -------- green --------
    • Else - Actions
      • -------- yellow --------
 
Level 6
Joined
May 11, 2013
Messages
205
Okay, explain how to complete "Death Coil" spell, while rewriting trigger based on holy light(Credits to Waterknight). The only problem with coil is, that its missile. Nearby Units receive heal/damage faster before animation missile of Death Coil reach its target! Waterknight said its something about the caster. How to solve it? This is the Holy Light trigger

  • Untitled Trigger 001
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Holy Light
    • Actions
      • Set Holy_Light_Heals[1] = 200
      • Set Holy_Light_Heals[2] = 400
      • Set Holy_Light_Heals[3] = 600
      • Set Holy_Light_curHeal = (Level of Holy Light for (Triggering unit))
      • Set Holy_Light_curHeal = Holy_Light_Heals[Holy_Light_curHeal]
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Target unit of ability being cast) belongs to an enemy of (Owner of (Triggering unit))) Equal to False
        • Then - Actions
          • Unit - Set life of (Target unit of ability being cast) to ((Life of (Target unit of ability being cast)) + (Real(Holy_Light_curHeal)))
          • -------- text --------
          • Floating Text - Create floating text that reads (+ + (String(Holy_Light_curHeal))) above (Target unit of ability being cast) with Z offset 0.00, using font size 15.00, color (0.00%, 100.00%, 0.00%), and 0.00% transparency
          • Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
          • Floating Text - Change (Last created floating text): Disable permanence
          • Floating Text - Change the lifespan of (Last created floating text) to 3.00 seconds
          • Floating Text - Change the fading age of (Last created floating text) to 1.00 seconds
        • Else - Actions
          • Set Holy_Light_curHeal = (Holy_Light_curHeal / 2)
          • Unit - Cause (Triggering unit) to damage (Target unit of ability being cast), dealing (Real(Holy_Light_curHeal)) damage of attack type Spells and damage type Unknown
          • Floating Text - Create floating text that reads (<Empty String> + (String(Holy_Light_curHeal))) above (Target unit of ability being cast) with Z offset 0.00, using font size 15.00, color (100.00%, 100.00%, 0.00%), and 0.00% transparency
          • Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
          • Floating Text - Change (Last created floating text): Disable permanence
          • Floating Text - Change the lifespan of (Last created floating text) to 3.00 seconds
          • Floating Text - Change the fading age of (Last created floating text) to 1.00 seconds



P.S I also wanna know how the trigger will look working with Chain Heal(Healing Wave)
 
Status
Not open for further replies.
Top