function Trig_Ravage_Copy_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A002' ) ) then
return false
endif
if ( not ( GetUnitTypeId(GetSpellAbilityUnit()) == 'O001' ) ) then
return false
endif
return true
endfunction
function Trig_Ravage_Copy_Actions takes nothing returns nothing
local unit temp_unit
local location temp_point
set temp_point = GetUnitLoc(GetSpellAbilityUnit())
call CreateNUnitsAtLoc( 1, 'O002', GetOwningPlayer(GetSpellAbilityUnit()), temp_point, ( GetUnitFacing(GetSpellAbilityUnit()) + 45.00 ) )
set temp_unit = GetLastCreatedUnit()
call UnitAddAbilityBJ( 'A002', temp_unit )
call SetUnitAbilityLevelSwapped( 'A002', temp_unit, GetUnitAbilityLevelSwapped('A002', GetSpellAbilityUnit()) )
call IssuePointOrderLocBJ( temp_unit, "shockwave", PolarProjectionBJ(GetSpellTargetLoc(), 100.00, ( GetUnitFacing(GetSpellAbilityUnit()) + 45.00 )) )
call RemoveUnit( temp_unit )
call CreateNUnitsAtLoc( 1, 'O002', GetOwningPlayer(GetSpellAbilityUnit()), temp_point, ( GetUnitFacing(GetSpellAbilityUnit()) - 45.00 ) )
set temp_unit = GetLastCreatedUnit()
call UnitAddAbilityBJ( 'A002', temp_unit )
call SetUnitAbilityLevelSwapped( 'A002', temp_unit, GetUnitAbilityLevelSwapped('A002', GetSpellAbilityUnit()) )
call IssuePointOrderLocBJ( temp_unit, "shockwave", PolarProjectionBJ(GetSpellTargetLoc(), 100.00, ( GetUnitFacing(GetSpellAbilityUnit()) - 45.00 )) )
call RemoveUnit( temp_unit )
endfunction
//===========================================================================
function InitTrig_Ravage_Copy takes nothing returns nothing
set gg_trg_Ravage_Copy = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Ravage_Copy, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Ravage_Copy, Condition( function Trig_Ravage_Copy_Conditions ) )
call TriggerAddAction( gg_trg_Ravage_Copy, function Trig_Ravage_Copy_Actions )
endfunction