LearningCode
New Member
- Reaction score
- 24
Yea..
Basically, I wanted a tower to have a 20% chance to cause units in a 300AoE of the attacked unit to be stunned for 1.0 seconds.
So, tower attacks Creep.
Trigger calculates if it will Proc this time.
It does.
Trigger creates dummy unit at Attacked unit.
Trigger makes dummy cast WarStomp
Creeps are stunned
Trigger removes dummy from game
Easy enough.
But the problem is, that when I introduce the "Trigger calculates if it will proc", Even if I set the percentage to 100%, the trigger does not create the dummy unit at all.
This does not work:
This works, but I'd like to know if it is MUI:
Basically, I wanted a tower to have a 20% chance to cause units in a 300AoE of the attacked unit to be stunned for 1.0 seconds.
So, tower attacks Creep.
Trigger calculates if it will Proc this time.
It does.
Trigger creates dummy unit at Attacked unit.
Trigger makes dummy cast WarStomp
Creeps are stunned
Trigger removes dummy from game
Easy enough.
But the problem is, that when I introduce the "Trigger calculates if it will proc", Even if I set the percentage to 100%, the trigger does not create the dummy unit at all.
This does not work:
Trigger:
- Events
- Unit - A unit owned by Player 12 (Brown) Is attacked
- Conditions
- (Unit-type of (Attacking unit)) Equal to Basher
- Actions
- Custom script: local interger udg_BashChance
- Custom script: local unit udg_Bash
- Set BashChance = (Random integer number between 1 and 10)
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- BashChance Less than 2
- Then - Actions
- Unit - Create 1 StunDummy for (Owner of (Attacking unit)) at (Position of (Attacked unit)) facing Default building facing degrees
- Set Bash = (Last created unit)
- Unit - Set level of War Stomp (Neutral Creep 1) for Bash to 1
- Unit - Order Bash to Orc Tauren Chieftain - WarStomp
- Unit - Remove Bash from the game
- Else - Actions
- If - Conditions
- Custom script: call RemoveUnit(udg_Bash)
This works, but I'd like to know if it is MUI:
Trigger:
- Events
- Unit - A unit owned by Player 12 (Brown) Is attacked
- Conditions
- (Unit-type of (Attacking unit)) Equal to Basher
- Actions
- Custom script: local unit udg_Bash
- Unit - Create 1 StunDummy for (Owner of (Attacking unit)) at (Position of (Attacked unit)) facing Default building facing degrees
- Set Bash = (Last created unit)
- Unit - Set level of War Stomp (Neutral Creep 1) for Bash to 1
- Unit - Order Bash to Orc Tauren Chieftain - WarStomp
- Unit - Remove Bash from the game
- Custom script: call RemoveUnit(udg_Bash)