Healing Spell - Need Help

Sarj14

New Member
Reaction score
9
I decided to begin spell making. I looked at a tutorial and made my first spell, Holy Orb. Now, what it does is heals everyone for 150 within 400 yard radius. I tested it, works great. My second test, noticed a problem. It also heals enemies! So how would I fix this... I made it so it had a condition with the unit group to only heal allies that belong to the casting unit. It didn't work.

Heres what I have.

Trigger:
  • Holy Orb
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Healing Orb
    • Actions
      • Unit Group - Pick every unit in (Units within 400.00 of (Position of (Casting unit))) and do (Actions)
        • Loop - Actions
          • Unit - Set life of (Picked unit) to ((Life of (Picked unit)) + 100.00)
          • Special Effect - Create a special effect attached to the overhead of (Triggering unit) using Abilities\Spells\Undead\ReplenishHealth\ReplenishHealthCasterOverhead.mdl
          • Special Effect - Create a special effect attached to the chest of (Picked unit) using Abilities\Spells\Undead\ReplenishHealth\ReplenishHealthCaster.mdl



What would I need to add to make it so it doesn't heal enemies.
 

Komaqtion

You can change this now in User CP.
Reaction score
469
Here's a (GUI) leakless version, which will only target allies (And also only alive) units:
Trigger:
  • Heal Allies
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Animate Dead
    • Actions
      • Set TempPoint = (Position of (Triggering unit))
      • Set TempGroup = (Units within 400.00 of TempPoint matching ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an ally of (Owner of (Triggering unit))) Equal to True)))
      • Unit Group - Pick every unit in TempGroup and do (Actions)
        • Loop - Actions
          • Unit - Set life of (Picked unit) to ((Life of (Picked unit)) + 100.00)
          • Special Effect - Create a special effect attached to the overhead of (Triggering unit) using Abilities\Spells\Undead\ReplenishHealth\ReplenishHealthCasterOverhead. mdl
          • Special Effect - Destroy (Last created special effect)
          • Special Effect - Create a special effect attached to the chest of (Picked unit) using Abilities\Spells\Undead\ReplenishHealth\ReplenishHealthCaster.mdl
          • Special Effect - Destroy (Last created special effect)
      • Custom script: call DestroyGroup(udg_TempGroup)
      • Custom script: call RemoveLocation(udg_TempPoint)
 

Bird

Ultra Cool Member
Reaction score
29
Another option: Your first Loop action will be an If/Then Multiple Actions.
Do a Conditional to see If the Picked Unit is a Owned by an Ally. You can also add/remove Conditionals easily later on - like, Unit is a Structure equal to False. Unit is Alive. etc etc. There are a lot of Conditionals you won't think of right away. Then you put all your Actions under True. And nothing under False.
 

BRUTAL

I'm working
Reaction score
118
>TempPoint and TempGroup variables, are they Array Variables or not?

Yes they are variables.
Do you see arrays beside the variable names? :p
 

Sarj14

New Member
Reaction score
9
What I ment was if they should be checked as Array or not.

Edit: Nevermind, they aren't.

Edit: Komaqtion, worked perfectly! +rep!
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top