function Trig_Kamehameha_Copy_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A037' ) ) then
return false
endif
return true
endfunction
function Trig_Kamehameha_Copy_Func004002003 takes nothing returns boolean
return ( IsUnitType(GetFilterUnit(), UNIT_TYPE_HERO) == true )
endfunction
function Trig_Kamehameha_Copy_Func005A takes nothing returns nothing
call CameraSetEQNoiseForPlayer( GetOwningPlayer(GetEnumUnit()), I2R(( GetUnitAbilityLevelSwapped(GetSpellAbilityId(), GetSpellAbilityUnit()) * 2 )) )
call CameraSetTargetNoiseForPlayer( GetOwningPlayer(GetEnumUnit()), I2R(( GetUnitAbilityLevelSwapped(GetSpellAbilityId(), GetSpellAbilityUnit()) * 3 )), 200.00 )
endfunction
function Trig_Kamehameha_Copy_Func019Func005002003001 takes nothing returns boolean
return ( IsPlayerAlly(GetOwningPlayer(GetFilterUnit()), GetOwningPlayer(GetTriggerUnit())) == false )
endfunction
function Trig_Kamehameha_Copy_Func019Func005002003002 takes nothing returns boolean
return ( IsUnitType(GetFilterUnit(), UNIT_TYPE_ANCIENT) == false )
endfunction
function Trig_Kamehameha_Copy_Func019Func005002003 takes nothing returns boolean
return GetBooleanAnd( Trig_Kamehameha_Copy_Func019Func005002003001(), Trig_Kamehameha_Copy_Func019Func005002003002() )
endfunction
function Trig_Kamehameha_Copy_Func019Func006A takes nothing returns nothing
call UnitDamageTargetBJ( GetLastCreatedUnit(), GetEnumUnit(), udg_LocReal, ATTACK_TYPE_MELEE, DAMAGE_TYPE_NORMAL )
call UnitAddTypeBJ( UNIT_TYPE_ANCIENT, GetEnumUnit() )
endfunction
function Trig_Kamehameha_Copy_Func019Func008Func001C takes nothing returns boolean
if ( not ( IsDestructableAliveBJ(GetEnumDestructable()) == true ) ) then
return false
endif
return true
endfunction
function Trig_Kamehameha_Copy_Func019Func008A takes nothing returns nothing
if ( Trig_Kamehameha_Copy_Func019Func008Func001C() ) then
call KillDestructable( GetEnumDestructable() )
else
endif
endfunction
function Trig_Kamehameha_Copy_Func020Func002002003001 takes nothing returns boolean
return ( IsPlayerAlly(GetOwningPlayer(GetFilterUnit()), GetOwningPlayer(GetTriggerUnit())) == false )
endfunction
function Trig_Kamehameha_Copy_Func020Func002002003002 takes nothing returns boolean
return ( IsUnitType(GetFilterUnit(), UNIT_TYPE_ANCIENT) == true )
endfunction
function Trig_Kamehameha_Copy_Func020Func002002003 takes nothing returns boolean
return GetBooleanAnd( Trig_Kamehameha_Copy_Func020Func002002003001(), Trig_Kamehameha_Copy_Func020Func002002003002() )
endfunction
function Trig_Kamehameha_Copy_Func020Func003A takes nothing returns nothing
call UnitRemoveTypeBJ( UNIT_TYPE_ANCIENT, GetEnumUnit() )
endfunction
function Trig_Kamehameha_Copy_Func027A takes nothing returns nothing
call CameraClearNoiseForPlayer( GetEnumPlayer() )
endfunction
function Trig_Kamehameha_Copy_Actions takes nothing returns nothing
set udg_LocPoint1 = GetUnitLoc(GetSpellAbilityUnit())
set udg_LocPoint2 = GetSpellTargetLoc()
set udg_LocPoint3 = PolarProjectionBJ(udg_LocPoint1, 150.00, AngleBetweenPoints(udg_LocPoint1, udg_LocPoint2))
set udg_TempUnitGroup = GetUnitsInRangeOfLocMatching(512, udg_LocPoint1, Condition(function Trig_Kamehameha_Copy_Func004002003))
call ForGroupBJ( udg_TempUnitGroup, function Trig_Kamehameha_Copy_Func005A )
call DestroyGroup( udg_TempUnitGroup )
call AddSpecialEffectLocBJ( udg_LocPoint3, "Objects\\Spawnmodels\\NightElf\\NEDeathSmall\\NEDeathSmall.mdl" )
call TriggerExecute( gg_trg_Destroy_Effect )
call AddSpecialEffectLocBJ( udg_LocPoint3, "Objects\\Spawnmodels\\Other\\NeutralBuildingExplosion\\NeutralBuildingExplosion.mdl" )
call TriggerExecute( gg_trg_Destroy_Effect )
call CreateNUnitsAtLoc( 1, 'h01Z', GetOwningPlayer(GetSpellAbilityUnit()), udg_LocPoint3, AngleBetweenPoints(udg_LocPoint1, udg_LocPoint2) )
call SetUnitScalePercent( GetLastCreatedUnit(), ( 250.00 + I2R(( GetUnitAbilityLevelSwapped(GetSpellAbilityId(), GetSpellAbilityUnit()) * 10 )) ), ( 250.00 + I2R(( GetUnitAbilityLevelSwapped(GetSpellAbilityId(), GetSpellAbilityUnit()) * 10 )) ), ( 250.00 + I2R(( GetUnitAbilityLevelSwapped(GetSpellAbilityId(), GetSpellAbilityUnit()) * 10 )) ) )
call CreateNUnitsAtLoc( 1, 'h01F', GetOwningPlayer(GetSpellAbilityUnit()), udg_LocPoint3, AngleBetweenPoints(udg_LocPoint1, udg_LocPoint2) )
call SetUnitScalePercent( GetLastCreatedUnit(), ( 350.00 + I2R(( GetUnitAbilityLevelSwapped(GetSpellAbilityId(), GetSpellAbilityUnit()) * 10 )) ), ( 350.00 + I2R(( GetUnitAbilityLevelSwapped(GetSpellAbilityId(), GetSpellAbilityUnit()) * 10 )) ), ( 350.00 + I2R(( GetUnitAbilityLevelSwapped(GetSpellAbilityId(), GetSpellAbilityUnit()) * 10 )) ) )
call SetUnitTimeScalePercent( GetLastCreatedUnit(), 15.00 )
call KillUnit( GetLastCreatedUnit() )
call RemoveLocation( udg_LocPoint3 )
set udg_LocReal = ( ( ( I2R(GetHeroStatBJ(bj_HEROSTAT_INT, GetTriggerUnit(), false)) * I2R(GetUnitAbilityLevelSwapped(GetSpellAbilityId(), GetTriggerUnit())) ) * 2.00 ) + 100.00 )
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = 5
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
set udg_LocPoint3 = PolarProjectionBJ(udg_LocPoint1, ( I2R(GetForLoopIndexA()) * 200.00 ), AngleBetweenPoints(udg_LocPoint1, udg_LocPoint2))
call SetTerrainTypeBJ( udg_LocPoint3, 'Kdtr', -1, 3, 0 )
call SetTerrainTypeBJ( udg_LocPoint3, 'Jdtr', -1, 2, 0 )
call CreateNUnitsAtLoc( 1, 'h01X', GetOwningPlayer(GetTriggerUnit()), udg_LocPoint3, bj_UNIT_FACING )
set udg_TempUnitGroup = GetUnitsInRangeOfLocMatching(300.00, udg_LocPoint3, Condition(function Trig_Kamehameha_Copy_Func019Func005002003))
call ForGroupBJ( udg_TempUnitGroup, function Trig_Kamehameha_Copy_Func019Func006A )
call DestroyGroup( udg_TempUnitGroup )
call EnumDestructablesInCircleBJ( 300.00, udg_LocPoint3, function Trig_Kamehameha_Copy_Func019Func008A )
call RemoveLocation( udg_LocPoint3 )
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = 5
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
set udg_LocPoint3 = PolarProjectionBJ(udg_LocPoint1, ( I2R(GetForLoopIndexA()) * 200.00 ), AngleBetweenPoints(udg_LocPoint1, udg_LocPoint2))
set udg_TempUnitGroup = GetUnitsInRangeOfLocMatching(300.00, udg_LocPoint3, Condition(function Trig_Kamehameha_Copy_Func020Func002002003))
call ForGroupBJ( udg_TempUnitGroup, function Trig_Kamehameha_Copy_Func020Func003A )
call DestroyGroup( udg_TempUnitGroup )
call RemoveLocation( udg_LocPoint3 )
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
set udg_LocPoint3 = PolarProjectionBJ(udg_LocPoint1, ( I2R(GetForLoopIndexA()) * 900.00 ), AngleBetweenPoints(udg_LocPoint1, udg_LocPoint2))
call TerrainDeformationWaveBJ( 3.00, udg_LocPoint1, udg_LocPoint3, 400.00, 128.00, 1.00 )
call RemoveLocation( udg_LocPoint1 )
call RemoveLocation( udg_LocPoint2 )
call RemoveLocation( udg_LocPoint3 )
call TriggerSleepAction( 2 )
call ForForce( GetPlayersAll(), function Trig_Kamehameha_Copy_Func027A )
endfunction
//===========================================================================
function InitTrig_Kamehameha_Copy takes nothing returns nothing
set gg_trg_Kamehameha_Copy = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Kamehameha_Copy, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Kamehameha_Copy, Condition( function Trig_Kamehameha_Copy_Conditions ) )
call TriggerAddAction( gg_trg_Kamehameha_Copy, function Trig_Kamehameha_Copy_Actions )
endfunction