• 🏆 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!

[Trigger Spell] I need help for runs my spell

Status
Not open for further replies.
Level 8
Joined
Mar 24, 2011
Messages
353
The complete is: When an "X" unit takes more than 15% of its max life of damage in less than 1 second of the actions "Y".

X = My Mage
Y = The Actions thats i can want put in the trigger, this i know. But how triggers is actived i dont know how do :/

Example: My mage has 400 of total life.. 15% of 400 = 60.. If in less than 1 second my mage takes more than 60 of damage, the triggers is actived and do the actions.. Understand? :/

Ps: sorry english errors
Ps²: Need to me "triggers" but i dont understand "nothing" of jass or like'
 
Level 18
Joined
Nov 21, 2012
Messages
835
grab Unit Event
GUI Unit Event v2.3.0.0

  • t1
    • Events
      • Game - UnitIndexEvent becomes Equal to 1.00
    • Conditions
      • (Unit-type of UDexUnits[UDex]) Equal to Sorceress
    • Actions
      • Unit Group - Add UDexUnits[UDex] to MageGroup
      • Set MageLifePercent[UDex] = (Percentage life of UDexUnits[UDex])
  • t2
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in MageGroup and do (Actions)
        • Loop - Actions
          • Set tempUnit = (Picked unit)
          • Set tempInt = (Custom value of tempUnit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • IsUnitAlive[tempInt] Equal to False
            • Then - Actions
              • Unit Group - Remove tempUnit from MageGroup
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (MageLifePercent[tempInt] - (Percentage life of tempUnit)) Greater than 15.00
                • Then - Actions
                  • Set Mage = tempUnit
                  • Trigger - Run t3 <gen> (ignoring conditions)
                  • Set Mage = No unit
                • Else - Actions
              • Set MageLifePercent[tempInt] = (Percentage life of tempUnit)
  • t3
    • Events
    • Conditions
    • Actions
      • Special Effect - Create a special effect at (Position of Mage) using Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl
      • Unit - Set life of Mage to 100.00%
good luck ;)
 
Level 24
Joined
Feb 9, 2009
Messages
1,787
If you mean like damaged for 15% instead of getting damaged to the point of only 15% health I would suggest GUI Damage Engine

The Damage system stores damage dealt within a pool on the unit, while a timer resets this if it passes 1 sec

  • Panic Button Init
    • Events
      • Game - UnitIndexEvent becomes Equal to 1.00
    • Conditions
      • (Unit-type of UDexUnits[UDex]) Equal to Fallen Priest
    • Actions
      • Unit Group - Add UDexUnits[UDex] to PB_Group
      • Set PB_DamagePool[UDex] = 0.00
      • Set PB_Reset[UDex] = 0.00
  • Panic Button Damage
    • Events
      • Game - DamageModifierEvent becomes Equal to 1.00
    • Conditions
      • (Unit-type of DamageEventTarget) Equal to Fallen Priest
    • Actions
      • Set Tempkey = (Custom value of DamageEventTarget)
      • Set PB_DamagePool[Tempkey] = (PB_DamagePool[Tempkey] + DamageEventAmount)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • PB_Reset[Tempkey] Less than or equal to 0.00
        • Then - Actions
          • Set PB_Reset[Tempkey] = 1.00
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • PB_DamagePool[Tempkey] Greater than ((Max life of DamageEventTarget) x 0.15)
        • Then - Actions
          • Set PB_DamagePool[Tempkey] = 0.00
          • Special Effect - Create a special effect attached to the chest of DamageEventTarget using Abilities\Spells\Undead\DeathandDecay\DeathandDecayTarget.mdl
          • Special Effect - Destroy (Last created special effect)
        • Else - Actions
  • Panic Button Loop
    • Events
      • Time - Every 0.50 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in PB_Group and do (Actions)
        • Loop - Actions
          • Set Tempkey = (Custom value of (Picked unit))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • PB_DamagePool[Tempkey] Greater than 0.00
            • Then - Actions
              • Set PB_Reset[Tempkey] = (PB_Reset[Tempkey] - 0.50)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • PB_Reset[Tempkey] Less than or equal to 0.00
                • Then - Actions
                  • Set PB_DamagePool[Tempkey] = 0.00
                  • Special Effect - Create a special effect attached to the chest of (Picked unit) using Abilities\Spells\Human\SpellSteal\SpellStealMissile.mdl
                  • Special Effect - Destroy (Last created special effect)
                • Else - Actions
            • Else - Actions
              • Set PB_Reset[Tempkey] = 0.00
 
Last edited:
Status
Not open for further replies.
Top