Hi, Please tell me why this trigger is not working?
The Ability A00A should have it's cooldown reset on a 20% chance on each normal attack, but it never activates even if i remove the chance condition.
I just started learning Jass and GUI conversion is how I'm trying to do it.
I'm on patch 1.31 if that makes a difference.
Thank you.
JASS:
function Slammed takes nothing returns boolean
if ( not ( GetEventDamage() > 0.00 ) ) then
return false
endif
if ( not ( GetUnitAbilityLevelSwapped('A00A', GetEventDamageSource()) >= 1 ) ) then
return false
endif
if ( not ( BlzGetUnitAbilityCooldownRemaining(GetEventDamageSource(), 'A00A') > 0.00 ) ) then
return false
endif
if ( not (BlzGetEventAttackType() != ATTACK_TYPE_NORMAL ) ) then
return false
endif
if ( not ( GetRandomInt (1, 5) == ( 1 ) ) ) then
return false
endif
return true
endfunction
function RageOn takes nothing returns nothing
local unit w = GetEventDamageSource()
local texttag rb
call BlzEndUnitAbilityCooldown( w, 'A00A' )
set rb = CreateTextTagUnitBJ( "<Raging Blow!>", w, 0, 10.00, 0.00, 100.00, 0.00, 0 )
call ShowTextTagForceBJ( false, rb, GetPlayersAll() )
set udg_tempForce = GetForceOfPlayer(GetOwningPlayer(w))
call ShowTextTagForceBJ( true, rb, udg_tempForce )
call DestroyForce(udg_tempForce)
call SetTextTagVelocityBJ( rb, 100.00, 90 )
call SetTextTagPermanentBJ( rb, false )
call SetTextTagFadepointBJ( rb, 2.00 )
call SetTextTagLifespanBJ( rb, 3.00 )
endfunction
//===========================================================================
function InitTrig_Warr_Attack takes nothing returns nothing
local trigger Slam= CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ(Slam, EVENT_PLAYER_UNIT_DAMAGING)
call TriggerAddCondition( Slam, Condition( function Slammed ) )
call TriggerAddAction( Slam, function RageOn )
set Slam = null
endfunction
The Ability A00A should have it's cooldown reset on a 20% chance on each normal attack, but it never activates even if i remove the chance condition.
I just started learning Jass and GUI conversion is how I'm trying to do it.
I'm on patch 1.31 if that makes a difference.
Thank you.