Vampiric Embrace Spell

Spray-

Member
Reaction score
1
Trying to make a spell that when cast on enemies, all damage done to them will heal everyone around the damaged unit for the amount of damage taken.
This is what i've come up with so far, the Special Effect works, but not the actual heal.

Code:
Events
    Unit - A unit Is attacked
Conditions
    ((Attacked unit) has buff Vampiric Embrace ) Equal to True
    ((Attacking unit) belongs to an enemy of Player 12 (Brown)) Equal to True
Actions
    Unit Group - Pick every unit in (Units within 1000.00 of (Position of (Attacked unit)) matching (((Matching unit) belongs to an enemy of Player 12 (Brown)) Equal to True)) and do (Actions)
        Loop - Actions
            Unit - Set life of (Picked unit) to ((Life of (Picked unit)) + (Damage taken))
            Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Spells\Human\Heal\HealTarget.mdl

Any help? :)
 

Pharaoh_

The epic journey will soon begin... Prepare!
Reaction score
136
You say "all damage done", not all damage out of attacks.
So, let's see it:

Trigger:
  • Trigger1
    • Events
      • A unit starts the effect of an ability
    • Conditions
      • Ability being cast Equal to Vampiric Embrace
    • Actions
      • Set Unit_G = (Units in (Playable Map Area) matching (((Matching unit) belongs to Player 12 (Brown)) and ((Matching unit) has buff X))
      • Unit Group - Pick up every unit in Unit_G and do (Actions)
        • Loop - Actions
          • Set Unit1 = (Picked unit)
          • Trigger - Turn on (Trigger3 <gen>)
          • Trigger - Add to Trigger2 <gen> the event ((Unit1) takes damage)
      • Custom script: call DestroyGroup (udg_Unit_G)


Trigger:
  • Trigger2
    • Events
    • Conditions
    • Actions
      • Set DamageTaken1 = (Damage taken)


Trigger:
  • Trigger3
    • Events
      • Time - Every 0.1 seconds of game-time
    • Conditions
    • Actions
      • Set Point1 = (Position of (Unit1))
      • Set Temp_G = (Units within 1000.00 of (Point1) matching ((Matching unit) belongs to an ally of (Owner of (Casting unit)))
      • Unit Group - Pick up every unit in (Temp_G) and do (Actions)
        • Loop - Actions
          • Unit - Set life of (Picked unit) to ((Life of (Picked unit)) + (DamageTaken1))
          • Special Effect - Create a special effect attached to the chest of (Picked unit) using Abilities\Spells\Human\Heal\HealTarget.mdl
          • Special Effect - Destroy (Last created special Effect)
      • Custom script: call RemoveLocation (udg_Point1)
      • Custom script: call DestroyGroup (udg_Temp_G)
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      • Ghan
        Administrator - Servers are fun

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top