Chain Heal Spell

Manee

New Member
Reaction score
20
How do i make this spell using gui?:

Whenever a unit near(500 AoE) the Wizard is attacked, there is a chance that the wizard will cast chain heal on that unit
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
I havent removed the leaks in this trigger...

Code:
Untitled Trigger 001
    Events
        Unit - A unit Is attacked
    Conditions
        (Distance between (Position of (Attacked unit)) and (Position of 'YourWizard')) Less than or equal to 500.00
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Random integer number between 1 and 100) Less than or equal to 10
            Then - Actions
                Unit - Create 1 'Dummy' for (Owner of (Triggering unit)) at (Position of 'YourWizard') facing Default building facing (270.0) degrees
                Unit - Order (Last created unit) to Human Priest - Heal (Triggering unit)
            Else - Actions
 

Draphoelix

It's not the wintercold that's killing me
Reaction score
132
Give the Wizard an aura. Endurance Aura or something. Then do a trigger:


A unit is attacked

Attacked unit has buff Endurance Aura

Random interger between 1 to 10 less than or equal to 1
Create 1 dummy
add Healing Wave
Order last created to cast Orc healing wave etc


Edit: Accname I think that leaks (I mean the condition one). Using aura would be better.
 

Cheddar

This is the way it was meant to be.
Reaction score
126
Code:
Your Ad Could Be Here
    Events
        Unit - A unit Is attacked
    Conditions
    Actions
        Set GeneralPoint = (Position of (Attacked unit))
        Set GeneralGroup = (Units within 500.00 of GeneralPoint matching ((((Matching unit) belongs to an ally of (Owner of (Attacked unit))) Equal to True) and ((Level of Healing Spray for (Matching unit)) Not equal to 0)))
        Unit Group - Pick every unit in GeneralGroup and do (Actions)
            Loop - Actions
                Unit - Create 1 Shade for (Owner of (Attacked unit)) at (Position of (Picked unit)) facing Default building facing degrees
                Unit - Add a 4.00 second Generic expiration timer to (Last created unit)
                Unit - Add Healing Wave (Neutral Hostile) to (Last created unit)
                Unit - Set level of Healing Wave (Neutral Hostile) for (Last created unit) to (Level of Healing Spray for (Picked unit))
                Unit - Order (Last created unit) to Orc Shadow Hunter - Healing Wave (Attacked unit)
        Custom script:   call RemoveLocation(udg_GeneralPoint)
        Custom script:   call DestroyGroup(udg_GeneralGroup)

Whoops... uh...

This goes off any time a unit within a 500 range of someone who has learned Healing Spray is attacked. If all goes well, it should be healed by every unit that has Healing Spray, for example:

Unit A is attacked
Unit B has level 2 Healing Spray
Unit C has level 3 Healing Spray

Unit A should be healed by a level 2 and level 3 Healing Wave.

If you want a chance to pull it off, use (Set RandomInteger) equal to (Random number between 1 and 100), choose your percentage, and use the condition (If RandomInteger is less than or equal to (Percentage chance you have here... if it's 10%, use 10) Then (Actions I have provided) Else (Bleh)
 

Manee

New Member
Reaction score
20
Code:
Set GeneralGroup = (Units within 500.00 of GeneralPoint matching ((((Matching unit) belongs to an ally of (Owner of (Attacked unit))) Equal to True) and ((Level of Healing Spray for (Matching unit)) Not equal to 0)))

correct me if im wrong but this is what i understand of this code :

the wizards would only cast chain heal on themselves if attacked and not others if they too are attacked?
 

Cheddar

This is the way it was meant to be.
Reaction score
126
GeneralGroup picks everyone who has the ability and adds them to the people who are providing heals.

I think the wizard would heal himself, provided he is an ally of himself :p
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
no he would not heal himself, he is not targeted as an ally of himself
 

Manee

New Member
Reaction score
20
its not working

Code:
Chain Heal
    Events
        Unit - A unit Is attacked
    Conditions
    Actions
        Set TempPoint = (Position of (Attacked unit))
        Set ChainHealGroup = (Units within 500.00 of TempPoint matching ((((Matching unit) belongs to an ally of (Owner of (Attacked unit))) Equal to True) and (((Level of Chain Heal dummy for (Matching unit)) Equal to 1) and ((Current research level of Chain Heal  for (Owner of (Matchin
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Random integer number between 1 and 100) Less than or equal to 50
            Then - Actions
                Set TempPoint2 = (Position of (Picked unit))
                Unit Group - Pick every unit in ChainHealGroup and do (Actions)
                    Loop - Actions
                        Unit - Create 1 Chain Heal Dummy for (Owner of (Attacked unit)) at TempPoint2 facing Default building facing degrees
                        Unit - Add a 4.00 second Generic expiration timer to (Last created unit)
                        Unit - Add Chain Heal  to (Last created unit)
                        Unit - Order (Last created unit) to Orc Shadow Hunter - Healing Wave (Attacked unit)
                        Custom script:   call RemoveLocation (udg_TempPoint)
                        Custom script:   call RemoveLocation (udg_TempPoint2)
                        Custom script:   call DestroyGroup (udg_ChainHealGroup)
            Else - Actions
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
why do you set temppoint2 to position of picked unit BEFORE you pick units? i guess it wont work. And you shouldnt destroy temppoint1 in your unit loop but afterwards
 

Manee

New Member
Reaction score
20
"This goes off any time a unit within a 500 range of someone who has learned Healing Spray is attacked. If all goes well, it should be healed by every unit that has Healing Spray"

uh, i've just noticed this now...

i don't want everyone that has the ability to heal the attacked unit

instead, i want each individual to have their 5% chance of releasing the chain heal and not the whole group having a 5% chance for of releasing chain heal all at the same time

so how do i do this?

edit: nvm; problem solved
 

Manee

New Member
Reaction score
20
new question

how can i make this not go off when the wizard is dead?

Code:
Chain Heal
    Events
        Unit - A unit Is attacked
    Conditions
    Actions
        Set TempPoint = (Position of (Attacked unit))
        Set ChainHealGroup = (Units within 500.00 of TempPoint matching ((((Matching unit) belongs to an ally of (Owner of (Attacked unit))) Equal to True) and (((Level of Chain Heal dummy for (Matching unit)) Equal to 1) and (((Current research level of Chain Heal  for (Owner of (Matching Unit)) Equal to 1 and ((Matching Unit) is alive) Equal to True
        Unit Group - Pick every unit in ChainHealGroup and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Random integer number between 1 and 100) Equal to 5
                    Then - Actions
                        Set TempPoint2 = (Position of (Picked unit))
                        Unit - Create 1 Chain Heal Dummy for (Owner of (Attacked unit)) at TempPoint2 facing Default building facing degrees
                        Unit - Add a 4.00 second Generic expiration timer to (Last created unit)
                        Unit - Add Chain Heal  to (Last created unit)
                        Unit - Order (Last created unit) to Orc Shadow Hunter - Healing Wave (Attacked unit)
                        Custom script:   call RemoveLocation (udg_TempPoint)
                        Custom script:   call RemoveLocation (udg_TempPoint2)
                        Custom script:   call DestroyGroup (udg_ChainHealGroup)
                    Else - Actions
 

Manee

New Member
Reaction score
20
i mean the corpses still cast chain heal when they're not suppose to be doing anything
 

Manee

New Member
Reaction score
20
yes, when the wizards die they produce corpses like almost all other units =/
 

Expelliarmus

Where to change the sig?
Reaction score
48
Oh (corpses...), try adding If, Then , Else :
Code:
((Attacked unit) is dead) Equal to False
above all the others.
 

Manee

New Member
Reaction score
20
well the attacked unit is the one that will be healed and not necessarily the one with the chain heal ability

just to clarify, i want the wizards(units with chain heal ability) to not cast chain heal on others when they're already dead(or if they are corpses)

Code:
Set ChainHealGroup = (Units within 500.00 of TempPoint matching ((((Matching unit) belongs to an ally of (Owner of (Attacked unit))) Equal to True) and (((Level of Chain Heal dummy for (Matching unit)) Equal to 1) and (((Current research level of Chain Heal  for (Owner of (Matching Unit)) Equal to 1 and [B]((Matching Unit) is alive) Equal to True[/B]

I added the one in bold but it doesn't work
 

Expelliarmus

Where to change the sig?
Reaction score
48
Lol? I finally understand what your spell does... ^_^

Code:
(Matching Unit) is alive) Equal to True
will not refer to the wizard, in fact your trigger doesn't reference the wizard at all. Accname's trigger references 'YourWizard', which is what you need to use as a reference to (('Your Wizard') is dead) Equal to False.

Code:
Events
        Unit - A unit Is attacked
    Conditions
        (Distance between (Position of (Attacked unit)) and (Position of 'YourWizard')) Less than or equal to 500.00
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Random integer number between 1 and 100) Less than or equal to 10
            Then - Actions
                Unit - Create 1 'Dummy' for (Owner of (Triggering unit)) at (Position of 'YourWizard') facing Default building facing (270.0) degrees
                Unit - Order (Last created unit) to Human Priest - Heal (Triggering unit)
            Else - Actions

The problem is if you have the YourWizard reference.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top