• 🏆 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] What's wrong with this trigger?

Status
Not open for further replies.
Level 7
Joined
Nov 18, 2012
Messages
272
Can someone help me with this trigger? It won't cast if unit's life is not 100%.
  • Technomastery
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Technomastery
    • Actions
      • Unit - Remove Gear Shield buff from Shieldedunit
      • Set Shieldedunit = (Target unit of ability being cast)
      • Set Tresspassdamage = (Life of Shieldedunit)
      • Set ShieldHealth = (80.00 + (20.00 x (Real((Level of Technomastery for Technomancer)))))
      • Unit - Create 1 Dummy Shield for (Owner of Technomancer) at (Position of Technomancer) facing Default building facing degrees
      • Set dummy = (Last created unit)
      • Unit - Order dummy to Orc Shaman - Bloodlust Shieldedunit
      • Unit - Add a 2.00 second Generic expiration timer to dummy
      • Trigger - Turn on Technocheck <gen>
      • Set dummy = No unit
  • Technocheck
    • Events
      • Time - Every 0.25 seconds of game time
    • Conditions
      • (Shieldedunit is alive) Equal to True
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ShieldHealth Less than or equal to 0.00
          • (Shieldedunit has buff Gear Shield ) Equal to False
        • Then - Actions
          • Trigger - Turn off (This trigger)
          • Set Shieldedunit = No unit
          • Set Tresspassdamage = 0.00
          • Set ShieldHealth = 0.00
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Life of Shieldedunit) Less than Tresspassdamage
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Tresspassdamage - (Life of Shieldedunit)) Less than ShieldHealth
                • Then - Actions
                  • Set ShieldHealth = (ShieldHealth - (Tresspassdamage - (Life of Shieldedunit)))
                  • Unit - Set life of Shieldedunit to Tresspassdamage
                • Else - Actions
                  • Unit - Set life of Shieldedunit to ((Life of Shieldedunit) + ShieldHealth)
                  • Set ShieldHealth = 0.00
                  • Unit - Remove Gear Shield buff from Shieldedunit
            • Else - Actions
              • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Life of Shieldedunit) Greater than Tresspassdamage
        • Then - Actions
          • Set Tresspassdamage = (Life of (Target unit of ability being cast))
        • Else - Actions
          • Do nothing
 
Level 18
Joined
Nov 21, 2012
Messages
835
Please describe what this spell shoud do
Your spell looks like it is not MUI.

In 1st trigger you dont need:
Unit - Remove Gear Shield buff from Shieldedunit

In 2nd trigger Technocheck
you should not use this condition in this place where it is
(Shieldedunit is alive) Equal to True
if right after cast spell, Shieldedunit dies your checkTrigger will run as long as you cast spell again.

last If/then/else is wrong, you refer to Target unit of ability being cast))
dont do this in checktrigger, what if other ability was casted the same time?

Zibi
 
Status
Not open for further replies.
Top