Intiate attack
Events
Unit - A unit Is attacked
Conditions
(Attacking unit) Equal to [Attacking unit VAR]
((Attacked unit) belongs to an enemy of (Owner of [Attacking unit VAR]))Equal to True
Actions
Set ADattackedUnit = (Attacked unit)
Trigger - Add to Unit takes Damage <gen> the event (Unit - ADattackedUnit Takes damage)
Trigger - Turn on Unit takes Damage <gen>
//This trigger just detects who is attacked and if they are firendly or enemies. I took out the % chance but that's easy to put in, it's just another condition that checks for a random numbers being less or equal than the value for % that you want). Make sure that the unit is stored as a global otherwise this will not work
Unit takes Damage
Events
Conditions
(Damage source) Equal to [Attacking unit VAR]
Actions
Unit - Cause PlayerDamager[(Player number of (Owner of [Attacking unit VAR]))] to damage (ADattackedUnit), dealing [crit value] damage of attack type Hero and damage type Normal
Floating Text - Create floating text that reads (Smashed + !) at (Position of (Picked unit)) with Z offset 100.00, using font size 8.00, color (100.00%, 0.00%, 0.00%), and 15.00% transparency
Floating Text - Set the velocity of Last created floating text to 64.00 towards 90.00 degrees
Floating Text - Change Last rcreated floatign text: Disable permanence
Floating Text - Change the lifespan of Last created floating text to 1.30 seconds
Floating Text - Change the fading age of Last created floating text to 0.70 seconds
Trigger - Turn off (This trigger)
//This checks that the attacked unit took damage first before applying the crit damage (sometimes when ur gonna crit you do miss). Don't worry about turning this on and off as if refreshes each time you attack so it never screws up.