• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Healing Attack

Status
Not open for further replies.
Level 14
Joined
Jul 12, 2011
Messages
1,371
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