I'm trying to make a spell that when you cast it, you make a dummy unit that casts 1 of 10 random spell to enemy unit in entire map(4% each). and, as you level up the spell, increase the casting chance of the 10 spells of dummy by 1%. I think i know what trigger i have to make, but the problem is that this trigger will be REALLY long... is there anyway to shorten it?
*the real problem is that i can't make every condition to 4% like (say first one is less than 4, then second one should be greater or equal to 4 and less than 8)*
*the real problem is that i can't make every condition to 4% like (say first one is less than 4, then second one should be greater or equal to 4 and less than 8)*
Trigger:
- Random Chaos init
- Events
- Unit - A unit Starts the effect of an ability
- Conditions
- (Unit-type of (Triggering unit)) Equal to Witch(Black Magic Caster)
- (Ability being cast) Equal to WitchBMC - Random Chaos
- Actions
- Set Caster = (Triggering unit)
- Set Temp_Group2 = (Units owned by Player 12 (Brown) matching (((Matching unit) is A Hero) Equal to False))
- Set WitchSpellTarget = (Random unit from Temp_Group2)
- Set Temp_Point = (Position of Caster)
- Set WitchSpell[1] = Witch Random Skill 1 - hex
- Set WitchSpell[2] = Witch Random Skill 2 - Entangling roots
- Set WitchSpell[3] = Witch Random Skill 3 - Firebolt
- Set WitchSpell[4] = Witch Random Skill 4 - Bloodlust
- Set WitchSpell[5] = Witch Random Skill 5 - Starfall
- Set WitchSpell[6] = Witch Random Skill 6 - Holy Light
- Set WitchSpell[7] = Witch Random Skill 7 - Cyclone
- Unit - Create 1 Random Chaos dummy for (Owner of Caster) at (Temp_Point offset by 200.00 towards 90.00 degrees) facing Default building facing degrees
- Set RChaosdummy = (Last created unit)
- Unit Group - Add RChaosdummy to Rchaosgroup
- Custom script: call RemoveLocation(udg_Temp_Point)
- Events
Trigger:
- Random Chaos init Copy
- Events
- Time - Every 1.00 seconds of game time
- Conditions
- (Number of units in Rchaosgroup) Greater than 0
- Actions
- Set Witchspellchance = (Random integer number between 1 and 100)
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (All units of Rchaosgroup are dead) Equal to True
- Then - Actions
- Unit - Remove RChaosdummy from the game
- Else - Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- Witchspellchance Equal to 1
- Then - Actions
- Unit Group - Pick every unit in Rchaosgroup and do (Actions)
- Loop - Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- Witchspellchance Less than or equal to 4
- Then - Actions
- Unit - Add WitchSpell[1] to (Picked unit)
- Unit - Order (Picked unit) to Orc Shadow Hunter - Hex (Random unit from Temp_Group2)
- Wait 0.10 seconds
- Unit - Remove WitchSpell[1] from (Picked unit)
- Else - Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- Witchspellchance Less than or equal to 8
- Then - Actions
- -------- This isn't 4%... this is 8%.. This is where i'm stuck.. --------
- Unit - Add WitchSpell[2] to (Picked unit)
- Unit - Order (Picked unit) to Night Elf Keeper Of The Grove - Entangling Roots (Random unit from Temp_Group2)
- Wait 0.10 seconds
- Unit - Remove WitchSpell[2] from (Picked unit)
- Else - Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- Witchspellchance Less than or equal to 12
- Then - Actions
- -------- This isn't 4%... this is 12%.. This is where i'm stuck.. --------
- Unit - Add WitchSpell[3] to (Picked unit)
- Unit - Order (Picked unit) to Neutral - Firebolt (Random unit from Temp_Group2)
- Wait 0.10 seconds
- Unit - Remove WitchSpell[3] from (Picked unit)
- Else - Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- Witchspellchance Less than or equal to 16
- Then - Actions
- -------- This isn't 4%... this is 16%.. This is where i'm stuck.. --------
- Unit - Add WitchSpell[4] to (Picked unit)
- Unit - Order (Picked unit) to Orc Shaman - Bloodlust (Random unit from Temp_Group2)
- Wait 0.10 seconds
- Unit - Remove WitchSpell[4] from (Picked unit)
- Else - Actions
- -------- And so on.. --------
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Loop - Actions
- Unit Group - Pick every unit in Rchaosgroup and do (Actions)
- Else - Actions
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- Events