How can i create ability which have 30 % chance to silence atacked enemy?
silence chance
Events
Unit - A unit Is attacked
Conditions
((Attacking unit) has buff [B](a buff from a aura to detect your hero or unit who you wanna have chance to cast silence)[/B] Equal to True
(Real((Random integer number between 1 and 100))) Less than or equal to 30.00
(Unit-type of (Attacking unit)) Equal to [B]Your unit[/B] [B]Not. this can be used f you dont wanna use buff detection[/B]
Actions
Set Temp_point = (Position of (Attacked unit))
Unit - Create 1 dumy for (Owner of (Attacking unit)) at (Position of (Attacked unit)) facing Default building facing degrees
Unit - Add a 2.00 second Generic expiration timer to (Triggering unit)
Unit - Order (Last created unit) to Neutral Dark Ranger - Silence Temp_point
Custom script: call RemoveLocation(udg_Temp_point)
Conditions
((Attacking unit) has buff (a buff from a aura to detect your hero or unit who you wanna have chance to cast silence) Equal to True
Code:Code: silence chance Events Unit - A unit Is attacked Conditions ((Attacking unit) has buff (a buff from a aura to detect your hero or unit who you wanna have chance to cast silence) Equal to True (Real((Random integer number between 1 and 100))) Less than or equal to 30.00 (Unit-type of (Attacking unit)) Equal to Your unit Not. this can be used f you dont wanna use buff detection Actions Set Temp_point = (Position of (Attacked unit)) Unit - Create 1 dumy for (Owner of (Attacking unit)) at (Position of (Attacked unit)) facing Default building facing degrees Unit - Add a 2.00 second Generic expiration timer to (Triggering unit) Unit - Order (Last created unit) to Neutral Dark Ranger - Silence Temp_point Custom script: call RemoveLocation(udg_Temp_point)
Arrow Silence
Events
Unit - A unit Is attacked
Conditions
(Level of Arrow Silence for (Attacking unit)) Equal to 1
(Unit-type of (Attacking unit)) Equal to Ranger
(Real((Random integer number between 1 and 100))) Less than or equal to 15.00
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Attacked unit) has buff Soul Burn (Arrow Silence ) Equal to True
Then - Actions
Do nothing
Else - Actions
Set Arrow_Silence_Unit = (Attacked unit)
Unit - Create 1 Arrow Silence (Dummy) for (Owner of (Attacking unit)) at (Position of (Attacked unit)) facing Default building facing degrees
Unit - Order (Last created unit) to Neutral Fire Lord - Soul Burn Arrow_Silence_Unit
Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
Arrow Silence
Events
Unit - A unit Is attacked
Conditions
(Unit-type of (Attacking unit)) Equal to Ranger
(Random integer number between 1 and 100) Less than or equal to 30
((Attacked unit) has buff Soul Burn (Arrow Silence) Equal to False
Actions
Set Point = (Position of (Attacking Unit))
Unit - Create 1 Arrow Silence (Dummy) for (Owner of (Attacking Unit)) at Point facing Default building facing degrees
Unit - Order (Last created unit) to Neutral Fire Lord - Soul Burn (Attacked Unit)
Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
Custom script: call RemoveLocation (udg_Point)