• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Spell] Why did this spell doesnt work?

Status
Not open for further replies.

Kusanagi Kuro

Hosted Project: SC
Level 10
Joined
Mar 11, 2012
Messages
708
Hi guys. I make a passive spell which will reduce the damage taken from the front and if the hp of the hero drops below 20%, it will give him a huge hp regen. The damage reduction part work but the heal isnt. Here is my trigger:
  • Guts Work
    • Events
      • Game - DamageModifierEvent becomes Equal to 1.00
    • Conditions
      • (Level of Guts for DamageEventTarget) Greater than 0
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Facing of DamageEventSource) Greater than or equal to (Facing of DamageEventTarget)
        • Then - Actions
          • Set TempReal = ((Facing of DamageEventSource) - (Facing of DamageEventTarget))
        • Else - Actions
          • Set TempReal = ((Facing of DamageEventTarget) - (Facing of DamageEventSource))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • And - All (Conditions) are true
            • Conditions
              • TempReal Greater than or equal to 165.00
              • TempReal Less than or equal to 195.00
        • Then - Actions
          • Set DamageEventAmount = (DamageEventAmount x (0.85 - (0.05 x (Real((Level of Guts for DamageEventTarget))))))
        • Else - Actions
      • Set CV = (Custom value of DamageEventTarget)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Percentage life of DamageEventTarget) Less than or equal to 20.0
          • Guts_Boolean[CV] Equal to True
          • Guts_RegenBoolean[CV] Equal to True
        • Then - Actions
          • Set Guts_Duration[CV] = 5.00
          • Set Guts_Regen[CV] = (50.00 + (25.00 x (Real((Level of Guts for DamageEventTarget)))))
          • Set Guts_Boolean[CV] = False
          • Special Effect - Create a special effect attached to the origin of DamageEventTarget using Abilities\Spells\Orc\Voodoo\VoodooAuraTarget.mdl
          • Set Guts_Effect[CV] = (Last created special effect)
          • Unit Group - Add DamageEventTarget to Guts_CDGroup
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Guts Cooldown <gen> is on) Equal to True
            • Then - Actions
            • Else - Actions
              • Trigger - Turn on Guts Cooldown <gen>
        • Else - Actions
  • Guts Cooldown
    • Events
      • Time - Every 0.10 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Guts_CDGroup is empty) Equal to True
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions
          • Unit Group - Pick every unit in Guts_CDGroup and do (Actions)
            • Loop - Actions
              • Set CV = (Custom value of (Picked unit))
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Guts_Duration[CV] Greater than 0.00
                • Then - Actions
                  • Set Guts_Duration[CV] = (Guts_Duration[CV] - 0.10)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Guts_RegenBoolean[CV] Equal to False
                    • Then - Actions
                      • Unit - Set life of (Picked unit) to ((Life of (Picked unit)) + (Guts_Regen[CV] / 10.00))
                    • Else - Actions
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Guts_RegenBoolean[CV] Equal to False
                    • Then - Actions
                      • Set Guts_Duration[CV] = 120.00
                      • Set Guts_RegenBoolean[CV] = True
                      • Special Effect - Destroy Guts_Effect[CV]
                    • Else - Actions
                      • Set Guts_Boolean[CV] = False
                      • Set Guts_RegenBoolean[CV] = False
                      • Unit Group - Remove (Picked unit) from Guts_CDGroup
I explain the work:
-If both the Guts_Boolean and Guts_RegenBoolean are true and the hp of the hero is belows 20%, then heal himself and set Guts_Boolen to False.
-If Guts_Boolean is false and Guts_RegenBoolean is true, then the heal has already started and it wont make the spell stack.
-If both of them are False, then the spell will go on cooldown.
That's how I want it to work. But I dont know why it doesnt turn out like that.
Can anyone point out where I did it wrong?
 
Last edited:

Kusanagi Kuro

Hosted Project: SC
Level 10
Joined
Mar 11, 2012
Messages
708

Kusanagi Kuro

Hosted Project: SC
Level 10
Joined
Mar 11, 2012
Messages
708
Well. I dont mind if u dont want to help, the blood.
About the facing, im trying to do that if the attacker is in front of the barbarian, the damage done to the barbarian will be reduced.
 

Kusanagi Kuro

Hosted Project: SC
Level 10
Joined
Mar 11, 2012
Messages
708
Hmm. Thks for the advice. But that part of the spell work perfectly. I want to know why the healing part doesnt work in my map while it's work on my test map. (I copy the trigger from my map to the test map).
 
Status
Not open for further replies.
Top