Critical Strike Ability
Events
Conditions
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Owner of (Damage source)) Not equal to Player 12 (Brown)
(Damage taken) Greater than 20.00
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Level of Critical Strike Attack for (Damage source)) Equal to 1
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Random integer number between 1 and 100) Less than or equal to 20
Then - Actions
Unit - Cause (Damage source) to damage (Triggering unit), dealing ((Damage taken) x 2.00) damage of attack type Pierce and damage type Normal
Floating Text - Create floating text that reads Doubled! above (Damage source) with Z offset 0.00, using font size 10.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
Floating Text - Change (Last created floating text): Disable permanence
Floating Text - Change the lifespan of (Last created floating text) to 1.50 seconds
Floating Text - Change the fading age of (Last created floating text) to 1.00 seconds
Else - Actions
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Level of Critical Strike Attack for (Damage source)) Equal to 2
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Random integer number between 1 and 100) Less than or equal to 25
Then - Actions
Unit - Cause (Damage source) to damage (Triggering unit), dealing ((Damage taken) x 3.00) damage of attack type Pierce and damage type Normal
Floating Text - Create floating text that reads Tripled!! above (Damage source) with Z offset 0.00, using font size 10.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
Floating Text - Change (Last created floating text): Disable permanence
Floating Text - Change the lifespan of (Last created floating text) to 1.50 seconds
Floating Text - Change the fading age of (Last created floating text) to 1.00 seconds
Else - Actions
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Level of Critical Strike Attack for (Damage source)) Equal to 3
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Random integer number between 1 and 100) Less than or equal to 30
Then - Actions
Unit - Cause (Damage source) to damage (Triggering unit), dealing ((Damage taken) x 4.00) damage of attack type Pierce and damage type Normal
Floating Text - Create floating text that reads QUADRUPLED! above (Damage source) with Z offset 0.00, using font size 10.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
Floating Text - Change (Last created floating text): Disable permanence
Floating Text - Change the lifespan of (Last created floating text) to 1.50 seconds
Floating Text - Change the fading age of (Last created floating text) to 1.00 seconds
Else - Actions
Else - Actions
Else - Actions
Unit Group - Pick every unit in Tempgroup and do (Actions)
Loop - Actions
Trigger - Add to Critical Strike Ability <gen> the event (Unit - (Picked unit) Takes damage)
Untitled Trigger 001
Events
Conditions
Actions
Game - Display to (All players) the text: (String((Current order of (Damage source))))
Untitled Trigger 002
Events
Map initialization
Conditions
Actions
Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
Loop - Actions
Trigger - Add to Untitled Trigger 001 <gen> the event (Unit - (Picked unit) Takes damage)
Don't answer to this thread if your just gonna say "This is to hard for me" or "Just use the normal one" or "Why do you want a triggered critical".
BTW this is untested and very stupid, but why not just make a global boolean, and have a trigger that just goes E - a unit is attacked A - set the boolean = true, wait 0.01, set it to false. Then on the damage trigger, check if the boolean is true.
It would only work to an extent, it'd probably mess up a lot if you have a lot of units
function FloatingText takes string message, integer red, integer green, integer blue returns nothing
local texttag Text = CreateTextTag()
local integer a = 16
call SetTextTagPosUnit(Text, GetTriggerUnit(), 0)
call SetTextTagText(Text, message, TextTagSize2Height(16.00))
call SetTextTagColor(Text, red, green, blue, 0)
call SetTextTagVelocityBJ(Text,20.00,90.00)
loop
exitwhen a<8
set a = a - 1
call SetTextTagText(Text, message, TextTagSize2Height(a))
call TriggerSleepAction(0.10)
endloop
call DestroyTextTag(Text)
endfunction
function CriticalStrike takes real Multiplier, integer Chance returns nothing
local real Damage = GetEventDamage()
local unit DamageSource = GetEventDamageSource()
local unit Damagee = GetTriggerUnit()
local integer CriticalDamage
if GetRandomInt(1,100) <= Chance then
call SetUnitState(Damagee,UNIT_STATE_LIFE, GetUnitState(Damagee,UNIT_STATE_LIFE) + Damage)
set CriticalDamage = R2I(Damage) * R2I(Multiplier)
call UnitDamageTarget(DamageSource,Damagee,(I2R(CriticalDamage)),true,false,ATTACK_TYPE_CHAOS,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS)
call FloatingText(I2S(CriticalDamage) + "!",255,0,0)
endif
set DamageSource = null
set Damagee = null
endfunction