- Joined
- Jun 20, 2017
- Messages
- 380
I have a few rounds in my map,
So if the current level is 4
It should give my unit a random ability between 1 and 3(You can only have 1 of these abilities).
Or when a round reaches 12/20/24/28/30
It should give my unit a random ability between 4 and 8(You can have all of these abilities, but when you reach those levels, 1 per level).
I tried to use @Pyrogasm method! https://www.hiveworkshop.com/threads/adding-random-non-duplicate-abilities.319691/
But the issue is that I cannot have more than one ability!
So if the current level is 4
It should give my unit a random ability between 1 and 3(You can only have 1 of these abilities).
Or when a round reaches 12/20/24/28/30
It should give my unit a random ability between 4 and 8(You can have all of these abilities, but when you reach those levels, 1 per level).
I tried to use @Pyrogasm method! https://www.hiveworkshop.com/threads/adding-random-non-duplicate-abilities.319691/
But the issue is that I cannot have more than one ability!
-
Setup Champion Abilities
-
Events
- Map initialization
- Conditions
-
Actions
- Set VariableSet AbilityCodes_Champion[1] = War Stomp [King]
- Set VariableSet AbilityCodes_Champion[2] = Shockwave [King]
- Set VariableSet AbilityCodes_Champion[3] = Permanent Immolation [King]
- -------- --------
- Set VariableSet AbilityCodes_Champion[4] = Command Aura [King]
- Set VariableSet AbilityCodes_Champion[5] = Devotion Aura [King]
- Set VariableSet AbilityCodes_Champion[6] = Endurance Aura [King]
- Set VariableSet AbilityCodes_Champion[7] = Critical Strike [King]
- Set VariableSet AbilityCodes_Champion[8] = Evasion [King]
-
Events
-
Champion Abilities
- Events
- Conditions
-
Actions
-
For each (Integer Integer_ChampionAbilities) from 1 to 1, do (Actions)
-
Loop - Actions
- Set VariableSet AbilityCodes_Champion[1] = AbilityCodes_Champion[(Random integer number between 1 and 3)]
- Set VariableSet AbilityCodes_Champion[2] = AbilityCodes_Champion[(Random integer number between 4 and 8)]
- -------- --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- AbilityCodes_Champion[1] Not equal to AbilityCodes_Champion[2]
- AbilityCodes_Champion[2] Not equal to AbilityCodes_Champion[3]
- AbilityCodes_Champion[3] Not equal to AbilityCodes_Champion[1]
- Integer_CurrentLevel Equal to 4
-
Then - Actions
- Unit - Add AbilityCodes_Champion[1] to West Champion 0448 <gen>
- Game - Display to (All allies of Player 23 (Emerald).) for 10.00 seconds the text: ((((Name of West Champion 0448 <gen>) + learned the |cffffcc00) + (Name of AbilityCodes_Champion[1])) + |r ability.)
- -------- --------
- Unit - Add AbilityCodes_Champion[1] to East Champion 0447 <gen>
- Game - Display to (All allies of Player 24 (Peanut).) for 10.00 seconds the text: ((((Name of East Champion 0447 <gen>) + learned the |cffffcc00) + (Name of AbilityCodes_Champion[1])) + |r ability.)
-
Else - Actions
- Set VariableSet Integer_ChampionAbilities = (Integer_ChampionAbilities - 1)
-
If - Conditions
- -------- --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- AbilityCodes_Champion[4] Not equal to AbilityCodes_Champion[5]
- AbilityCodes_Champion[5] Not equal to AbilityCodes_Champion[6]
- AbilityCodes_Champion[6] Not equal to AbilityCodes_Champion[7]
- AbilityCodes_Champion[7] Not equal to AbilityCodes_Champion[8]
- AbilityCodes_Champion[8] Not equal to AbilityCodes_Champion[4]
- Integer_CurrentLevel Equal to 12
-
Then - Actions
- Unit - Add AbilityCodes_Champion[2] to West Champion 0448 <gen>
- Game - Display to (All allies of Player 23 (Emerald).) for 10.00 seconds the text: ((((Name of West Champion 0448 <gen>) + learned the |cffffcc00) + (Name of AbilityCodes_Champion[2])) + |r ability.)
- -------- --------
- Unit - Add AbilityCodes_Champion[2] to East Champion 0447 <gen>
- Game - Display to (All allies of Player 24 (Peanut).) for 10.00 seconds the text: ((((Name of East Champion 0447 <gen>) + learned the |cffffcc00) + (Name of AbilityCodes_Champion[2])) + |r ability.)
-
Else - Actions
- Set VariableSet Integer_ChampionAbilities = (Integer_ChampionAbilities - 1)
-
If - Conditions
- -------- --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- AbilityCodes_Champion[4] Not equal to AbilityCodes_Champion[5]
- AbilityCodes_Champion[5] Not equal to AbilityCodes_Champion[6]
- AbilityCodes_Champion[6] Not equal to AbilityCodes_Champion[7]
- AbilityCodes_Champion[7] Not equal to AbilityCodes_Champion[8]
- AbilityCodes_Champion[8] Not equal to AbilityCodes_Champion[4]
- Integer_CurrentLevel Equal to 20
-
Then - Actions
- Unit - Add AbilityCodes_Champion[2] to West Champion 0448 <gen>
- Game - Display to (All allies of Player 23 (Emerald).) for 10.00 seconds the text: ((((Name of West Champion 0448 <gen>) + learned the |cffffcc00) + (Name of AbilityCodes_Champion[2])) + |r ability.)
- -------- --------
- Unit - Add AbilityCodes_Champion[2] to East Champion 0447 <gen>
- Game - Display to (All allies of Player 24 (Peanut).) for 10.00 seconds the text: ((((Name of East Champion 0447 <gen>) + learned the |cffffcc00) + (Name of AbilityCodes_Champion[2])) + |r ability.)
-
Else - Actions
- Set VariableSet Integer_ChampionAbilities = (Integer_ChampionAbilities - 1)
-
If - Conditions
- -------- --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- AbilityCodes_Champion[4] Not equal to AbilityCodes_Champion[5]
- AbilityCodes_Champion[5] Not equal to AbilityCodes_Champion[6]
- AbilityCodes_Champion[6] Not equal to AbilityCodes_Champion[7]
- AbilityCodes_Champion[7] Not equal to AbilityCodes_Champion[8]
- AbilityCodes_Champion[8] Not equal to AbilityCodes_Champion[4]
- Integer_CurrentLevel Equal to 24
-
Then - Actions
- Unit - Add AbilityCodes_Champion[2] to West Champion 0448 <gen>
- Game - Display to (All allies of Player 23 (Emerald).) for 10.00 seconds the text: ((((Name of West Champion 0448 <gen>) + learned the |cffffcc00) + (Name of AbilityCodes_Champion[2])) + |r ability.)
- -------- --------
- Unit - Add AbilityCodes_Champion[2] to East Champion 0447 <gen>
- Game - Display to (All allies of Player 24 (Peanut).) for 10.00 seconds the text: ((((Name of East Champion 0447 <gen>) + learned the |cffffcc00) + (Name of AbilityCodes_Champion[2])) + |r ability.)
-
Else - Actions
- Set VariableSet Integer_ChampionAbilities = (Integer_ChampionAbilities - 1)
-
If - Conditions
- -------- --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- AbilityCodes_Champion[4] Not equal to AbilityCodes_Champion[5]
- AbilityCodes_Champion[5] Not equal to AbilityCodes_Champion[6]
- AbilityCodes_Champion[6] Not equal to AbilityCodes_Champion[7]
- AbilityCodes_Champion[7] Not equal to AbilityCodes_Champion[8]
- AbilityCodes_Champion[8] Not equal to AbilityCodes_Champion[4]
- Integer_CurrentLevel Equal to 28
-
Then - Actions
- Unit - Add AbilityCodes_Champion[2] to West Champion 0448 <gen>
- Game - Display to (All allies of Player 23 (Emerald).) for 10.00 seconds the text: ((((Name of West Champion 0448 <gen>) + learned the |cffffcc00) + (Name of AbilityCodes_Champion[2])) + |r ability.)
- -------- --------
- Unit - Add AbilityCodes_Champion[2] to East Champion 0447 <gen>
- Game - Display to (All allies of Player 24 (Peanut).) for 10.00 seconds the text: ((((Name of East Champion 0447 <gen>) + learned the |cffffcc00) + (Name of AbilityCodes_Champion[2])) + |r ability.)
-
Else - Actions
- Set VariableSet Integer_ChampionAbilities = (Integer_ChampionAbilities - 1)
-
If - Conditions
- -------- --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- AbilityCodes_Champion[4] Not equal to AbilityCodes_Champion[5]
- AbilityCodes_Champion[5] Not equal to AbilityCodes_Champion[6]
- AbilityCodes_Champion[6] Not equal to AbilityCodes_Champion[7]
- AbilityCodes_Champion[7] Not equal to AbilityCodes_Champion[8]
- AbilityCodes_Champion[8] Not equal to AbilityCodes_Champion[4]
- Integer_CurrentLevel Equal to 30
-
Then - Actions
- Unit - Add AbilityCodes_Champion[2] to West Champion 0448 <gen>
- Game - Display to (All allies of Player 23 (Emerald).) for 10.00 seconds the text: ((((Name of West Champion 0448 <gen>) + learned the |cffffcc00) + (Name of AbilityCodes_Champion[2])) + |r ability.)
- -------- --------
- Unit - Add AbilityCodes_Champion[2] to East Champion 0447 <gen>
- Game - Display to (All allies of Player 24 (Peanut).) for 10.00 seconds the text: ((((Name of East Champion 0447 <gen>) + learned the |cffffcc00) + (Name of AbilityCodes_Champion[2])) + |r ability.)
-
Else - Actions
- Set VariableSet Integer_ChampionAbilities = (Integer_ChampionAbilities - 1)
-
If - Conditions
-
Loop - Actions
-
For each (Integer Integer_ChampionAbilities) from 1 to 1, do (Actions)