I want to make a trigger that will have 4 different actions based upon probability. So i've tried something like this
It's basically a trigger where based upon a chance the unit will do different stuff.
But comparing random number between 1-100 to also random number between 1-25 doesnt seem to work.
I could do this by making few triggers and then making conditions to turn on/off the triggers but I thought this was cleaner.
Does anyone have any suggestion how can this be done via one trigger?
Code:
Centaur
Events
Unit - A unit Is attacked
Conditions
(Attacked unit) Equal to Centaur
Actions
Game - Display to (All players) the text: Centaur napadnut
Unit - Set Centaur movement speed to 500.00
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Random integer number between 1 and 100) Equal to (Random integer number between 1 and 25)
Then - Actions
Game - Display to (All players) the text: 0
Unit - Order Centaur to Move To (Random point in Centaur Area <gen>)
Unit - Order Centaur to Orc Tauren Chieftain - War Stomp
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Random integer number between 1 and 100) Equal to (Random integer number between 26 and 50)
Then - Actions
Game - Display to (All players) the text: 1
Unit - Order Centaur to Move To (Position of (Attacking unit))
Unit - Order Centaur to Orc Tauren Chieftain - War Stomp
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Random integer number between 1 and 100) Equal to (Random integer number between 51 and 75)
Then - Actions
Game - Display to (All players) the text: 2
Unit - Order Centaur to Move To (Center of Centaur <gen>)
Unit - Order Centaur to Orc Tauren Chieftain - War Stomp
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Random integer number between 1 and 100) Equal to (Random integer number between 76 and 100)
Then - Actions
Game - Display to (All players) the text: 3
Unit - Order Centaur to Orc Tauren Chieftain - War Stomp
Else - Actions
Unit - Set Centaur movement speed to (Default movement speed of Centaur)
Trigger - Turn off (This trigger)
Wait 8.00 seconds
Trigger - Turn on (This trigger)
It's basically a trigger where based upon a chance the unit will do different stuff.
But comparing random number between 1-100 to also random number between 1-25 doesnt seem to work.
I could do this by making few triggers and then making conditions to turn on/off the triggers but I thought this was cleaner.
Does anyone have any suggestion how can this be done via one trigger?