• 🏆 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] Having the life of the target 80%

Status
Not open for further replies.
Level 5
Joined
Mar 24, 2008
Messages
98
I tried to make this spell but the time i cast a spell on the unit that has 50% life goes to 80% let me show the trigger
Code:
Events
Unit starts the effect of an ability
Conditions
(Ability being cast) Equal to Demi
Actions
    Set c = (Casting unit)
    Set t = (Target unit of ability being cast)
    If ((Level of Demi  for c) Equal to 1) then do (Unit - Set life of t to 80.00%) else do (Do nothing)
    If ((Level of Demi  for c) Equal to 2) then do (Unit - Set life of t to 60.00%) else do (Do nothing)
    If ((Level of Demi  for c) Equal to 3) then do (Unit - Set life of t to 40.00%) else do (Do nothing)
Pls tell how to arrange the spell?
 
  • Demi
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Demi
    • Actions
      • Set TempUnitA = (Casting unit)
      • Set TempUnitB = (Target unit of ability being cast)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Demi for TempUnitA) Equal to 1
        • Then - Actions
          • Unit - Set life of TempUnitB to ((Percentage life of TempUnitB) - 20.00)%
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Demi for TempUnitA) Equal to 2
        • Then - Actions
          • Unit - Set life of TempUnitB to ((Percentage life of TempUnitB) - 30.00)%
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Demi for TempUnitA) Equal to 3
        • Then - Actions
          • Unit - Set life of TempUnitB to ((Percentage life of TempUnitB) - 40.00)%
        • Else - Actions
Next time, wrap your trigger in Trigger Tags:
Trigger.gif
, not Jass Tags.
 
Level 12
Joined
May 4, 2008
Messages
1,111
  • Demi
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Demi
    • Actions
      • Set TempUnitA = (Casting unit)
      • Set TempUnitB = (Target unit of ability being cast)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Demi for TempUnitA) Equal to 1
        • Then - Actions
          • Unit - Set life of TempUnitB to ((Percentage life of TempUnitB) - 20.00)%
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Demi for TempUnitA) Equal to 2
        • Then - Actions
          • Unit - Set life of TempUnitB to ((Percentage life of TempUnitB) - 30.00)%
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Demi for TempUnitA) Equal to 3
        • Then - Actions
          • Unit - Set life of TempUnitB to ((Percentage life of TempUnitB) - 40.00)%
        • Else - Actions
Next time, wrap your trigger in Trigger Tags:
Trigger.gif
, not Jass Tags.


EDIT: ahhh gawd i jsust posted it too late XD u posted it be4 meh
 
Status
Not open for further replies.
Top