- Joined
- May 26, 2009
- Messages
- 1,821
That's a lot of custom script. anyway casually scrolled through (didn't really read) but I thought I'd point out that GetUnitX/Y is faster than GetWidgetX/Y
| SPELL DESCRIPTION: |
Dark Bow Configuration

Events


Map initialization

Conditions

Actions


-------- --------


-------- * SPELL CONFIGURATION FIELD * --------


-------- --------


-------- OBJECT EDITOR ( F6 ) --------


-------- The spell or ability used in the triggers. ( Import the Dark Bow Ability ) --------


Set DB_Ability = Dark Bow


-------- The dummy unit type used in the trigger. ( Import the Dark Bow Dummy ) --------


Set DB_DummyType = Dark Bow Dummy


-------- The spell or ability that the dummy unit will use to fear enemy units. ( Import the Fear Dummy Ability and Fear System ( Maestros ) Folder ) --------


Set DB_FearAbility = Fear ( Dummy Ability )


-------- --------


-------- SPELL DATA --------


-------- - --------


-------- The maximum level of the spell or ability. ( Number of Levels from Dark Bow Ability ) --------


Set DB_AbilityMaxLevel = 3


-------- - --------


-------- An effect occurs at the attachment point when the caster executes the spell or ability. --------


Set DB_Effect[1] = Abilities\Weapons\ZigguratMissile\ZigguratMissile.mdl


Set DB_EffectAttach[1] = weapon


-------- - --------


-------- The maximum radius of the spell or ability to the targeted location or area. --------


Set DB_Radius[1] = 300.00


Set DB_Radius[2] = 325.00


Set DB_Radius[3] = 350.00


-------- - --------


-------- Destroy Trees? True = Yes, False = No --------


Set DB_DestroyTrees = False


-------- - --------


-------- The attack type and damage type of the spell or ability. --------


Set DB_AttackType = Spells


Set DB_DamageType = Normal


-------- - --------


-------- The artificial ground height where units' height will be detected. ( Default: 10 ) --------


Set DB_FloorHeight = 10.00


-------- - --------


-------- The applied artificial gravity in the map where falling or landing of units involved. ( Default: -9.81 ( Earth's Gravity ) ) --------


Set DB_Gravity = -9.81


-------- ^ Modify at your own risk: gravity changes affects the falling, landing motion of units. ( High Gravity = -100+, Normal Gravity = -40- ) --------


-------- - --------


-------- The interval of the looping trigger. ( Default: 1 second / 32 iterations, frames = 0.03125000 ) --------


Set DB_LoopInterval = (1.00 / 50.00)


-------- ^ I've modified it to ( 1 second / 50 iterations, frames = 0.02 ) for smooth visuals. --------


-------- ^ Modify at your own risk: Changing the value affects the spell's performance. --------


-------- - --------


-------- --------


-------- HEAD DATA --------


-------- - --------


-------- The art model used to attach in the main projectile. --------


Set DB_Effect[2] = Abilities\Weapons\ZigguratMissile\ZigguratMissile.mdl


Set DB_EffectAttach[2] = origin


-------- And it's pitch facing upward ( It will rise to the air ). The modified value is recommended. ( Default: +40 ) --------


Set DB_PitchVariation[1] = 0.00


-------- ^ If the art model have already pitch animation and you don't want to set it's pitch then set this value to 0. --------


-------- - --------


-------- The size of the main projectile. --------


Set DB_HeadSize[1] = 1.25


Set DB_HeadSize[2] = 1.25


Set DB_HeadSize[3] = 1.25


-------- - --------


-------- The initial height of the main projectile. --------


Set DB_HeadHeight[1] = 75.00


Set DB_HeadHeight[2] = 75.00


Set DB_HeadHeight[3] = 75.00


-------- - --------


-------- The maximum height of the main projectile to split. ( Mid-Air ) --------


Set DB_HeadMaxHeight[1] = 375.00


Set DB_HeadMaxHeight[2] = 425.00


Set DB_HeadMaxHeight[3] = 475.00


-------- - --------


-------- The speed of the main projectile. ( Distance Per Second ) --------


Set DB_HeadSpeed[1] = 1200.00


Set DB_HeadSpeed[2] = 1200.00


Set DB_HeadSpeed[3] = 1200.00


-------- - --------


-------- The creation or spawn range of the main projectile away from the caster. --------


Set DB_SpawnOffset = 25.00


-------- - --------


-------- The distance divider from the caster's position to the targeted location. This is the seperated distance where the head will split. ( Default: 1.75 ) --------


Set DB_DistanceSeperation = 1.75


-------- ^ Modify at your own risk: Lowering the value can cause some errors. There's no need to change this value by the way. --------


-------- - --------


-------- --------


-------- SHARDS DATA --------


-------- - --------


-------- The art model used to attach in the shards. --------


Set DB_Effect[3] = Abilities\Weapons\AvengerMissile\AvengerMissile.mdl


Set DB_EffectAttach[3] = origin


-------- And it's pitch facing downward ( It will land to the ground ). The modified value is recommended. ( Default: -20 ) --------


Set DB_PitchVariation[2] = 0.00


-------- ^ If the art model have already pitch animation and you don't want to set it's pitch then set this value to 0. --------


-------- - --------


-------- An effect occurs at the attachment point of the main projectile when the shards splitted and it's pitch facing. ( for better pitching the effect ) --------


Set DB_Effect[4] = Abilities\Spells\Other\HowlOfTerror\HowlCaster.mdl


Set DB_EffectAttach[4] = origin


Set DB_PitchVariation[3] = -90.00


-------- ^ PitchVariation values range from +90 to -90 only. ( Negative Values = faces downward, Positive values = faces upward ) ( Default: -90 ) --------


-------- ^ If you want to disable the pitch facing then set this value to 0. --------


-------- - --------


-------- The size of the shards. --------


Set DB_ShardSize[1] = 1.00


Set DB_ShardSize[2] = 1.00


Set DB_ShardSize[3] = 1.00


-------- - --------


-------- The amount of shards splitted. Value != 0 --------


Set DB_ShardAmount[1] = 8


Set DB_ShardAmount[2] = 12


Set DB_ShardAmount[3] = 16


-------- - --------


-------- The landing time of the shards. --------


Set DB_ShardFallTime[1] = 0.50


Set DB_ShardFallTime[2] = 0.45


Set DB_ShardFallTime[3] = 0.40


-------- - --------


-------- The collision radius of the shards. --------


Set DB_ShardCollision[1] = 50.00


Set DB_ShardCollision[2] = 65.00


Set DB_ShardCollision[3] = 80.00


-------- - --------


-------- The damage of each shards in collision radius. --------


Set DB_ShardDamage[1] = 100.00


Set DB_ShardDamage[2] = 200.00


Set DB_ShardDamage[3] = 300.00


-------- - --------


-------- An effect occurs when the shards landed. --------


Set DB_Effect[5] = Abilities\Spells\Undead\OrbOfDeath\AnnihilationMissile.mdl


-------- - --------


-------- Shards scatter into pieces when landed? True = Yes, False = No --------


Set DB_ShardScatter = True


-------- ^ IF: TRUE = Import the KB3D System ( Jad ). --------


-------- ^ IF: FALSE = Please skip the MINI DATA configuration section and leave or ignore KB3D System ( Jad ). --------


-------- - --------


-------- --------


-------- MINI DATA --------


-------- - --------


-------- The art model used to attach in the mini projectiles. --------


Set DB_Effect[6] = Abilities\Weapons\AvengerMissile\AvengerMissile.mdl


Set DB_EffectAttach[5] = origin


-------- - --------


-------- The size of the mini projectiles. --------


Set DB_MiniSize[1] = 0.40


Set DB_MiniSize[2] = 0.40


Set DB_MiniSize[3] = 0.40


-------- - --------


-------- The amount of the created mini projectiles. Value != 0 --------


Set DB_MiniAmount[1] = 3


Set DB_MiniAmount[2] = 3


Set DB_MiniAmount[3] = 3


-------- - --------


-------- The range of the mini created projectiles. --------


Set DB_MiniRange[1] = 175.00


Set DB_MiniRange[2] = 375.00


Set DB_MiniRange[3] = 500.00


-------- - --------


-------- The maximum height of the mini projectiles can reach. --------


Set DB_MiniMaxHeight[1] = 150.00


Set DB_MiniMaxHeight[2] = 75.00


Set DB_MiniMaxHeight[3] = 150.00


-------- - --------


-------- The speed of the mini projectiles. ( Distance Per Second ) --------


Set DB_MiniSpeed[1] = 250.00


Set DB_MiniSpeed[2] = 250.00


Set DB_MiniSpeed[3] = 275.00


-------- - --------


-------- The collision radius of the mini projectiles. --------


Set DB_MiniCollision[1] = 35.00


Set DB_MiniCollision[2] = 35.00


Set DB_MiniCollision[3] = 35.00


-------- - --------


-------- The damage of the mini projectiles in collision radius. --------


Set DB_MiniDamage[1] = 50.00


Set DB_MiniDamage[2] = 75.00


Set DB_MiniDamage[3] = 100.00


-------- - --------


-------- Allow the mini projectiles arc trajectory? True = Yes, False = No --------


Set DB_MiniEnableArc = True


-------- - --------


-------- An effect occurs to the enemy units when damaged by mini projectiles. --------


Set DB_Effect[7] = Abilities\Spells\Human\Feedback\ArcaneTowerAttack.mdl


-------- - --------


-------- --------


-------- FEAR DATA --------


-------- FEAR CONFIGURATIONS/SETTINGS ARE INSIDE THE FEAR SYSTEM FOLDER " MF Settings " TRIGGER. --------


Set DB_Fear = True


-------- ^ Fear the units damaged by the dark souls? True = Yes, False = No --------


-------- ^ IF: TRUE = Import the Fear System ( Maestros ), Fear Dummy Ability. --------


-------- ^ IF: FALSE = Leave or ignore the Fear System ( Maestros ) and don't import the Fear Dummy Ability. --------


-------- - --------


-------- ......................................................................................................................... --------


-------- CODE DATA --------


-------- ( DON'T TOUCH THESE LINES BELOW UNLESS SOME OF THEM MALFUNCTION ) --------


-------- ......................................................................................................................... --------


-------- Loop Event --------


Trigger - Add to Dark Bow Loop <gen> the event (Time - Every DB_LoopInterval seconds of game time)


-------- .............................................................................................................. --------


-------- Tree Checker Setup --------


If (All Conditions are True) then do (Then Actions) else do (Else Actions)



If - Conditions




DB_DestroyTrees Equal to True



Then - Actions




Custom script: set udg_DB_TreeChecker = CreateUnit( Player( 15 ), udg_DB_DummyType, 0, 0, 0 )




Custom script: call UnitAddAbility( udg_DB_TreeChecker, 'Ahar' ) // Harvest Ability



Else - Actions


-------- .............................................................................................................. --------


-------- Initialize Calculations --------


For each (Integer DB_CustomInteger) from 1 to DB_AbilityMaxLevel, do (Actions)



Loop - Actions




Set DB_CustomReal[DB_CustomInteger] = (DB_HeadSpeed[DB_CustomInteger] x DB_LoopInterval)




Set DB_CustomReal2[DB_CustomInteger] = (DB_ShardFallTime[DB_CustomInteger] / DB_LoopInterval)




Set DB_CustomReal3[DB_CustomInteger] = (360.00 / (Real(DB_MiniAmount[DB_CustomInteger])))




If (All Conditions are True) then do (Then Actions) else do (Else Actions)





If - Conditions






DB_MiniEnableArc Equal to True





Then - Actions






Set DB_CustomReal4[DB_CustomInteger] = (DB_MiniSpeed[DB_CustomInteger] / 1.25)





Else - Actions


-------- .............................................................................................................. --------


-------- * Preload Objects * --------


-------- Abilities and Units: --------


Custom script: set udg_DB_DummyUnit = CreateUnit( Player( 15 ), udg_DB_DummyType, 0, 0, 0 )


Custom script: call UnitAddAbility( udg_DB_DummyUnit, udg_DB_Ability )


If (All Conditions are True) then do (Then Actions) else do (Else Actions)



If - Conditions




DB_Fear Equal to True



Then - Actions




Custom script: call UnitAddAbility( udg_DB_DummyUnit, udg_DB_FearAbility )



Else - Actions


Custom script: call RemoveUnit( udg_DB_DummyUnit )


-------- Effects: --------


Set DB_EffectCount = 7


For each (Integer DB_CustomInteger) from 1 to DB_EffectCount, do (Actions)



Loop - Actions




Custom script: call Preload( udg_DB_Effect[ udg_DB_CustomInteger ] )


-------- .............................................................................................................. --------


-------- declaration of initial variables --------


Set DB_LocationZ = (Point(0.00, 0.00))


Custom script: set udg_DB_Map[ 1 ] = GetRectMinX( bj_mapInitialPlayableArea )


Custom script: set udg_DB_Map[ 2 ] = GetRectMaxX( bj_mapInitialPlayableArea )


Custom script: set udg_DB_Map[ 3 ] = GetRectMinY( bj_mapInitialPlayableArea )


Custom script: set udg_DB_Map[ 4 ] = GetRectMaxY( bj_mapInitialPlayableArea )


-------- .............................................................................................................. --------


-------- --------


-------- * END OF SPELL CONFIGURATION FIELD * --------


-------- --------


Custom script: endfunction


Custom script:


Custom script: // Essential Functions:


Custom script:


Custom script: function DB_GetZ takes real x, real y returns real // Determines the location z height


Custom script: call MoveLocation( udg_DB_LocationZ, x, y )


Custom script: return GetLocationZ( udg_DB_LocationZ )


Custom script: endfunction


Custom script:


Custom script: function DB_InPlayableArea takes real x, real y returns boolean // Detects X/Y coordinates inside the playable area


Custom script: return x < udg_DB_Map[ 2 ] and x > udg_DB_Map[ 1 ] and y < udg_DB_Map[ 4 ] and y > udg_DB_Map[ 3 ]


Custom script: endfunction


Custom script:


Custom script: function DB_Move takes unit u, real motionX, real motionY, boolean b returns nothing // Moving a unit in the specific valid X/Y coordinates


Custom script: if DB_InPlayableArea( motionX, motionY ) then


Custom script: call SetUnitX( u, motionX )


Custom script: call SetUnitY( u, motionY )


Custom script: elseif b == false then


Custom script: call SetUnitX( u, motionX )


Custom script: call SetUnitY( u, motionY )


Custom script: endif


Custom script: endfunction


Custom script:


Custom script: function DB_Parabola takes real mH, real mD, real cD returns real // Curving the projectile's trajectory


Custom script: return ( 4. * ( mH / mD ) * ( mD - cD ) * ( cD / mD ) )


Custom script: endfunction


Custom script:


Custom script: function DB_SetPitch takes unit u, real pitch returns nothing // Setting the unit's pitch


Custom script: local integer i = R2I( pitch * bj_RADTODEG + 90.5 )


Custom script: if 179 < i then


Custom script: set i = 179


Custom script: elseif 0 > i then


Custom script: set i = 0


Custom script: endif


Custom script: call SetUnitAnimationByIndex( u, i )
Dark Bow Execution

Events


Unit - A unit Starts the effect of an ability

Conditions


(Ability being cast) Equal to DB_Ability

Actions


-------- --------


-------- OnCast --------


-------- --------


-------- declaration of locals: --------


Custom script: local unit u = GetTriggerUnit( )


Custom script: local real x = GetUnitX( u )


Custom script: local real y = GetUnitY( u )


Custom script: local real z = DB_GetZ( x , y )


Custom script: local real spellX = GetSpellTargetX( )


Custom script: local real spellY = GetSpellTargetY( )


Custom script: local real spellZ = DB_GetZ( spellX , spellY )


Custom script: local real x2 = spellX - x


Custom script: local real y2 = spellY - y


Custom script: local real z2 = spellZ - z


Custom script: local real x3


Custom script: local real y3


-------- --------


-------- Head Creation --------


-------- --------


Custom script: call DestroyEffect( AddSpecialEffectTarget( udg_DB_Effect[ 1 ], u, udg_DB_EffectAttach[ 1 ] ) )


Custom script: set udg_DB_Unit = CreateUnit( GetTriggerPlayer( ) , udg_DB_DummyType, x , y, Atan2( y2 , x2 ) * bj_RADTODEG )


Custom script: set udg_DB_ID = GetUnitUserData( udg_DB_Unit )


-------- --------


-------- Properties and Allocations --------


-------- --------


Set DB_Caster[DB_ID] = (Triggering unit)


Set DB_CasterPlayer[DB_ID] = (Owner of DB_Caster[DB_ID])


Set DB_Level[DB_ID] = (Level of DB_Ability for DB_Caster[DB_ID])


Custom script: set x3 = x + udg_DB_SpawnOffset * Cos( Atan2( y2 , x2 ) )


Custom script: set y3 = y + udg_DB_SpawnOffset * Sin( Atan2( y2 , x2 ) )


Custom script: call DB_Move( udg_DB_Unit , x3 , y3 , true )


Custom script: call SetUnitScale( udg_DB_Unit, udg_DB_HeadSize[ udg_DB_Level[ udg_DB_ID ] ], 0, 0 )


Custom script: call SetUnitFlyHeight( udg_DB_Unit, udg_DB_HeadHeight[ udg_DB_Level[ udg_DB_ID ] ], 0 )


Custom script: set udg_DB_HeadModelHandler[ udg_DB_ID ] = AddSpecialEffectTarget( udg_DB_Effect[ 2 ], udg_DB_Unit, udg_DB_EffectAttach[ 2 ] )


Custom script: call DB_SetPitch( udg_DB_Unit , udg_DB_PitchVariation[ 1 ] * bj_DEGTORAD )


-------- --------


Custom script: set udg_DB_MaxDistance[ udg_DB_ID ] = SquareRoot( x2 * x2 + y2 * y2 ) + 1 // Prevents 0 calculation on distance.


Set DB_DivergeDistance[DB_ID] = (DB_MaxDistance[DB_ID] / DB_DistanceSeperation)


Set DB_CurrentDistance[DB_ID] = 0.00


Custom script: set udg_DB_SpellX[ udg_DB_ID ] = spellX


Custom script: set udg_DB_SpellY[ udg_DB_ID ] = spellY


Custom script: set udg_DB_CurrentHeight[ udg_DB_ID ] = GetUnitFlyHeight( udg_DB_Unit )


Custom script: set udg_DB_HeadAngle[ udg_DB_ID ] = Atan2( y2 , x2 )


-------- --------


Set DB_Phase[DB_ID] = 1


Unit Group - Add DB_Unit to DB_Group


Set DB_Instance = (DB_Instance + 1)


-------- --------


If (All Conditions are True) then do (Then Actions) else do (Else Actions)



If - Conditions




DB_Instance Equal to 1



Then - Actions




Trigger - Turn on Dark Bow Loop <gen>



Else - Actions


-------- --------


Custom script: set u = null


-------- --------
Dark Bow Loop

Events

Conditions

Actions


-------- --------


-------- OnLoop --------


-------- --------


Unit Group - Pick every unit in DB_Group and do (Actions)



Loop - Actions




-------- --------




-------- declaration of locals: --------




Custom script: local real x




Custom script: local real y




Custom script: local real z




Custom script: local real headMotionX




Custom script: local real headMotionY




Custom script: local real shardsMotionX




Custom script: local real shardsMotionY




Custom script: local real shardsLandX




Custom script: local real shardsLandY




Custom script: local real x2




Custom script: local real y2




Custom script: local real g




Custom script: local real angle




-------- --------




Set DB_Unit = (Picked unit)




Custom script: set udg_DB_ID = GetUnitUserData( udg_DB_Unit )




-------- --------




-------- Main Unit Coordinates --------




Custom script: set x = GetUnitX( udg_DB_Unit )




Custom script: set y = GetUnitY( udg_DB_Unit )




Custom script: set z = DB_GetZ( x , y )




-------- --------




If (All Conditions are True) then do (Then Actions) else do (Else Actions)





If - Conditions






DB_Phase[DB_ID] Equal to 1





Then - Actions






-------- --------






-------- Head Motion --------






-------- --------






Set DB_CurrentHeight[DB_ID] = (Current flying height of DB_Unit)






Custom script: set g = ( udg_DB_Gravity * udg_DB_CurrentHeight[ udg_DB_ID ] ) * Pow( udg_DB_LoopInterval, 2 )






Custom script: set udg_DB_CurrentDistance[ udg_DB_ID ] = ( udg_DB_CurrentDistance[ udg_DB_ID ] + udg_DB_CustomReal[ udg_DB_Level[ udg_DB_ID ] ] + g )






-------- --------






Custom script: if udg_DB_CurrentHeight[ udg_DB_ID ] >= z + udg_DB_FloorHeight then






Custom script: call SetUnitFlyHeight( udg_DB_Unit, DB_Parabola( udg_DB_HeadMaxHeight[ udg_DB_Level[ udg_DB_ID ] ], udg_DB_MaxDistance[ udg_DB_ID ], udg_DB_CurrentDistance[ udg_DB_ID ] ) + g , 0 )






Custom script: else






Custom script: set udg_DB_CurrentDistance[ udg_DB_ID ] = udg_DB_MaxDistance[ udg_DB_ID ]






Custom script: endif






-------- --------






Custom script: set headMotionX = x + ( udg_DB_CustomReal[ udg_DB_Level[ udg_DB_ID ] ] + g ) * Cos( udg_DB_HeadAngle[ udg_DB_ID ] )






Custom script: set headMotionY = y + ( udg_DB_CustomReal[ udg_DB_Level[ udg_DB_ID ] ] + g ) * Sin( udg_DB_HeadAngle[ udg_DB_ID ] )






Custom script: call DB_Move( udg_DB_Unit , headMotionX , headMotionY , true )






Custom script: call SetUnitFacing( udg_DB_Unit, udg_DB_HeadAngle[ udg_DB_ID ] * bj_RADTODEG )






-------- --------






If (All Conditions are True) then do (Then Actions) else do (Else Actions)







If - Conditions








DB_CurrentDistance[DB_ID] Greater than or equal to DB_DivergeDistance[DB_ID]







Then - Actions








-------- --------








-------- Shards Creation --------








-------- --------








-------- Setting pitched effects --------








Custom script: call DestroyEffect( AddSpecialEffectTarget( udg_DB_Effect[ 4 ], udg_DB_Unit, udg_DB_EffectAttach[ 4 ] ) )








Custom script: call DB_SetPitch( udg_DB_Unit , udg_DB_PitchVariation[ 2 ] * bj_DEGTORAD )








For each (Integer DB_CustomInteger) from 1 to DB_ShardAmount[DB_Level[DB_ID]], do (Actions)









Loop - Actions










-------- --------










Custom script: set udg_DB_CustomUnit = CreateUnit( udg_DB_CasterPlayer[ udg_DB_ID ], udg_DB_DummyType, x , y , udg_DB_HeadAngle[ udg_DB_ID ] * bj_RADTODEG )










Custom script: set udg_DB_CustomID = GetUnitUserData( udg_DB_CustomUnit )










Custom script: call SetUnitScale( udg_DB_CustomUnit, udg_DB_ShardSize[ udg_DB_Level[ udg_DB_ID ] ], 0, 0 )










Custom script: call SetUnitFlyHeight( udg_DB_CustomUnit, udg_DB_CurrentHeight[ udg_DB_ID ], 0 )










Custom script: set udg_DB_ShardModelHandler[ udg_DB_CustomID ] = AddSpecialEffectTarget( udg_DB_Effect[ 3 ], udg_DB_CustomUnit, udg_DB_EffectAttach[ 3 ] )










Custom script: call DB_SetPitch( udg_DB_Unit , udg_DB_PitchVariation[ 3 ] * bj_DEGTORAD )










-------- --------










-------- passing parameters --------










Set DB_Caster[DB_CustomID] = DB_Caster[DB_ID]










Set DB_CasterPlayer[DB_CustomID] = DB_CasterPlayer[DB_ID]










Set DB_Level[DB_CustomID] = DB_Level[DB_ID]










Set DB_SpellX[DB_CustomID] = DB_SpellX[DB_ID]










Set DB_SpellY[DB_CustomID] = DB_SpellY[DB_ID]










-------- --------










Custom script: set shardsLandX = udg_DB_SpellX[ udg_DB_ID ] + GetRandomReal( 0, udg_DB_Radius[ udg_DB_Level[ udg_DB_ID ] ] ) * Cos( GetRandomReal( -bj_PI, bj_PI ) )










Custom script: set shardsLandY = udg_DB_SpellY[ udg_DB_ID ] + GetRandomReal( 0, udg_DB_Radius[ udg_DB_Level[ udg_DB_ID ] ] ) * Sin( GetRandomReal( -bj_PI, bj_PI ) )










Custom script: set x2 = shardsLandX - x










Custom script: set y2 = shardsLandY - y










Custom script: set udg_DB_ShardLandDistance[ udg_DB_CustomID ] = SquareRoot( x2 * x2 + y2 * y2 )










Set DB_ShardCurrentDistance[DB_CustomID] = 0.00










Set DB_ShardCurrentHeight[DB_CustomID] = (Current flying height of DB_CustomUnit)










Set DB_ShardFallTimeCalculation[DB_CustomID] = (DB_ShardCurrentHeight[DB_CustomID] / DB_CustomReal2[DB_Level[DB_ID]])










Set DB_ShardLandTimeCalculation[DB_CustomID] = (DB_ShardLandDistance[DB_CustomID] / DB_CustomReal2[DB_Level[DB_ID]])










Custom script: set udg_DB_ShardLandAngle[ udg_DB_CustomID ] = Atan2( y2 , x2 )










-------- --------










Set DB_Phase[DB_CustomID] = 2










Unit Group - Add DB_CustomUnit to DB_Group










Set DB_Instance = (DB_Instance + 1)










-------- --------








-------- Head Destroy --------








Special Effect - Destroy DB_HeadModelHandler[DB_ID]








Unit - Kill DB_Unit








Unit Group - Remove DB_Unit from DB_Group








Set DB_Instance = (DB_Instance - 1)








-------- --------








If (All Conditions are True) then do (Then Actions) else do (Else Actions)









If - Conditions










DB_Instance Equal to 0









Then - Actions










Trigger - Turn off (This trigger)









Else - Actions








-------- --------







Else - Actions





Else - Actions




-------- --------




If (All Conditions are True) then do (Then Actions) else do (Else Actions)





If - Conditions






DB_Phase[DB_ID] Equal to 2





Then - Actions






-------- --------






-------- Shards Motion --------






-------- --------






Custom script: set g = ( udg_DB_Gravity * udg_DB_ShardCurrentHeight[ udg_DB_ID ] ) * Pow( udg_DB_LoopInterval, 2 )






Custom script: set shardsMotionX = x + ( udg_DB_ShardLandTimeCalculation[ udg_DB_ID ] + g ) * Cos( udg_DB_ShardLandAngle[ udg_DB_ID ] )






Custom script: set shardsMotionY = y + ( udg_DB_ShardLandTimeCalculation[ udg_DB_ID ] + g ) * Sin( udg_DB_ShardLandAngle[ udg_DB_ID ] )






Custom script: call DB_Move( udg_DB_Unit , shardsMotionX , shardsMotionY , true )






Custom script: call SetUnitFacing( udg_DB_Unit , udg_DB_ShardLandAngle[ udg_DB_ID ] * bj_RADTODEG )






-------- --------






Custom script: set udg_DB_ShardCurrentDistance[ udg_DB_ID ] = ( udg_DB_ShardCurrentDistance[ udg_DB_ID ] + ( udg_DB_ShardLandTimeCalculation[ udg_DB_ID ] + g ) )






Custom script: set udg_DB_ShardCurrentHeight[ udg_DB_ID ] = ( udg_DB_ShardCurrentHeight[ udg_DB_ID ] - ( udg_DB_ShardFallTimeCalculation[ udg_DB_ID ] + g ) )






Custom script: call SetUnitFlyHeight( udg_DB_Unit , udg_DB_ShardCurrentHeight[ udg_DB_ID ] , 0 )






-------- --------






If (All Conditions are True) then do (Then Actions) else do (Else Actions)







If - Conditions








DB_ShardCurrentDistance[DB_ID] Greater than or equal to DB_ShardLandDistance[DB_ID]







Then - Actions








-------- --------








-------- * FEAR SYSTEM * --------








Custom script: call GroupEnumUnitsInRange( bj_lastCreatedGroup, x , y , udg_DB_ShardCollision[ udg_DB_Level[ udg_DB_ID ] ], null )








Custom script: loop








Custom script: set udg_DB_PickedUnit = FirstOfGroup( bj_lastCreatedGroup )








Custom script: exitwhen udg_DB_PickedUnit == null








If (All Conditions are True) then do (Then Actions) else do (Else Actions)









If - Conditions










(DB_PickedUnit is dead) Equal to False










(DB_PickedUnit is A structure) Equal to False










(DB_PickedUnit is Magic Immune) Equal to False










(DB_PickedUnit is A flying unit) Equal to False










(DB_PickedUnit is Mechanical) Equal to False










(DB_PickedUnit belongs to an enemy of DB_CasterPlayer[DB_ID]) Equal to True









Then - Actions










-------- --------










Unit - Cause DB_Caster[DB_ID] to damage DB_PickedUnit, dealing DB_ShardDamage[DB_Level[DB_ID]] damage of attack type DB_AttackType and damage type DB_DamageType










-------- --------










If (All Conditions are True) then do (Then Actions) else do (Else Actions)











If - Conditions












DB_Fear Equal to True











Then - Actions












-------- --------












-------- Dummy Caster --------












Custom script: set udg_DB_DummyUnit = CreateUnit( udg_DB_CasterPlayer[ udg_DB_ID ] , udg_DB_DummyType , x , y , 0 )












Custom script: call UnitAddAbility( udg_DB_DummyUnit, udg_DB_FearAbility )












Unit - Add a 1.00 second Generic expiration timer to DB_DummyUnit












Unit - Order DB_DummyUnit to Undead Banshee - Curse DB_PickedUnit












-------- --------











Else - Actions










-------- --------









Else - Actions








Custom script: call GroupRemoveUnit( bj_lastCreatedGroup, udg_DB_PickedUnit )








Custom script: endloop








-------- --------








Custom script: call DestroyEffect( AddSpecialEffect( udg_DB_Effect[ 5 ], x, y ) )








If (All Conditions are True) then do (Then Actions) else do (Else Actions)









If - Conditions










DB_DestroyTrees Equal to True









Then - Actions










-------- --------










Custom script: call MoveLocation( udg_DB_CustomLocation , x , y )










Destructible - Pick every destructible within DB_ShardCollision[DB_Level[DB_ID]] of DB_CustomLocation and do (Actions)











Loop - Actions












Set DB_Tree = (Picked destructible)












Unit - Order DB_TreeChecker to Harvest DB_Tree












If (All Conditions are True) then do (Then Actions) else do (Else Actions)













If - Conditions














(Current order of DB_TreeChecker) Equal to (Order(harvest))













Then - Actions














Destructible - Kill DB_Tree













Else - Actions












Unit - Order DB_TreeChecker to Stop










-------- --------









Else - Actions








-------- --------








-------- Mini Creation --------








-------- USES * KB3D SYSTEM * --------








-------- --------








If (All Conditions are True) then do (Then Actions) else do (Else Actions)









If - Conditions










DB_ShardScatter Equal to True









Then - Actions










For each (Integer DB_CustomInteger) from 1 to DB_MiniAmount[DB_Level[DB_ID]], do (Actions)











Loop - Actions












-------- --------












Set DB_MiniAngle = (DB_MiniAngle + DB_CustomReal3[DB_Level[DB_ID]])












Custom script: set udg_DB_CustomUnit = CreateUnit( udg_DB_CasterPlayer[ udg_DB_ID ], udg_DB_DummyType, x , y, udg_DB_MiniAngle * bj_RADTODEG )












Custom script: call SetUnitScale( udg_DB_CustomUnit , udg_DB_MiniSize[ udg_DB_Level[ udg_DB_ID ] ], 0, 0 )












-------- --------












Set KB3D_Unit = DB_CustomUnit












Set KB3D_Range = DB_MiniRange[DB_Level[DB_ID]]












Set KB3D_Speed = DB_MiniSpeed[DB_Level[DB_ID]]












Set KB3D_Angle = DB_MiniAngle












Set KB3D_D_MECHANICAL = True












Set KB3D_D_MAGIC_IMMINUE = False












Set KB3D_D_STRUCTURE = False












Set KB3D_D_ENEMY = True












Set KB3D_D_FLYING = False












Set KB3D_D_ALLY = False












Set KB3D_Line_Fx = DB_Effect[7]












Set KB3D_EndFx = DB_Effect[7]












Set KB3D_AoEEndDamage = DB_MiniDamage[DB_Level[DB_ID]]












Set KB3D_EndwhenDead = True












Set KB3D_KillatEnd = True












Set KB3D_AoE = DB_MiniCollision[DB_Level[DB_ID]]












Set KB3D_AttackType = DB_AttackType












Set KB3D_DamageType = DB_DamageType












Set KB3D_Damager = DB_Caster[DB_ID]












Set KB3D_DestroyTree = DB_DestroyTrees












Set KB3D_FaceAngle = True












Set KB3D_Attach = DB_EffectAttach[5]












Set KB3D_TrailFx = DB_Effect[6]












Set KB3D_UnpathableStop = False












Set KB3D_Zoffset = DB_MiniMaxHeight[DB_Level[DB_ID]]












If (All Conditions are True) then do (Then Actions) else do (Else Actions)













If - Conditions














DB_MiniEnableArc Equal to True













Then - Actions














Set KB3D_Arc = DB_CustomReal4[DB_Level[DB_ID]]













Else - Actions












-------- --------












-------- Registed All of the Settings --------












Custom script: call ExecuteFunc( "KB3D_Registration" )












-------- --------









Else - Actions








-------- --------








-------- Shards Destroy --------








Special Effect - Destroy DB_ShardModelHandler[DB_ID]








Unit - Kill DB_Unit








Unit Group - Remove DB_Unit from DB_Group








Set DB_Instance = (DB_Instance - 1)








If (All Conditions are True) then do (Then Actions) else do (Else Actions)









If - Conditions










DB_Instance Equal to 0









Then - Actions










Trigger - Turn off (This trigger)









Else - Actions








-------- --------







Else - Actions





Else - Actions




-------- --------