• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Custom Feedback Ability! [Solved]

Level 11
Joined
Jun 20, 2017
Messages
380
I have 3 different tiers of a tower with 3 feedback abilities, each one can burn a different amount of mana!
This tower's attacks destroy 200 mana per hit against any hero.
This tower's attacks destroy 300 mana per hit against any hero.
This tower's attacks destroy 400 mana per hit against any hero.
based on this
[General] - Lightning Attack & Feedback(mana break)

I ran into some problems!
It works and suddenly it doesn't work!
If a target reaches 0 mana, it will not work on a new target!
If the target is a structure/unit, it can still burn mana!
  • Feedback
    • Events
      • Unit - A unit Takes damage
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Level of Feedback [Custom] Energy Tower / Storm Hammers for (Damage source)) Greater than 0
          • (Level of Feedback [Custom] Energy Tower (Super) / Storm Hammers for (Damage source)) Greater than 0
          • (Level of Feedback [Custom] Energy Tower (Ultra) / Storm Hammers for (Damage source)) Greater than 0
      • (Damage From Normal Attack) Equal to True
      • ((Damage Target) belongs to an enemy of (Owner of (Damage source)).) Equal to True
    • Actions
      • -------- Set Target. --------
      • Set VariableSet Feedback_Target = (Damage Target)
      • -------- --------
      • -------- Set Source. --------
      • Set VariableSet Feedback_Source = (Damage source)
      • -------- --------
      • Set VariableSet Feedback_SourcePlayer = (Owner of Feedback_Source)
      • -------- --------
      • -------- Setup Special Effect. --------
      • Special Effect - Create a special effect attached to the origin of Feedback_Target using Abilities\Spells\Human\Feedback\ArcaneTowerAttack.mdl
      • Set VariableSet Feedback_SpecialEffect = (Last created special effect)
      • Special Effect - Destroy Feedback_SpecialEffect
      • -------- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Max mana of Feedback_Target) Greater than 0.00
        • Then - Actions
          • -------- Get the amount of mana that should be burned. --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Feedback_Target is alive) Equal to True
              • (Feedback_Target is A Hero) Equal to True
              • (Feedback_Target is A structure) Equal to False
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Unit-type of Feedback_Source) Equal to Energy Tower
                • Then - Actions
                  • Set VariableSet Feedback_Amount2[(Player number of Feedback_SourcePlayer)] = 200.00
                  • Set VariableSet Feedback_Multiplier = 1.00
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Unit-type of Feedback_Source) Equal to Energy Tower (Super)
                    • Then - Actions
                      • Set VariableSet Feedback_Amount2[(Player number of Feedback_SourcePlayer)] = 300.00
                      • Set VariableSet Feedback_Multiplier = 1.00
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Unit-type of Feedback_Source) Equal to Energy Tower (Ultra)
                        • Then - Actions
                          • Set VariableSet Feedback_Amount2[(Player number of Feedback_SourcePlayer)] = 400.00
                          • Set VariableSet Feedback_Multiplier = 1.00
                        • Else - Actions
            • Else - Actions
          • -------- --------
          • -------- Calculate the total mana burned. --------
          • Set VariableSet Feedback_ManaLost = ((Mana of Feedback_Target) - Feedback_Amount2[(Player number of Feedback_SourcePlayer)])
          • -------- --------
          • -------- If the unit had less mana than the amount being burned then account for this. --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Feedback_ManaLost Less than 0.00
            • Then - Actions
              • Set VariableSet Feedback_Amount2[(Player number of Feedback_SourcePlayer)] = (Feedback_Amount2[(Player number of Feedback_SourcePlayer)] + Feedback_ManaLost)
            • Else - Actions
          • -------- --------
          • -------- Subtract the mana from the target. --------
          • Unit - Set mana of Feedback_Target to ((Mana of Feedback_Target) - Feedback_Amount2[(Player number of (Owner of Feedback_Source))])
          • -------- --------
          • -------- Deal the damage. The "Feedback_Multiplier" is the Ratio that can be found on the ability. --------
          • Unit - Cause Feedback_Source to damage Feedback_Target, dealing (Feedback_Amount2[(Player number of Feedback_SourcePlayer)] x Feedback_Multiplier) damage of attack type Spells and damage type Normal
        • Else - Actions
 

Uncle

Warcraft Moderator
Level 70
Joined
Aug 10, 2018
Messages
7,391
Here's how you can simplify/optimize the trigger:
  • Feedback
    • Events
      • Unit - A unit Takes damage
    • Conditions
      • (Damage From Normal Attack) Equal to True
      • ((Damage Target) is A Hero) Equal to True
      • ((Damage Target) belongs to an enemy of (Owner of (Damage source)).) Equal to True
      • Or - Any (Conditions) are true
        • Conditions
          • (Level of Feedback [Custom] Energy Tower / Storm Hammers for (Damage source)) Greater than 0
          • (Level of Feedback [Custom] Energy Tower (Super) / Storm Hammers for (Damage source)) Greater than 0
          • (Level of Feedback [Custom] Energy Tower (Ultra) / Storm Hammers for (Damage source)) Greater than 0
    • Actions
      • Set VariableSet Feedback_Source = (Damage source)
      • Set VariableSet Feedback_Target = (Damage Target)
      • -------- --------
      • -------- Setup Special Effect. --------
      • Special Effect - Create a special effect attached to the origin of Feedback_Target using Abilities\Spells\Human\Feedback\ArcaneTowerAttack.mdl
      • Special Effect - Destroy (Last created special effect)
      • -------- --------
      • -------- Get the amount of mana that should be burned. --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of Feedback_Source) Equal to Energy Tower
        • Then - Actions
          • Set VariableSet Feedback_Amount = 200.00
          • Set VariableSet Feedback_Multiplier = 1.00
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of Feedback_Source) Equal to Energy Tower (Super)
            • Then - Actions
              • Set VariableSet Feedback_Amount = 300.00
              • Set VariableSet Feedback_Multiplier = 1.00
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Unit-type of Feedback_Source) Equal to Energy Tower (Ultra)
                • Then - Actions
                  • Set VariableSet Feedback_Amount = 400.00
                  • Set VariableSet Feedback_Multiplier = 1.00
                • Else - Actions
      • -------- --------
      • -------- Calculate the total mana burned. --------
      • Set VariableSet Feedback_ManaLost = ((Mana of Feedback_Target) - Feedback_Amount)
      • -------- --------
      • -------- If the unit had less mana than the amount being burned then account for this. --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Feedback_ManaLost Less than 0.00
        • Then - Actions
          • Set VariableSet Feedback_Amount = (Feedback_Amount + Feedback_ManaLost)
          • Unit - Set mana of Feedback_Target to 0.00
        • Else - Actions
          • -------- Subtract the mana from the target. --------
          • Unit - Set mana of Feedback_Target to Feedback_ManaLost
      • -------- --------
      • -------- Deal the damage. The "Feedback_Multiplier" is the Ratio that can be found on the ability. --------
      • Unit - Cause Feedback_Source to damage Feedback_Target, dealing (Feedback_Amount x Feedback_Multiplier) damage of attack type Spells and damage type Normal
That will hopefully clear up some issues. But I don't see anything that would prevent your trigger from working when switching targets.
 
Last edited:
Top