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

Healing Attack

Status
Not open for further replies.
Level 14
Joined
Jul 12, 2011
Messages
1,370
Hello everyone!
I'making a unit's passive spell that heals only the friendly units he attacks. I've managed to make the healing part but it works even in the hostile ones. Can you help me?
Script:
  • Healing Shot
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Unit-type of (Attacking unit)) Equal to Footman
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (((Attacked unit) belongs to an ally of (Owner of (Attacked unit))) Equal to True) and (((Attacked unit) belongs to an enemy of (Owner of (Attacked unit))) Equal to False)
        • Then - Actions
          • Wait 1.00 seconds
          • Unit - Set life of (Attacked unit) to ((Life of (Attacked unit)) + 80.00)
        • Else - Actions
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
The condition should be;
  • Conditions
    • ((Triggering unit) belongs to an ally of (Owner of (Attacking unit))) Equal to True
Also, you should do this via Damage Detection System - by using that event, players can abuse it by spamming 'S' (Stop) button to heal repetitively without hitting the unit.

It should turn out something like this;
  • Melee Initialization
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • ((Triggering unit) belongs to an ally of (Owner of (Attacking unit))) Equal to True
    • Actions
      • Unit - Set life of (Triggering unit) to ((Life of (Triggering unit)) + 80.00)
In this case, (Triggering unit) == (Attacked unit)
 
Level 3
Joined
Jan 5, 2011
Messages
25
Also, not quite your problem (that seems to be solved) but a good ideia would be for the spell to hit enemies BUT not healing and yes killing!! Like a Improved Ver. of the Paladin's Holy Light or something...
 
Status
Not open for further replies.
Top