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

Evolution trigger doesn t work :/

Status
Not open for further replies.
Level 26
Joined
Dec 3, 2018
Messages
873
  • Mate
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Mate
    • Actions
      • Set VariableSet Random = (Random integer number between 1 and 3)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Random Equal to 1
        • Then - Actions
          • Unit - Order (Target unit of ability being cast) to Stop.
          • Unit - Set mana of (Target unit of ability being cast) to ((Mana of (Target unit of ability being cast)) - 80.00)
          • Unit - Create 1 Furbolg for Player 2 (Blue) at (Position of (Target unit of ability being cast)) facing Default building facing degrees
          • Set VariableSet Random = (Random integer number between 1 and 3)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Random Equal to 1
            • Then - Actions
              • Unit - Set Unit: (Last created unit)'s Weapon Integer Field: Attack Damage Base ('ua1b')at Index:1 to Value: ((Base Damage of (Target unit of ability being cast) for weapon index 1) - 4)
              • Unit - Set Max HP of (Last created unit) to ((Max HP of (Target unit of ability being cast)) + 25)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Random Equal to 2
                • Then - Actions
                  • Unit - Set Unit: (Last created unit)'s Weapon Integer Field: Attack Damage Base ('ua1b')at Index:1 to Value: ((Base Damage of (Target unit of ability being cast) for weapon index 1) + 4)
                  • Unit - Set Max HP of (Last created unit) to ((Max HP of (Target unit of ability being cast)) - 25)
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Random Equal to 3
                    • Then - Actions
                      • Unit - Set Unit: (Last created unit)'s Weapon Integer Field: Attack Damage Base ('ua1b')at Index:1 to Value: (Unit: (Target unit of issued order)'s Weapon Integer Field: Attack Damage Base ('ua1b') at Index:1)
                      • Unit - Set Max HP of (Last created unit) to ((Max HP of (Target unit of ability being cast)) + 0)
                      • Do nothing
                    • Else - Actions
        • Else - Actions
units end up having more damage than they should
 
Level 26
Joined
Dec 3, 2018
Messages
873
  • Mate
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Mate
    • Actions
      • Set VariableSet Random = (Random integer number between 1 and 3)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Random Equal to 1
        • Then - Actions
          • Unit - Order (Target unit of ability being cast) to Stop.
          • Unit - Set mana of (Target unit of ability being cast) to ((Mana of (Target unit of ability being cast)) - 80.00)
          • Unit - Create 1 Furbolg for Player 2 (Blue) at (Position of (Target unit of ability being cast)) facing Default building facing degrees
          • Set VariableSet Random = (Random integer number between 1 and 3)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Random Equal to 1
            • Then - Actions
              • Unit - Set Base Damage of (Last created unit) to ((Base Damage of (Target unit of ability being cast) for weapon index 1) - 4) for weapon index: 1
              • Unit - Set Max HP of (Last created unit) to ((Max HP of (Target unit of ability being cast)) + 25)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Random Equal to 2
                • Then - Actions
                  • Unit - Set Base Damage of (Last created unit) to ((Base Damage of (Target unit of ability being cast) for weapon index 1) + 4) for weapon index: 1
                  • Unit - Set Max HP of (Last created unit) to ((Max HP of (Target unit of ability being cast)) - 25)
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Random Equal to 3
                    • Then - Actions
                      • Unit - Set Base Damage of (Last created unit) to ((Base Damage of (Target unit of ability being cast) for weapon index 1) + 0) for weapon index: 1
                      • Unit - Set Max HP of (Last created unit) to ((Max HP of (Target unit of ability being cast)) + 0)
                      • Do nothing
                    • Else - Actions
        • Else - Actions
still not working
 

Wrda

Spell Reviewer
Level 26
Joined
Nov 18, 2012
Messages
1,887
Maybe doesn't work because you're changing the unit's 2nd attack, which is weapon index 1. You need index 0.
Use common sense to debug...
Now, even if you do this, there's a 66% chance that the trigger won't do anything because you only check if the first random number is 1. You're not accounting for other scenarios.
 
Level 26
Joined
Dec 3, 2018
Messages
873
Maybe doesn't work because you're changing the unit's 2nd attack, which is weapon index 1. You need index 0.
Use common sense to debug...
Now, even if you do this, there's a 66% chance that the trigger won't do anything because you only check if the first random number is 1. You're not accounting for other scenarios.
That 1/3 means that there is a chance that they won t reproduce even if one side wants it. Nope it grows sometimes without the life to go down.
 
Status
Not open for further replies.
Top