function Trig_Destruction_Sphere_Conditions takes nothing returns boolean
return((GetSpellAbilityId()=='A016'))
endfunction
function Trig_Destruction_Sphere_Func004002003 takes nothing returns boolean
return(IsUnitType(GetFilterUnit(),UNIT_TYPE_HERO))
endfunction
function Trig_Destruction_Sphere_Func005A takes nothing returns nothing
endfunction
function Trig_Destruction_Sphere_Func024A takes nothing returns nothing
call CameraClearNoiseForPlayer(GetEnumPlayer())
endfunction
function Trig_Destruction_Sphere_Actions takes nothing returns nothing
set udg_Caster[10]=GetTriggerUnit()
set udg_location07=GetUnitLoc(GetTriggerUnit())
set udg_location08=GetSpellTargetLoc()
set udg_location09=PolarProjectionBJ(udg_location07,150.00,AngleBetweenPoints(udg_location07,udg_location08))
set udg_group05=GetUnitsInRangeOfLocMatching(512.00,udg_location07,Condition(function Trig_Destruction_Sphere_Func004002003))
call ForGroupBJ(udg_group05,function Trig_Destruction_Sphere_Func005A)
call DestroyGroup(udg_group05)
call CreateNUnitsAtLoc(1,'h02R',GetTriggerPlayer(),udg_location09,bj_UNIT_FACING)
call SetUnitVertexColorBJ(bj_lastCreatedUnit,50.00,75.00,50.00,0)
set udg_destruction_sphere_unit = GetLastCreatedUnit()
call CreateNUnitsAtLoc(1,'h02T',GetTriggerPlayer(),udg_location09,AngleBetweenPoints(udg_location07,udg_location08))
call SetUnitScalePercent(bj_lastCreatedUnit,(400.00+(I2R(GetUnitAbilityLevelSwapped(GetSpellAbilityId(),GetTriggerUnit()))*10.00)),(400.00+(I2R(GetUnitAbilityLevelSwapped(GetSpellAbilityId(),GetTriggerUnit()))*10.00)),(400.00+(I2R(GetUnitAbilityLevelSwapped(GetSpellAbilityId(),GetTriggerUnit()))*10.00)))
call SetUnitFlyHeight(bj_lastCreatedUnit,0.00,50.00)
call AddSpecialEffectTargetUnitBJ("chest",bj_lastCreatedUnit,"Abilities\\Weapons\\GreenDragonMissile\\GreenDragonMissile.mdl")
call TriggerExecute(udg_trigger621)
call AddSpecialEffectTargetUnitBJ("chest",bj_lastCreatedUnit,"Abilities\\Spells\\NightElf\\Starfall\\StarfallCaster.mdl")
call TriggerExecute(udg_trigger621)
call AddSpecialEffectTargetUnitBJ("chest",bj_lastCreatedUnit,"Abilities\\Spells\\Undead\\DarkSummoning\\DarkSummonMissile.mdl")
call TriggerExecute(udg_trigger621)
call IssuePointOrderLoc(bj_lastCreatedUnit,"attack",udg_location08)
call SetUnitUserData(bj_lastCreatedUnit,GetUnitAbilityLevelSwapped(GetSpellAbilityId(),GetTriggerUnit()))
call RemoveLocation(udg_location09)
call RemoveLocation(udg_location08)
call RemoveLocation(udg_location07)
call TriggerSleepAction(2.00)
call ForForce(bj_FORCE_ALL_PLAYERS,function Trig_Destruction_Sphere_Func024A)
endfunction
function Trig_Destruction_Sphere_Attack_Conditions takes nothing returns boolean
return((GetUnitTypeId(GetDyingUnit())=='h02T'))
endfunction
function Trig_Destruction_Sphere_Attack_Func002002003 takes nothing returns boolean
return(IsUnitType(GetFilterUnit(),UNIT_TYPE_HERO))
endfunction
function Trig_Destruction_Sphere_Attack_Func003A takes nothing returns nothing
endfunction
function Trig_Destruction_Sphere_Attack_Func019002003 takes nothing returns boolean
return(IsPlayerAlly(GetOwningPlayer(GetFilterUnit()),GetOwningPlayer(GetTriggerUnit()))==false)
endfunction
function Trig_Destruction_Sphere_Attack_Func020A takes nothing returns nothing
call UnitDamageTargetBJ(udg_Caster[10],GetEnumUnit(),udg_real02,ATTACK_TYPE_MELEE,DAMAGE_TYPE_NORMAL)
endfunction
function Trig_Destruction_Sphere_Attack_Func022Func001C takes nothing returns boolean
return((IsDestructableAliveBJ(GetEnumDestructable())))
endfunction
function Trig_Destruction_Sphere_Attack_Func022A takes nothing returns nothing
if((IsDestructableAliveBJ(GetEnumDestructable())))then
call KillDestructable(GetEnumDestructable())
call TriggerExecute(udg_trigger623)
endif
endfunction
function Trig_Destruction_Sphere_Attack_Func026A takes nothing returns nothing
call CameraClearNoiseForPlayer(GetEnumPlayer())
endfunction
function Trig_Destruction_Sphere_Attack_Actions takes nothing returns nothing
set udg_location08=GetUnitLoc(GetTriggerUnit())
set udg_group05=GetUnitsInRangeOfLocMatching(512.00,udg_location08,Condition(function Trig_Destruction_Sphere_Attack_Func002002003))
call ForGroupBJ(udg_group05,function Trig_Destruction_Sphere_Attack_Func003A)
call DestroyGroup(udg_group05)
call SetTerrainTypeBJ(udg_location08,'Kdtr',-1,5,0)
call SetTerrainTypeBJ(udg_location08,'Jdtr',-1,4,0)
call CreateNUnitsAtLoc(1,'h02S',GetTriggerPlayer(),udg_location08,bj_UNIT_FACING)
call SetUnitScalePercent(bj_lastCreatedUnit,(350.00+(I2R(GetUnitUserData(GetTriggerUnit()))*10.00)),(350.00+(I2R(GetUnitUserData(GetTriggerUnit()))*10.00)),(350.00+(I2R(GetUnitUserData(GetTriggerUnit()))*10.00)))
call SetUnitVertexColorBJ(bj_lastCreatedUnit,50.00,100.00,50.00,0)
call CreateNUnitsAtLoc(1,'h017',GetTriggerPlayer(),udg_location08,bj_UNIT_FACING)
call SetUnitScalePercent(bj_lastCreatedUnit,(350.00+(I2R(GetUnitUserData(GetTriggerUnit()))*10.00)),(350.00+(I2R(GetUnitUserData(GetTriggerUnit()))*10.00)),(350.00+(I2R(GetUnitUserData(GetTriggerUnit()))*10.00)))
call SetUnitVertexColorBJ(bj_lastCreatedUnit,50.00,100.00,50.00,0)
call SetUnitTimeScalePercent(bj_lastCreatedUnit,15.00)
call KillUnit(bj_lastCreatedUnit)
set udg_real02=((I2R(GetHeroStatBJ(2,udg_unit67,false))*(I2R(GetUnitUserData(GetTriggerUnit()))*4.00))+100.00)
call CreateNUnitsAtLoc(1,'h028',GetTriggerPlayer(),udg_location08,bj_UNIT_FACING)
set udg_group05=GetUnitsInRangeOfLocMatching(512.00,udg_location08,Condition(function Trig_Destruction_Sphere_Attack_Func019002003))
call ForGroupBJ(udg_group05,function Trig_Destruction_Sphere_Attack_Func020A)
call DestroyGroup(udg_group05)
call EnumDestructablesInCircleBJ(512.00,udg_location08,function Trig_Destruction_Sphere_Attack_Func022A)
call RemoveLocation(udg_location08)
call TriggerSleepAction(2.00)
call ForForce(bj_FORCE_ALL_PLAYERS,function Trig_Destruction_Sphere_Attack_Func026A)
endfunction
function Trig_Destruction_Sphere_Manual_Detonate_Conditions takes nothing returns boolean
if (not(GetSpellAbilityId()== 'A800')) then
return false
endif
return true
endfunction
function Trig_Destruction_Sphere_Manual_Detonate_Actions takes nothing returns nothing
call KillUnit(udg_destruction_sphere_unit)
endfunction
function InitTrig_Destruction_Sphere_Manual_Detonate takes nothing returns nothing
set gg_trg_Destruction_Sphere_Manual_Detonate = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(gg_trg_Destruction_Sphere_Manual_Detonate, EVENT_PLAYER_UNIT_SPELL_CAST)
call TriggerAddCondition(gg_trg_Destruction_Sphere_Manual_Detonate, Condition(function Trig_Destruction_Sphere_Manual_Detonate_Conditions))
call TriggerAddAction(gg_trg_Destruction_Sphere_Manual_Detonate, function Trig_Destruction_Sphere_Manual_Detonate_Actions)
endfunction