• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Solved] Trigger spell not functioning

Status
Not open for further replies.
Level 7
Joined
Feb 23, 2020
Messages
253
Why is this trigger not functioning?
The idea is to make an aura that heals for a % of enemies max health when they die.

  • Bloodlust Work
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Vampire
      • (Level of Bloodlust for (Triggering unit)) Greater than 0
    • Actions
      • Set VariableSet Bloodlust_Targets = (Picked unit)
      • Set VariableSet Bloodlust_Caster = (Triggering unit)
      • Set VariableSet Bloodlust_Area = (Position of Bloodlust_Caster)
      • Set VariableSet Bloodlust_Group = (Units within 1000.00 of Bloodlust_Area.)
      • Set VariableSet Bloodlust_Heal = ((Max life of Bloodlust_Targets) x Bloodlust_HealPercentage[(Level of Bloodlust for Bloodlust_Caster)])
      • Unit Group - Pick every unit in Bloodlust_Group and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Bloodlust_Targets belongs to an enemy of (Owner of Bloodlust_Caster).) Equal to True
            • Then - Actions
              • Unit - Set life of Bloodlust_Caster to ((Life of (Triggering unit)) + Bloodlust_Heal)%
            • Else - Actions
      • Custom script: call RemoveLocation (udg_Bloodlust_Area)
      • Custom script: call DestroyGroup (udg_Bloodlust_Group)
 
Level 7
Joined
Feb 23, 2020
Messages
253
  • Set VariableSet Bloodlust_Heal = ((Max life of Bloodlust_Targets) x Bloodlust_HealPercentage[(Level of Bloodlust for Bloodlust_Caster)])
This one should also be inside the loop. (I forgot to mention it earlier)
Does not seem to work either.

  • Bloodlust Work
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Vampire
      • (Level of Bloodlust for (Triggering unit)) Greater than 0
    • Actions
      • Set VariableSet Bloodlust_Caster = (Triggering unit)
      • Set VariableSet Bloodlust_Area = (Position of Bloodlust_Caster)
      • Set VariableSet Bloodlust_Group = (Units within 1000.00 of Bloodlust_Area.)
      • Unit Group - Pick every unit in Bloodlust_Group and do (Actions)
        • Loop - Actions
          • Set VariableSet Bloodlust_Targets = (Picked unit)
          • Set VariableSet Bloodlust_Heal = ((Max life of Bloodlust_Targets) x Bloodlust_HealPercentage[(Level of Bloodlust for Bloodlust_Caster)])
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Bloodlust_Targets belongs to an enemy of (Owner of Bloodlust_Caster).) Equal to True
            • Then - Actions
              • Unit - Set life of Bloodlust_Caster to ((Life of (Triggering unit)) + Bloodlust_Heal)%
            • Else - Actions
      • Custom script: call RemoveLocation (udg_Bloodlust_Area)
      • Custom script: call DestroyGroup (udg_Bloodlust_Group)
 
Last edited:
Level 5
Joined
Oct 16, 2007
Messages
67
First a Question: Triggering Unit is in this case the diying unit, not the killing. So it would only heal if the unit that dies is a Vampire?

And if Bloodlust is a buff and not a skill it can't be asked of dying units. I haven't tried it for heros but on units all buffs are gone when this event fires.
 
Level 7
Joined
Feb 23, 2020
Messages
253
First a Question: Triggering Unit is in this case the diying unit, not the killing. So it would only heal if the unit that dies is a Vampire?

And if Bloodlust is a buff and not a skill it can't be asked of dying units. I haven't tried it for heros but on units all buffs are gone when this event fires.

1. Hmm, i kind of understand what you mean. My point of this ability is to make a passive ability that will heal X% based of the dying units max health.(In an area, does not have to kill the unit)

2. I based the ability of bash, so it's not the original bloodlust ability.
 

Uncle

Warcraft Moderator
Level 63
Joined
Aug 10, 2018
Messages
6,457
1) Change triggering unit to killing unit.

2) Bloodlust_Heal should be set to the Max life of Bloodlust_Caster not Bloodlust_Targets. Also, you're referencing the Level of the ability for Bloodlust_Caster when it should be the level of the ability for the Killing Unit.

3) You're healing the caster and not the picked units. You're also referencing Triggering Unit. For the heal it should be: Set life of Bloodlust_Targets to Life of Bloodlust_Targets + Bloodlust_Heal.

4) Edit: You should move the calculation for Bloodlust_Heal to before Pick Every Unit.
 
Last edited:
Level 7
Joined
Feb 23, 2020
Messages
253
1) Change triggering unit to killing unit.

2) Bloodlust_Heal should be set to the Max life of Bloodlust_Caster not Bloodlust_Targets. Also, you're referencing the Level of the ability for Bloodlust_Caster when it should be the level of the ability for the Killing Unit.

3) You're healing the caster and not the picked units. You're also referencing Triggering Unit. For the heal it should be: Set life of Bloodlust_Targets to Life of Bloodlust_Targets + Bloodlust_Heal.

4) You should move the calculation for Bloodlust_Heal to inside the If Then Else, this way it doesn't calculate it for non-enemy units since it's unnecessary.

  • Bloodlust Work
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Vampire
      • (Level of Bloodlust for (Triggering unit)) Greater than 0
    • Actions
      • Set VariableSet Bloodlust_Caster = (Triggering unit)
      • Set VariableSet Bloodlust_Area = (Position of Bloodlust_Caster)
      • Set VariableSet Bloodlust_Group = (Units within 1000.00 of Bloodlust_Area.)
      • Unit Group - Pick every unit in Bloodlust_Group and do (Actions)
        • Loop - Actions
          • Set VariableSet Bloodlust_Targets = (Picked unit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Bloodlust_Targets belongs to an enemy of (Owner of Bloodlust_Caster).) Equal to True
            • Then - Actions
              • Set VariableSet Bloodlust_Heal = ((Max life of Bloodlust_Caster) x Bloodlust_HealPercentage[(Level of Bloodlust for Bloodlust_Caster)])
              • Unit - Set life of Bloodlust_Targets to ((Life of Bloodlust_Targets) + Bloodlust_Heal)%
            • Else - Actions
      • Custom script: call RemoveLocation (udg_Bloodlust_Area)
      • Custom script: call DestroyGroup (udg_Bloodlust_Group)
So this looks more correct? If so, it still does not work unfortunately :(
 

Uncle

Warcraft Moderator
Level 63
Joined
Aug 10, 2018
Messages
6,457
You're still referencing triggering unit... just use "dying unit" and "killing unit" so you can differentiate between the two. The vampire is the KILLING unit, and he's the one with the Bloodlust ability.

Edit: Also, you're healing Bloodlust_Targets for a % even though it should be a flat amount. Don't use a percentage for the heal.

  • Bloodlust Example
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Killing unit)) Equal to Vampire
      • (Level of Bloodlust for (Killing unit)) Greater than 0
    • Actions
      • Set VariableSet Bloodlust_DyingUnit = (Dying unit)
      • Set VariableSet Bloodlust_KillingUnit = (Killing unit)
      • Set VariableSet Bloodlust_Area = (Position of Bloodlust_KillingUnit)
      • Set VariableSet Bloodlust_Group = (Units within 1000.00 of Bloodlust_Area.)
      • Set VariableSet Bloodlust_Heal = ((Max life of Bloodlust_DyingUnit) x Bloodlust_HealPercentage)
      • -------- --------
      • Unit Group - Pick every unit in Bloodlust_Group and do (Actions)
        • Loop - Actions
          • Set VariableSet Bloodlust_Targets = (Picked unit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Bloodlust_Targets belongs to an enemy of (Owner of Bloodlust_DyingUnit).) Equal to True
            • Then - Actions
              • Unit - Set life of Bloodlust_Targets to ((Life of Bloodlust_Targets) + Bloodlust_Heal)
            • Else - Actions
      • -------- --------
      • Custom script: call RemoveLocation (udg_Bloodlust_Area)
      • Custom script: call DestroyGroup (udg_Bloodlust_Group)
 
Last edited:
Level 7
Joined
Feb 23, 2020
Messages
253
You're still referencing triggering unit... just use "dying unit" and "killing unit" so you can differentiate between the two. The vampire is the KILLING unit, and he's the one with the Bloodlust ability.

Edit: Also, you're healing Bloodlust_Targets for a % even though it should be a flat amount. Don't use a percentage for the heal.

  • Bloodlust Example
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Killing unit)) Equal to Vampire
      • (Level of Bloodlust for (Killing unit)) Greater than 0
    • Actions
      • Set VariableSet Bloodlust_DyingUnit = (Dying unit)
      • Set VariableSet Bloodlust_KillingUnit = (Killing unit)
      • Set VariableSet Bloodlust_Area = (Position of Bloodlust_KillingUnit)
      • Set VariableSet Bloodlust_Group = (Units within 1000.00 of Bloodlust_Area.)
      • Set VariableSet Bloodlust_Heal = ((Max life of Bloodlust_DyingUnit) x Bloodlust_HealPercentage)
      • -------- --------
      • Unit Group - Pick every unit in Bloodlust_Group and do (Actions)
        • Loop - Actions
          • Set VariableSet Bloodlust_Targets = (Picked unit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Bloodlust_Targets belongs to an enemy of (Owner of Bloodlust_DyingUnit).) Equal to True
            • Then - Actions
              • Unit - Set life of Bloodlust_Targets to ((Life of Bloodlust_Targets) + Bloodlust_Heal)
            • Else - Actions
      • -------- --------
      • Custom script: call RemoveLocation (udg_Bloodlust_Area)
      • Custom script: call DestroyGroup (udg_Bloodlust_Group)

Thank you, this works as intended if he is the killer :). BUT if the vampire isnt the killer, (meaning if an ally kills it), he does not heal. So do i have to add sometihng?
 
Level 2
Joined
Dec 19, 2019
Messages
11
Hey there.

I am not entirely sure how you mean that the health should be healed. Just by flying over it I created it in a way, that if the Killer has the ability it will heal all of his allies.

  • Bloodlust Init
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Level of Bloodlust (Custom) for (Killing unit)) Greater than 0
    • Actions
      • Set VariableSet TempPoint = (Position of (Dying unit))
      • -------- You have to define here, who will be healed. In this case it's the killer's units. --------
      • Set VariableSet Bloodlust_Group = (Units within 1000.00 of TempPoint matching ((Owner of (Matching unit)) Equal to (Owner of (Killing unit))).)
      • Custom script: call RemoveLocation (udg_TempPoint)
      • Set VariableSet Bloodlust_Health = ((Max life of (Dying unit)) x 0.05)
      • Unit Group - Pick every unit in Bloodlust_Group and do (Actions)
        • Loop - Actions
          • Unit - Set life of (Picked unit) to ((Life of (Picked unit)) + Bloodlust_Health)
          • Floating Text - Create floating text that reads (+ + (String((Integer(Bloodlust_Health))))) above (Picked unit) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
          • Floating Text - Set the velocity of (Last created floating text) to 140.00 towards 90.00 degrees
          • Floating Text - Change (Last created floating text): Disable permanence
          • Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
          • Floating Text - Change the fading age of (Last created floating text) to 0.50 seconds
Maybe this helps?
 

Attachments

  • Bloodlust_test.w3m
    18.7 KB · Views: 20
Level 7
Joined
Feb 23, 2020
Messages
253
Hey there.

I am not entirely sure how you mean that the health should be healed. Just by flying over it I created it in a way, that if the Killer has the ability it will heal all of his allies.

  • Bloodlust Init
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Level of Bloodlust (Custom) for (Killing unit)) Greater than 0
    • Actions
      • Set VariableSet TempPoint = (Position of (Dying unit))
      • -------- You have to define here, who will be healed. In this case it's the killer's units. --------
      • Set VariableSet Bloodlust_Group = (Units within 1000.00 of TempPoint matching ((Owner of (Matching unit)) Equal to (Owner of (Killing unit))).)
      • Custom script: call RemoveLocation (udg_TempPoint)
      • Set VariableSet Bloodlust_Health = ((Max life of (Dying unit)) x 0.05)
      • Unit Group - Pick every unit in Bloodlust_Group and do (Actions)
        • Loop - Actions
          • Unit - Set life of (Picked unit) to ((Life of (Picked unit)) + Bloodlust_Health)
          • Floating Text - Create floating text that reads (+ + (String((Integer(Bloodlust_Health))))) above (Picked unit) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
          • Floating Text - Set the velocity of (Last created floating text) to 140.00 towards 90.00 degrees
          • Floating Text - Change (Last created floating text): Disable permanence
          • Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
          • Floating Text - Change the fading age of (Last created floating text) to 0.50 seconds
Maybe this helps?
Sorry, maybe i wasnt clear enough in the description. It should be a passive ability. That triggers when an enemy dies near the vampire. The Vampire will heal X% amount of the dying units maximum health.

This is a cool idea though :)
 

Uncle

Warcraft Moderator
Level 63
Joined
Aug 10, 2018
Messages
6,457
I see.

Instead, you'll want to pick every unit within 1000 range of the dying unit, and if the picked unit is equal to your Vampire unit AND the picked unit has Bloodlust leveled > 0 then heal the picked unit. Also check to make sure that the Vampire is an enemy of the dying unit.

So remove ALL of the Killing Unit stuff as that's no longer necessary. And since I had set Bloodlust_Area to the position of Killing Unit you'll need to set it back to position of Dying unit.

And change the Pick every unit function to this:
  • Actions
    • Unit Group - Pick every unit in Bloodlust_Group and do (Actions)
      • Loop - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • ((Picked unit) belongs to an enemy of (Triggering player).) Equal to True
            • (Unit-type of (Picked unit)) Equal to Vampire
            • (Level of Bloodlust for (Picked unit)) Greater than 0
          • Then - Actions
            • -------- Heal picked unit --------
          • Else - Actions
So it'll look almost exactly the same as the trigger I posted before, just with these few tweaks. I was in a hurry so I left out Bloodlust_Targets, it's not actually necessary as you can just reference Picked unit instead.
 
Last edited:
Level 7
Joined
Feb 23, 2020
Messages
253
I see.

Instead, you'll want to pick every unit within 1000 range of the dying unit, and if the picked unit is equal to your Vampire unit AND the picked unit has Bloodlust leveled > 0 then heal the picked unit. Also check to make sure that the Vampire is an enemy of the dying unit.

So remove ALL of the Killing Unit stuff as that's no longer necessary. And since I had set Bloodlust_Area to the position of Killing Unit you'll need to set it back to position of Dying unit.

And change the Pick every unit function to this:
  • Actions
    • Unit Group - Pick every unit in Bloodlust_Group and do (Actions)
      • Loop - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • ((Picked unit) belongs to an enemy of (Triggering player).) Equal to True
            • (Unit-type of (Picked unit)) Equal to Vampire
            • (Level of Bloodlust for (Picked unit)) Greater than 0
          • Then - Actions
            • -------- Heal picked unit --------
          • Else - Actions
So it'll look almost exactly the same as the trigger I posted before, just with these few tweaks. I was in a hurry so I left out Bloodlust_Targets, it's not actually necessary as you can just reference Picked unit instead.
Yes, it all works perfectly now! Thank you very much for your help! :)
 
Status
Not open for further replies.
Top