Soul Drain

Uncle

Warcraft Moderator
Level 68
Joined
Aug 10, 2018
Messages
7,166
So in other words:

The spell instantly deals damage to the target enemy unit. Then regardless of whether it dies or not, a missile is released from the position of the enemy which targets and chases after the caster. Once the missile reaches the caster it is destroyed and the caster is healed.

Sort of like if you cast Purge on an enemy unit and a "friendly" Death Coil was released from said enemy unit which targeted the caster.

What patch are you on? The solution changes depending on this.

Edit: Here's an example made on the latest patch using a Missile system.
 

Attachments

  • Soul Drain 1.w3m
    80.1 KB · Views: 1
Last edited:
Level 24
Joined
Sep 7, 2018
Messages
520
So in other words:

The spell instantly deals damage to the target enemy unit. Then regardless of whether it dies or not, a missile is released from the position of the enemy which targets and chases after the caster. Once the missile reaches the caster it is destroyed and the caster is healed.

Sort of like if you cast Purge on an enemy unit and a "friendly" Death Coil was released from said enemy unit which targeted the caster.

What patch are you on? The solution changes depending on this.

Edit: Here's an example made on the latest patch using a Missile system.
thanks a lot, actually i use 1.29.2.
can you send triggers and variables if i can make this spell in this version?
 

Uncle

Warcraft Moderator
Level 68
Joined
Aug 10, 2018
Messages
7,166
thanks a lot, actually i use 1.29.2.
can you send triggers and variables if i can make this spell in this version?
Unfortunately the system I used requires at least 1.31.

But there's other ways of doing this, we can use a Dummy unit and a technique called Dynamic Indexing:
  • Soul Drain Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Soul Drain
    • Actions
      • Set Soul_Drain_Index = (Soul_Drain_Index + 1)
      • -------- --------
      • Set Soul_Drain_Caster[Soul_Drain_Index] = (Triggering unit)
      • Set Soul_Drain_Amount[Soul_Drain_Index] = (100.00 x (Real((Level of (Ability being cast) for (Triggering unit)))))
      • -------- --------
      • Set Soul_Drain_Point[0] = (Position of (Target unit of ability being cast))
      • Set Soul_Drain_Point[1] = (Position of (Triggering unit))
      • Unit - Create 1 Dummy for (Triggering player) at Soul_Drain_Point[0] facing Soul_Drain_Point[1]
      • Set Soul_Drain_Missile[Soul_Drain_Index] = (Last created unit)
      • -------- --------
      • Custom script: call RemoveLocation( udg_Soul_Drain_Point[0] )
      • Custom script: call RemoveLocation( udg_Soul_Drain_Point[1] )
      • -------- --------
      • Trigger - Turn on Soul Drain Loop <gen>
      • -------- --------
      • Unit - Cause (Triggering unit) to damage (Target unit of ability being cast), dealing Soul_Drain_Amount[Soul_Drain_Index] damage of attack type Spells and damage type Normal
  • Soul Drain Loop
    • Events
      • Time - Every 0.02 seconds of game time
    • Conditions
    • Actions
      • For each (Integer Soul_Drain_Loop) from 1 to Soul_Drain_Index, do (Actions)
        • Loop - Actions
          • Set Soul_Drain_Point[0] = (Position of Soul_Drain_Caster[Soul_Drain_Loop])
          • Set Soul_Drain_Point[1] = (Position of Soul_Drain_Missile[Soul_Drain_Loop])
          • Set Soul_Drain_Angle = (Angle from Soul_Drain_Point[1] to Soul_Drain_Point[0])
          • Set Soul_Drain_Point[2] = (Soul_Drain_Point[1] offset by 12.00 towards Soul_Drain_Angle degrees.)
          • Set Soul_Drain_Distance = (Distance between Soul_Drain_Point[0] and Soul_Drain_Point[2])
          • -------- --------
          • Unit - Move Soul_Drain_Missile[Soul_Drain_Loop] instantly to Soul_Drain_Point[2], facing Soul_Drain_Angle degrees
          • -------- --------
          • Custom script: call RemoveLocation( udg_Soul_Drain_Point[0] )
          • Custom script: call RemoveLocation( udg_Soul_Drain_Point[1] )
          • Custom script: call RemoveLocation( udg_Soul_Drain_Point[2] )
          • -------- --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Soul_Drain_Distance Less than or equal to 25.00
            • Then - Actions
              • Unit - Set life of Soul_Drain_Caster[Soul_Drain_Loop] to ((Life of Soul_Drain_Caster[Soul_Drain_Loop]) + Soul_Drain_Amount[Soul_Drain_Loop])
              • -------- --------
              • Unit - Kill Soul_Drain_Missile[Soul_Drain_Loop]
              • -------- --------
              • Set Soul_Drain_Caster[Soul_Drain_Loop] = Soul_Drain_Caster[Soul_Drain_Index]
              • Set Soul_Drain_Missile[Soul_Drain_Loop] = Soul_Drain_Missile[Soul_Drain_Index]
              • Set Soul_Drain_Amount[Soul_Drain_Loop] = Soul_Drain_Amount[Soul_Drain_Index]
              • -------- --------
              • Set Soul_Drain_Index = (Soul_Drain_Index - 1)
              • Set Soul_Drain_Loop = (Soul_Drain_Loop - 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Soul_Drain_Index Equal to 0
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions
            • Else - Actions
^ This Soul Drain Loop trigger should be initially OFF since we don't want it running all of the time.

The Dummy unit can be made by copying and pasting the Wisp and changing some of it's settings:
1718867925327.png
1718867947493.png

Here are the variables used, I suggest creating all of these first and foremost:
1718867978381.png



Here's where you can increase the Speed of the missile -> 12.00
  • Set Soul_Drain_Point[2] = (Soul_Drain_Point[1] offset by 12.00 towards Soul_Drain_Angle degrees.)
Here's where you can increase both the Damage and Heal -> 100.00
  • Set Soul_Drain_Amount[Soul_Drain_Index] = (100.00 x (Real((Level of (Ability being cast) for (Triggering unit)))))
Here's the collision size of the Missile, it can likely stay at 25.00, but if your Missile moves really fast then you would need to increase it:
  • If - Conditions
    • Soul_Drain_Distance Less than or equal to 25.00
 

Attachments

  • Soul Drain 2.w3m
    21.5 KB · Views: 1
Last edited:
Level 24
Joined
Sep 7, 2018
Messages
520
Unfortunately the system I used requires at least 1.31.

But there's other ways of doing this, we can use a Dummy unit and a technique called Dynamic Indexing:
  • Soul Drain Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Soul Drain
    • Actions
      • Set VariableSet Soul_Drain_Index = (Soul_Drain_Index + 1)
      • -------- --------
      • Set VariableSet Soul_Drain_Caster[Soul_Drain_Index] = (Triggering unit)
      • Set VariableSet Soul_Drain_Amount[Soul_Drain_Index] = (100.00 x (Real((Level of (Ability being cast) for (Triggering unit)))))
      • -------- --------
      • Set VariableSet Soul_Drain_Point[0] = (Position of (Target unit of ability being cast))
      • Set VariableSet Soul_Drain_Point[1] = (Position of (Triggering unit))
      • Unit - Create 1 Dummy for (Triggering player) at Soul_Drain_Point[0] facing Soul_Drain_Point[1]
      • Set VariableSet Soul_Drain_Missile[Soul_Drain_Index] = (Last created unit)
      • -------- --------
      • Custom script: call RemoveLocation( udg_Soul_Drain_Point[0] )
      • Custom script: call RemoveLocation( udg_Soul_Drain_Point[1] )
      • -------- --------
      • Trigger - Turn on Soul Drain Loop <gen>
      • -------- --------
      • Unit - Cause (Triggering unit) to damage (Target unit of ability being cast), dealing Soul_Drain_Amount[Soul_Drain_Index] damage of attack type Spells and damage type Normal
  • Soul Drain Loop
    • Events
      • Time - Every 0.02 seconds of game time
    • Conditions
    • Actions
      • For each (Integer Soul_Drain_Loop) from 1 to Soul_Drain_Index, do (Actions)
        • Loop - Actions
          • Set VariableSet Soul_Drain_Point[0] = (Position of Soul_Drain_Caster[Soul_Drain_Loop])
          • Set VariableSet Soul_Drain_Point[1] = (Position of Soul_Drain_Missile[Soul_Drain_Loop])
          • Set VariableSet Soul_Drain_Angle = (Angle from Soul_Drain_Point[1] to Soul_Drain_Point[0])
          • Set VariableSet Soul_Drain_Point[2] = (Soul_Drain_Point[1] offset by 12.00 towards Soul_Drain_Angle degrees.)
          • Set VariableSet Soul_Drain_Distance = (Distance between Soul_Drain_Point[0] and Soul_Drain_Point[2])
          • -------- --------
          • Unit - Move Soul_Drain_Missile[Soul_Drain_Loop] instantly to Soul_Drain_Point[2], facing Soul_Drain_Angle degrees
          • -------- --------
          • Custom script: call RemoveLocation( udg_Soul_Drain_Point[0] )
          • Custom script: call RemoveLocation( udg_Soul_Drain_Point[1] )
          • Custom script: call RemoveLocation( udg_Soul_Drain_Point[2] )
          • -------- --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Soul_Drain_Distance Less than or equal to 25.00
            • Then - Actions
              • Unit - Set life of Soul_Drain_Caster[Soul_Drain_Loop] to ((Life of Soul_Drain_Caster[Soul_Drain_Loop]) + Soul_Drain_Amount[Soul_Drain_Loop])
              • -------- --------
              • Unit - Kill Soul_Drain_Missile[Soul_Drain_Loop]
              • -------- --------
              • Set VariableSet Soul_Drain_Caster[Soul_Drain_Loop] = Soul_Drain_Caster[Soul_Drain_Index]
              • Set VariableSet Soul_Drain_Missile[Soul_Drain_Loop] = Soul_Drain_Missile[Soul_Drain_Index]
              • Set VariableSet Soul_Drain_Amount[Soul_Drain_Loop] = Soul_Drain_Amount[Soul_Drain_Index]
              • -------- --------
              • Set VariableSet Soul_Drain_Index = (Soul_Drain_Index - 1)
              • Set VariableSet Soul_Drain_Loop = (Soul_Drain_Loop - 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Soul_Drain_Index Equal to 0
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions
            • Else - Actions
The Dummy unit can be made by copying and pasting the Wisp and changing some of it's settings:
View attachment 476458View attachment 476459
Here are the variables used, I suggest creating all of these first and foremost:
View attachment 476460


Here's where you can increase the Speed of the missile -> 12.00
  • Set VariableSet Soul_Drain_Point[2] = (Soul_Drain_Point[1] offset by 12.00 towards Soul_Drain_Angle degrees.)
Here's where you can increase both the Damage and Heal -> 100.00
  • Set VariableSet Soul_Drain_Amount[Soul_Drain_Index] = (100.00 x (Real((Level of (Ability being cast) for (Triggering unit)))))
Here's the collision size of the Missile, it can likely stay at 25.00, but if your Missile moves really fast then you would need to increase it:
  • If - Conditions
    • Soul_Drain_Distance Less than or equal to 25.00
Thanks again.
 
Level 24
Joined
Sep 7, 2018
Messages
520
Unfortunately the system I used requires at least 1.31.

But there's other ways of doing this, we can use a Dummy unit and a technique called Dynamic Indexing:
  • Soul Drain Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Soul Drain
    • Actions
      • Set Soul_Drain_Index = (Soul_Drain_Index + 1)
      • -------- --------
      • Set Soul_Drain_Caster[Soul_Drain_Index] = (Triggering unit)
      • Set Soul_Drain_Amount[Soul_Drain_Index] = (100.00 x (Real((Level of (Ability being cast) for (Triggering unit)))))
      • -------- --------
      • Set Soul_Drain_Point[0] = (Position of (Target unit of ability being cast))
      • Set Soul_Drain_Point[1] = (Position of (Triggering unit))
      • Unit - Create 1 Dummy for (Triggering player) at Soul_Drain_Point[0] facing Soul_Drain_Point[1]
      • Set Soul_Drain_Missile[Soul_Drain_Index] = (Last created unit)
      • -------- --------
      • Custom script: call RemoveLocation( udg_Soul_Drain_Point[0] )
      • Custom script: call RemoveLocation( udg_Soul_Drain_Point[1] )
      • -------- --------
      • Trigger - Turn on Soul Drain Loop <gen>
      • -------- --------
      • Unit - Cause (Triggering unit) to damage (Target unit of ability being cast), dealing Soul_Drain_Amount[Soul_Drain_Index] damage of attack type Spells and damage type Normal
  • Soul Drain Loop
    • Events
      • Time - Every 0.02 seconds of game time
    • Conditions
    • Actions
      • For each (Integer Soul_Drain_Loop) from 1 to Soul_Drain_Index, do (Actions)
        • Loop - Actions
          • Set Soul_Drain_Point[0] = (Position of Soul_Drain_Caster[Soul_Drain_Loop])
          • Set Soul_Drain_Point[1] = (Position of Soul_Drain_Missile[Soul_Drain_Loop])
          • Set Soul_Drain_Angle = (Angle from Soul_Drain_Point[1] to Soul_Drain_Point[0])
          • Set Soul_Drain_Point[2] = (Soul_Drain_Point[1] offset by 12.00 towards Soul_Drain_Angle degrees.)
          • Set Soul_Drain_Distance = (Distance between Soul_Drain_Point[0] and Soul_Drain_Point[2])
          • -------- --------
          • Unit - Move Soul_Drain_Missile[Soul_Drain_Loop] instantly to Soul_Drain_Point[2], facing Soul_Drain_Angle degrees
          • -------- --------
          • Custom script: call RemoveLocation( udg_Soul_Drain_Point[0] )
          • Custom script: call RemoveLocation( udg_Soul_Drain_Point[1] )
          • Custom script: call RemoveLocation( udg_Soul_Drain_Point[2] )
          • -------- --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Soul_Drain_Distance Less than or equal to 25.00
            • Then - Actions
              • Unit - Set life of Soul_Drain_Caster[Soul_Drain_Loop] to ((Life of Soul_Drain_Caster[Soul_Drain_Loop]) + Soul_Drain_Amount[Soul_Drain_Loop])
              • -------- --------
              • Unit - Kill Soul_Drain_Missile[Soul_Drain_Loop]
              • -------- --------
              • Set Soul_Drain_Caster[Soul_Drain_Loop] = Soul_Drain_Caster[Soul_Drain_Index]
              • Set Soul_Drain_Missile[Soul_Drain_Loop] = Soul_Drain_Missile[Soul_Drain_Index]
              • Set Soul_Drain_Amount[Soul_Drain_Loop] = Soul_Drain_Amount[Soul_Drain_Index]
              • -------- --------
              • Set Soul_Drain_Index = (Soul_Drain_Index - 1)
              • Set Soul_Drain_Loop = (Soul_Drain_Loop - 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Soul_Drain_Index Equal to 0
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions
            • Else - Actions
^ This Soul Drain Loop trigger should be initially OFF since we don't want it running all of the time.

The Dummy unit can be made by copying and pasting the Wisp and changing some of it's settings:
View attachment 476458View attachment 476459
Here are the variables used, I suggest creating all of these first and foremost:
View attachment 476460


Here's where you can increase the Speed of the missile -> 12.00
  • Set Soul_Drain_Point[2] = (Soul_Drain_Point[1] offset by 12.00 towards Soul_Drain_Angle degrees.)
Here's where you can increase both the Damage and Heal -> 100.00
  • Set Soul_Drain_Amount[Soul_Drain_Index] = (100.00 x (Real((Level of (Ability being cast) for (Triggering unit)))))
Here's the collision size of the Missile, it can likely stay at 25.00, but if your Missile moves really fast then you would need to increase it:
  • If - Conditions
    • Soul_Drain_Distance Less than or equal to 25.00
i tested it but soul doesn't move from target unit to caster body.
 

Uncle

Warcraft Moderator
Level 68
Joined
Aug 10, 2018
Messages
7,166
I'd have you to see your triggers and your Dummy unit to understand why.

Both maps I uploaded are tested and 100% working (aside from maybe some odd bugs that may show up in the future).

Some problems you may run into:

1) The Dummy settings are off. The Movement settings are most important. Also, ensure that it's Model is setup properly as the Model of the Dummy is the Model of your Missile. It's Height may need to be increased so it doesn't clip into the ground, this would vary from model to model.

2) You likely messed up a variable or put your Actions in the wrong place. I know some people get confused with the If Then Else actions and misplace things. Try to look for minor differences between my triggers and your own.
 
Last edited:
Level 24
Joined
Sep 7, 2018
Messages
520
I'd have you to see your triggers and your Dummy unit to understand why.

Both maps I uploaded are tested and 100% working (aside from maybe some odd bugs that may show up in the future).

Some problems you may run into:

1) The Dummy settings are off. The Movement settings are most important. Also, ensure that it's Model is setup properly as the Model of the Dummy is the Model of your Missile. It's Height may need to be increased so it doesn't clip into the ground, this would vary from model to model.

2) You likely messed up a variable or put your Actions in the wrong place. I know some people get confused with the If Then Else actions and misplace things. Try to look for minor differences between my triggers and your own.
that was my bad sorry, every things work perfectly.
 
Top