(Bottom is the JASS code for my trigger, but I doubt that it'd be needed)
I've got an issue when I cast an ability it just instantly runs the trigger so it doesn't activate the ability cooldown, now my question is, how do I exactly activate the cooldown / make it work?
Putting "Wait" doesn't work, since that spell trigger is based of regions > with wait it just takes center of playable map area.
Event: Unit starts effect of an ability
I've got an issue when I cast an ability it just instantly runs the trigger so it doesn't activate the ability cooldown, now my question is, how do I exactly activate the cooldown / make it work?
Putting "Wait" doesn't work, since that spell trigger is based of regions > with wait it just takes center of playable map area.
Event: Unit starts effect of an ability
Code:
function Trig_Call_of_the_Earth_Copy_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A00Q' ) ) then
return false
endif
return true
endfunction
function Trig_Call_of_the_Earth_Copy_Func001Func001Func002Func001Func001Func001Func001Func001C takes nothing returns boolean
if ( not ( GetUnitAbilityLevelSwapped('A00Q', GetSpellAbilityUnit()) == 6 ) ) then
return false
endif
return true
endfunction
function Trig_Call_of_the_Earth_Copy_Func001Func001Func002Func001Func001Func001Func001C takes nothing returns boolean
if ( not ( GetUnitAbilityLevelSwapped('A00Q', GetSpellAbilityUnit()) == 5 ) ) then
return false
endif
return true
endfunction
function Trig_Call_of_the_Earth_Copy_Func001Func001Func002Func001Func001Func001C takes nothing returns boolean
if ( not ( GetUnitAbilityLevelSwapped('A00Q', GetSpellAbilityUnit()) == 4 ) ) then
return false
endif
return true
endfunction
function Trig_Call_of_the_Earth_Copy_Func001Func001Func002Func001Func001C takes nothing returns boolean
if ( not ( GetUnitAbilityLevelSwapped('A00Q', GetSpellAbilityUnit()) == 3 ) ) then
return false
endif
return true
endfunction
function Trig_Call_of_the_Earth_Copy_Func001Func001Func002Func001C takes nothing returns boolean
if ( not ( GetUnitAbilityLevelSwapped('A00Q', GetSpellAbilityUnit()) == 2 ) ) then
return false
endif
return true
endfunction
function Trig_Call_of_the_Earth_Copy_Func001Func001Func002C takes nothing returns boolean
if ( not ( GetUnitAbilityLevelSwapped('A00Q', GetSpellAbilityUnit()) == 1 ) ) then
return false
endif
return true
endfunction
function Trig_Call_of_the_Earth_Copy_Func001Func001C takes nothing returns boolean
if ( not ( IsPlayerEnemy(GetOwningPlayer(GetEnumUnit()), GetOwningPlayer(GetSpellAbilityUnit())) == true ) ) then
return false
endif
return true
endfunction
function Trig_Call_of_the_Earth_Copy_Func001A takes nothing returns nothing
if ( Trig_Call_of_the_Earth_Copy_Func001Func001C() ) then
if ( Trig_Call_of_the_Earth_Copy_Func001Func001Func002C() ) then
call UnitDamageTargetBJ( GetSpellAbilityUnit(), GetEnumUnit(), ( 35.00 + ( ( I2R(GetHeroStatBJ(bj_HEROSTAT_AGI, GetSpellAbilityUnit(), true)) * 0.50 ) + ( I2R(GetHeroStatBJ(bj_HEROSTAT_INT, GetSpellAbilityUnit(), true)) * 0.10 ) ) ), ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL )
else
if ( Trig_Call_of_the_Earth_Copy_Func001Func001Func002Func001C() ) then
call UnitDamageTargetBJ( GetSpellAbilityUnit(), GetEnumUnit(), ( 50.00 + ( ( I2R(GetHeroStatBJ(bj_HEROSTAT_AGI, GetSpellAbilityUnit(), true)) * 0.50 ) + ( I2R(GetHeroStatBJ(bj_HEROSTAT_INT, GetSpellAbilityUnit(), true)) * 0.10 ) ) ), ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL )
else
if ( Trig_Call_of_the_Earth_Copy_Func001Func001Func002Func001Func001C() ) then
call UnitDamageTargetBJ( GetSpellAbilityUnit(), GetEnumUnit(), ( 80.00 + ( ( I2R(GetHeroStatBJ(bj_HEROSTAT_AGI, GetSpellAbilityUnit(), true)) * 0.50 ) + ( I2R(GetHeroStatBJ(bj_HEROSTAT_INT, GetSpellAbilityUnit(), true)) * 0.10 ) ) ), ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL )
else
if ( Trig_Call_of_the_Earth_Copy_Func001Func001Func002Func001Func001Func001C() ) then
call UnitDamageTargetBJ( GetSpellAbilityUnit(), GetEnumUnit(), ( 105.00 + ( ( I2R(GetHeroStatBJ(bj_HEROSTAT_AGI, GetSpellAbilityUnit(), true)) * 0.50 ) + ( I2R(GetHeroStatBJ(bj_HEROSTAT_INT, GetSpellAbilityUnit(), true)) * 0.10 ) ) ), ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL )
else
if ( Trig_Call_of_the_Earth_Copy_Func001Func001Func002Func001Func001Func001Func001C() ) then
call UnitDamageTargetBJ( GetSpellAbilityUnit(), GetEnumUnit(), ( 125.00 + ( ( I2R(GetHeroStatBJ(bj_HEROSTAT_AGI, GetSpellAbilityUnit(), true)) * 0.50 ) + ( I2R(GetHeroStatBJ(bj_HEROSTAT_INT, GetSpellAbilityUnit(), true)) * 0.10 ) ) ), ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL )
else
if ( Trig_Call_of_the_Earth_Copy_Func001Func001Func002Func001Func001Func001Func001Func001C() ) then
call UnitDamageTargetBJ( GetSpellAbilityUnit(), GetEnumUnit(), ( 160.00 + ( ( I2R(GetHeroStatBJ(bj_HEROSTAT_AGI, GetSpellAbilityUnit(), true)) * 0.50 ) + ( I2R(GetHeroStatBJ(bj_HEROSTAT_INT, GetSpellAbilityUnit(), true)) * 0.10 ) ) ), ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL )
else
endif
endif
endif
endif
endif
endif
else
call DoNothing( )
endif
endfunction
function Trig_Call_of_the_Earth_Copy_Actions takes nothing returns nothing
call ForGroupBJ( GetUnitsInRectAll(RectFromCenterSizeBJ(GetSpellTargetLoc(), 300.00, 300.00)), function Trig_Call_of_the_Earth_Copy_Func001A )
call AddSpecialEffectLocBJ( GetRectCenter(RectFromCenterSizeBJ(GetSpellTargetLoc(), 300.00, 300.00)), "Abilities\\Spells\\Human\\ThunderClap\\ThunderClapCaster.mdl" )
call AddSpecialEffectLocBJ( GetRectCenter(RectFromCenterSizeBJ(GetSpellTargetLoc(), 300.00, 300.00)), "Abilities\\Spells\\Orc\\WarStomp\\WarStompCaster.mdl" )
call TerrainDeformationCraterBJ( 2.00, false, GetSpellTargetLoc(), 300.00, 64.00 )
call SetUnitPositionLoc( GetSpellAbilityUnit(), GetSpellTargetLoc() )
endfunction
//===========================================================================
function InitTrig_Call_of_the_Earth_Copy takes nothing returns nothing
set gg_trg_Call_of_the_Earth_Copy = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Call_of_the_Earth_Copy, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Call_of_the_Earth_Copy, Condition( function Trig_Call_of_the_Earth_Copy_Conditions ) )
call TriggerAddAction( gg_trg_Call_of_the_Earth_Copy, function Trig_Call_of_the_Earth_Copy_Actions )
endfunction