CriticalStrikeTextColor=255,255,0,0~why are there 4 #'s? shouldn't it be 255,255,255?
CriticalStrikeTextColor=255,255,0,0~why are there 4 #'s? shouldn't it be 255,255,255?
private function CriticalStrike takes nothing returns boolean
local real damage=GetDamageAmount()
local integer Type=GetDamageType()
local unit source
local unit target
if Flag and Type==0 then
set source=GetDamageSource()
set target=GetDamageTarget()
set Flag=false
if UnitProperties[source:Id].AttackCritical.isProc() then
call UnitDamageTargetNormal(source,target,damage)
call CriticalMsg("Critical: "+R2S(damage*2.),GetUnitX(source),GetUnitY(source),220,10,10)
endif
set Flag=true
// Im not nulling source and target here
// because I recycle my units
endif
return false
endfunction
private function init takes nothing returns nothing
local trigger t=CreateTrigger()
call TriggerRegisterDamageEvent(t)
call TriggerAddCondition(t, Condition( function CriticalStrike ))
endfunction