• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Unstable Matter v1.0 - GUI

  • Like
Reactions: ILH and Ofel
[TD] UNSTABLE MATTER[ GUI ] [/TD]
SPELL DESCRIPTION:
full


" I'll let your eyes taste the special eye candy!!! "

full



[TD] SPELL IMAGES: [/TD]

onCast

onMid

onEnd

Lets begin with the main matter or orb. This orb will seek the targeted location
full
Each matter properties improves per level.
Level 1

full

Level 2
full

Level 3
full

full

After revolving for a short duration , each matter attracts to the main orb causing them to magnetized in a center and revolves at a very high speed.
full

Of course after they get closer to their main orb , it will mix them together and creates an explosion energy matter orbs that leads to a great FIREWORKS!
full

full


[TD] CHANGELOGS :[/TD][TD]
v1.0 - Released[/TD]
[TD] CREDITS :[/TD][TD]
Bribe ( Unit Indexer System )
Jad ( KB3D System )
defskull ( LH System )
IcemanBo , Anitarf , Ammorth ( LSE System )
[/TD]

Unstable Matter Configuration

Unstable Matter Execution

Unstable Matter Loop

  • Unstable Matter Configuration
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- --------
      • -------- * SPELL CONFIGURATION FIELD * --------
      • -------- --------
      • -------- OBJECT EDITOR ( F6 ) --------
      • -------- The spell or ability used in the triggers. ( Import the Unstable Matter Ability ) --------
      • Set UM_Ability = Unstable Matter
      • -------- The customized dummy unit used in the triggers. ( Import the Unstable Matter Dummy ) --------
      • Set UM_DummyType = Unstable Matter Dummy
      • -------- --------
      • -------- SPELL DATA --------
      • -------- --------
      • -------- - --------
      • -------- The maximum level of the spell or ability. --------
      • Set UM_AbilityMaxLevel = 3
      • -------- ^ Modify at your own risk: The value must be equal to the number of levels inside the Unstable Matter Ability, uncorrect values causes errors. --------
      • -------- - --------
      • -------- The radius or area of effect of the spell or ability. --------
      • Set UM_Radius[1] = 350.00
      • Set UM_Radius[2] = 375.00
      • Set UM_Radius[3] = 400.00
      • -------- - --------
      • -------- The radius or area of effect of the spell or ability when explodes. --------
      • Set UM_ExplosionRadius[1] = 700.00
      • Set UM_ExplosionRadius[2] = 750.00
      • Set UM_ExplosionRadius[3] = 800.00
      • -------- - --------
      • -------- Destroy Trees? ( Specifically on distribution of explosion orbs ) True = Yes, False = No --------
      • Set UM_DestroyTrees = True
      • -------- - --------
      • -------- The attack and damage type of the source of damage. ( Caster ) --------
      • Set UM_AttackType = Spells
      • Set UM_DamageType = Normal
      • -------- - --------
      • -------- The interval of the looping trigger. Recommended Value: 0.03125000 = 1 second / 32 Iterations/Frames --------
      • Set UM_LoopInterval = 0.02
      • -------- ^ I've modified it to 0.02 = 0.022222 = 1 second / 45 Iterations/Frames ( Smooth Visualizations! ) --------
      • -------- ^ Modify at your own risk: Changing this value affects the spell performance so modify wisely! --------
      • -------- - --------
      • -------- --------
      • -------- MAIN ORB DATA --------
      • -------- --------
      • -------- - --------
      • -------- The art model used to attach in the main orb. --------
      • Set UM_Effect[1] = Abilities\Weapons\SpiritOfVengeanceMissile\SpiritOfVengeanceMissile.mdl
      • Set UM_EffectAttach[1] = origin
      • -------- - --------
      • -------- The size of the main orb. --------
      • Set UM_MainSize[1] = 3.25
      • Set UM_MainSize[2] = 3.75
      • Set UM_MainSize[3] = 4.25
      • -------- - --------
      • -------- The height of the main orb. --------
      • Set UM_MainHeight[1] = 55.00
      • Set UM_MainHeight[2] = 65.00
      • Set UM_MainHeight[3] = 75.00
      • -------- - --------
      • -------- The speed of the main orb. ( Distance Per Second ) --------
      • Set UM_MainSpeed[1] = 550.00
      • Set UM_MainSpeed[2] = 575.00
      • Set UM_MainSpeed[3] = 600.00
      • -------- - --------
      • -------- The spawn offset or creation range of the main orb away from the facing of the caster. --------
      • Set UM_MainCreationRange = 25.00
      • -------- - --------
      • -------- --------
      • -------- UNSTABLE MATTERS DATA --------
      • -------- --------
      • -------- ( !Modify Wisely! ) --------
      • -------- --------
      • -------- - --------
      • -------- The amount or number of the created matters. The maximum value is 75 ( Set the motion effect chance to 0 if you want this large value ) --------
      • Set UM_MatterAmount[1] = 3
      • Set UM_MatterAmount[2] = 6
      • Set UM_MatterAmount[3] = 12
      • -------- - --------
      • -------- The size of the matters. ( Sadly my matter models are not scale-able! ) ( Default: 1 ) --------
      • Set UM_MatterSize[1] = 1.00
      • Set UM_MatterSize[2] = 1.00
      • Set UM_MatterSize[3] = 1.00
      • -------- - --------
      • -------- The height of the matters. --------
      • Set UM_MatterHeight[1] = 45.00
      • Set UM_MatterHeight[2] = 55.00
      • Set UM_MatterHeight[3] = 65.00
      • -------- - --------
      • -------- Rotate Matters? True = Yes, False = No --------
      • Set UM_MatterRotation = True
      • -------- ^ IF: TRUE = You can modify the matter rotation angle speed. ( Positive Values = Counter Clockwise , Negative Values = Clockwise ) --------
      • Set UM_MatterRotationAngleSpeed[1] = 2.00
      • Set UM_MatterRotationAngleSpeed[2] = -2.00
      • Set UM_MatterRotationAngleSpeed[3] = 2.00
      • -------- - --------
      • -------- The duration of the unstable matter revolving around the main orb. --------
      • Set UM_RevolveDuration[1] = 6.00
      • Set UM_RevolveDuration[2] = 7.00
      • Set UM_RevolveDuration[3] = 8.00
      • -------- - --------
      • -------- The unstable matter art models used. ( Import the UnstableMatter.mdx models ) ( OPTIONAL ) --------
      • Set UM_Effect[2] = war3mapImported\UnstableMatterRed.mdx
      • Set UM_Effect[3] = war3mapImported\UnstableMatterBlue.mdx
      • Set UM_Effect[4] = war3mapImported\UnstableMatterYellow.mdx
      • Set UM_Effect[5] = war3mapImported\UnstableMatterViolet.mdx
      • Set UM_Effect[6] = war3mapImported\UnstableMatterGreen.mdx
      • Set UM_Effect[7] = war3mapImported\UnstableMatterOrange.mdx
      • -------- ................................................................................................................ --------
      • -------- UM_Effect[ 2 , 7 ] = [ UM_MatterMinimumEffect , UM_MatterMaximumEffect ] is the RANGE of the GetRandomNumber. --------
      • -------- The minimum and maximum array effect that is used randomly by each matter. --------
      • Set UM_MatterMinimumEffect = 2
      • -------- ^ The first initial array effect variable: UM_Effect[ 2 ] = 2 is the array minimum number so this is the minimum effect will be chosen. --------
      • Set UM_MatterMaximumEffect = 7
      • -------- ^ The first last array effect variable: UM_Effect[ 7 ] = 7 is the array maximum number so this is the maximum effect will be chosen. --------
      • -------- ^ If you want to add another art model then you can set another variable UM_Effect[ 8 ] then put your desired art model path in it. ( YOU MUST ALSO SET THE UM_MatterMaximumEffect to 8 ) --------
      • -------- ^ The UM_MatterMaximumEffect must be lesser than or equal to 10 and cannot be 0 to prevent problems. ( You can only add 3 additional effects at this moment. ) --------
      • -------- ^ Modify at your own risk: uncorrect matter minimum and maximum effect integer value can cause attaching model error. --------
      • -------- ................................................................................................................ --------
      • -------- This attachment point applies to all unstable matter units. --------
      • Set UM_EffectAttach[2] = origin
      • -------- - --------
      • -------- These are just the lightning effect model used in the spell. You can find some more lightning models inside the LHS ( defskull ) folder in LH Setup trigger. --------
      • -------- CLPB - CHAIN LIGHTNING PRIMARY --------
      • -------- DRAL - DRAIN LIFE --------
      • -------- DRAM - DRAIN MANA --------
      • -------- AFOD - FINGER OF DEATH --------
      • -------- HWPB - HEALING WAVE PRIMARY --------
      • -------- SPLK - SPIRIT LINK --------
      • -------- MFPB - MANA FLARE --------
      • -------- The lightning effect models used in the bond between the main orb and the matter. --------
      • Set UM_MatterLightningEffect[1] = CLPB
      • Set UM_MatterLightningEffect[2] = DRAL
      • Set UM_MatterLightningEffect[3] = DRAM
      • Set UM_MatterLightningEffect[4] = AFOD
      • Set UM_MatterLightningEffect[5] = HWPB
      • Set UM_MatterLightningEffect[6] = SPLK
      • Set UM_MatterLightningEffect[7] = MFPB
      • -------- ................................................................................................................ --------
      • -------- The procedures are exactly the same as stated from the UM_Effects above --------
      • Set UM_MatterMinimumLightning = 1
      • Set UM_MatterMaximumLightning = 7
      • -------- ********************************************************************************** --------
      • -------- SOME LIGHTNING CONFIGURATIONS CAN BE MODIFY INSIDE THE LHS ( defskull ) Folder in LH SETUP trigger. --------
      • -------- ********************************************************************************** --------
      • -------- - --------
      • -------- The width of the lightning where the enemy units will be damaged when touched. --------
      • Set UM_MatterLightningWidth[1] = 25.00
      • Set UM_MatterLightningWidth[2] = 25.00
      • Set UM_MatterLightningWidth[3] = 25.00
      • -------- - --------
      • -------- The damage of the lightning touched in the width by the enemy units. ( Damage Per Second ) --------
      • Set UM_MatterLightningDamage[1] = 25.00
      • Set UM_MatterLightningDamage[2] = 30.00
      • Set UM_MatterLightningDamage[3] = 35.00
      • -------- - --------
      • -------- The returning time of the matter to the main orb. --------
      • Set UM_MatterReturnTime[1] = 18.00
      • Set UM_MatterReturnTime[2] = 0.50
      • Set UM_MatterReturnTime[3] = 15.00
      • -------- - --------
      • -------- An effect occurs at the ground when the unstable matter moves or in motion state. --------
      • Set UM_Effect[11] = Abilities\Spells\Human\Feedback\ArcaneTowerAttack.mdl
      • -------- The percentage chance ( 0 , 100% ) to show the motion effect in looping intervals. --------
      • Set UM_MotionEffectChance = 5
      • -------- ^ If you want to disable the motion effect then you can set this value to 0. --------
      • -------- ^ Motions effects have a huge impact on spell performance especially when loop interval value is low. --------
      • -------- - --------
      • -------- An effect occurs at the unstable matters when they starts to return. --------
      • Set UM_Effect[12] = Abilities\Spells\Items\TomeOfRetraining\TomeOfRetrainingCaster.mdl
      • -------- - --------
      • -------- Explodes When Matters Mixed Or Collided Each Other? True = Yes, False = No --------
      • Set UM_MatterCollideExplosion = True
      • -------- ^ IF: TRUE = Import the KB3D System ( Jad ) --------
      • -------- ^ IF: FALSE = Ignore and leave the KB3D System ( Jad ) and skip the explosion orbs section part. --------
      • -------- - --------
      • -------- --------
      • -------- EXPLOSION ORBS DATA --------
      • -------- --------
      • -------- The art models used in the explosion orbs is the same as the unstable matter art models above. --------
      • -------- ^ However I'll just give you the freedom to modify in this SPECIFIC explosion orbs art model if you don't like random. --------
      • Set UM_ExplosionOrbsModelSpecific = False
      • -------- ^ IF: TRUE = Modify the UM_Effect[ 13 ] art model path and it's attachment point. --------
      • Set UM_Effect[13] =
      • Set UM_EffectAttach[3] =
      • -------- - --------
      • -------- The amount or the number of the explosion orbs created. The maximum value that will not affect the spell performance is 50. --------
      • Set UM_ExplosionOrbsAmount[1] = 15
      • Set UM_ExplosionOrbsAmount[2] = 20
      • Set UM_ExplosionOrbsAmount[3] = 45
      • -------- - --------
      • -------- The size of the explosion orbs. --------
      • Set UM_ExplosionOrbsSize[1] = 1.00
      • Set UM_ExplosionOrbsSize[2] = 1.00
      • Set UM_ExplosionOrbsSize[3] = 1.00
      • -------- - --------
      • -------- The minimum and maximum height of the explosion orbs. --------
      • Set UM_ExplosionOrbsMinHeight[1] = 200.00
      • Set UM_ExplosionOrbsMinHeight[2] = 200.00
      • Set UM_ExplosionOrbsMinHeight[3] = 200.00
      • Set UM_ExplosionOrbsMaxHeight[1] = 400.00
      • Set UM_ExplosionOrbsMaxHeight[2] = 445.00
      • Set UM_ExplosionOrbsMaxHeight[3] = 475.00
      • -------- - --------
      • -------- The speed of the explosion orbs. ( Distance Per Second ) --------
      • Set UM_ExplosionOrbsSpeed[1] = 300.00
      • Set UM_ExplosionOrbsSpeed[2] = 325.00
      • Set UM_ExplosionOrbsSpeed[3] = 350.00
      • -------- - --------
      • -------- The collision radius of the explosion orbs when landed. --------
      • Set UM_ExplosionOrbsCollision[1] = 45.00
      • Set UM_ExplosionOrbsCollision[2] = 60.00
      • Set UM_ExplosionOrbsCollision[3] = 75.00
      • -------- - --------
      • -------- The damage inside the collision radius of the explosion orbs when landed. --------
      • Set UM_ExplosionOrbsDamage[1] = 75.00
      • Set UM_ExplosionOrbsDamage[2] = 100.00
      • Set UM_ExplosionOrbsDamage[3] = 125.00
      • -------- - --------
      • -------- An effect occurs at the ground when explosion orbs landed. --------
      • Set UM_Effect[14] = Abilities\Spells\Human\DispelMagic\DispelMagicTarget.mdl
      • -------- - --------
      • -------- The damage inside the explosion radius or area of effect to the enemy units. --------
      • Set UM_ExplosionRadiusDamage[1] = 100.00
      • Set UM_ExplosionRadiusDamage[2] = 150.00
      • Set UM_ExplosionRadiusDamage[3] = 200.00
      • -------- - --------
      • -------- An effect occurs at the main orb when explosion starts. ( Main Scaling ) --------
      • Set UM_Effect[15] = Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl
      • -------- - --------
      • -------- The percentage chance ( 0 , 100% ) to enable the explosion orbs to perform arc movements. --------
      • Set UM_ExplosionOrbsArcChance = 35
      • -------- ^ If you want to disable the arc motion then you can set this value to 0. --------
      • -------- ^ IF: Value > 0 = You can set the arc adjustments. --------
      • Set UM_ExplosionOrbsArc[1] = 25.00
      • Set UM_ExplosionOrbsArc[2] = 25.00
      • Set UM_ExplosionOrbsArc[3] = 25.00
      • -------- - --------
      • -------- This is the highest effect array variable number used. It's main purpose is for preloading so be careful if you modify this value. Only modify when you changed some array numbers in effects. --------
      • -------- UM_Effect[ 15 ] = is the highest so the array number is 15. --------
      • Set UM_EffectsAmount = 15
      • -------- - --------
      • -------- .......................................................................................................................... --------
      • -------- --------
      • -------- CODE DATA --------
      • -------- ( DON'T TOUCH THE CODES BELOW UNLESS SOME OF THEM MALFUNCTIONS ) --------
      • -------- --------
      • -------- .......................................................................................................................... --------
      • -------- Loop Event --------
      • Trigger - Add to Unstable Matter Loop <gen> the event (Time - Every UM_LoopInterval seconds of game time)
      • -------- .......................................................................................................................... --------
      • -------- Preload Objects --------
      • -------- Abilities , Units: --------
      • Custom script: set udg_UM_Unit = CreateUnit( Player( 15 ) , udg_UM_DummyType, 0, 0, 0 )
      • Custom script: call UnitAddAbility( udg_UM_Unit, udg_UM_Ability )
      • Custom script: call RemoveUnit( udg_UM_Unit )
      • -------- Effects: --------
      • For each (Integer UM_CustomInteger) from 1 to UM_EffectsAmount, do (Actions)
        • Loop - Actions
          • Custom script: call Preload( udg_UM_Effect[ udg_UM_CustomInteger ] )
      • -------- .......................................................................................................................... --------
      • -------- Initialize Calculations --------
      • For each (Integer UM_CustomInteger) from 1 to UM_AbilityMaxLevel, do (Actions)
        • Loop - Actions
          • Set UM_CustomReal[UM_CustomInteger] = (UM_MainSpeed[UM_CustomInteger] x UM_LoopInterval)
          • Set UM_CustomReal2[UM_CustomInteger] = (360.00 / (Real(UM_MatterAmount[UM_CustomInteger])))
          • Set UM_CustomReal3[UM_CustomInteger] = (UM_Radius[UM_CustomInteger] / (UM_MatterReturnTime[UM_CustomInteger] / UM_LoopInterval))
          • Set UM_CustomReal4[UM_CustomInteger] = (UM_RevolveDuration[UM_CustomInteger] + UM_MatterReturnTime[UM_CustomInteger])
          • Set UM_CustomReal5[UM_CustomInteger] = (UM_ExplosionRadius[UM_CustomInteger] / 1.50)
          • Set UM_CustomReal6[UM_CustomInteger] = (UM_MatterLightningDamage[UM_CustomInteger] x UM_LoopInterval)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • UM_MotionEffectChance Equal to 0
        • Then - Actions
          • Set UM_MotionEffectChance = -1
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • UM_ExplosionOrbsArcChance Equal to 0
        • Then - Actions
          • Set UM_ExplosionOrbsArcChance = -1
        • Else - Actions
      • -------- .......................................................................................................................... --------
      • -------- --------
      • -------- * END OF SPELL CONFIGURATION FIELD * --------
      • -------- --------
      • -------- .......................................................................................................................... --------
      • -------- declaration of initial variables --------
      • Custom script: set udg_UM_Map[ 1 ] = GetRectMinX( bj_mapInitialPlayableArea )
      • Custom script: set udg_UM_Map[ 2 ] = GetRectMaxX( bj_mapInitialPlayableArea )
      • Custom script: set udg_UM_Map[ 3 ] = GetRectMinY( bj_mapInitialPlayableArea )
      • Custom script: set udg_UM_Map[ 4 ] = GetRectMaxY( bj_mapInitialPlayableArea )
      • -------- .......................................................................................................................... --------
      • Custom script: endfunction
      • Custom script:
      • Custom script: // !Essential Functions!
      • Custom script:
      • Custom script: function UM_InPlayableArea takes real x, real y returns boolean // Detects X/Y coordinates inside the playable area
      • Custom script: return x < udg_UM_Map[ 2 ] and x > udg_UM_Map[ 1 ] and y < udg_UM_Map[ 4 ] and y > udg_UM_Map[ 3 ]
      • Custom script: endfunction
      • Custom script:
      • Custom script: function UM_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 UM_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
  • Unstable Matter Execution
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to UM_Ability
    • Actions
      • -------- --------
      • -------- OnCast --------
      • -------- --------
      • -------- declaration of locals: --------
      • Custom script: local real x
      • Custom script: local real y
      • Custom script: local real x2 = GetSpellTargetX( )
      • Custom script: local real y2 = GetSpellTargetY( )
      • Custom script: local real x3
      • Custom script: local real y3
      • Custom script: local real angle
      • -------- --------
      • -------- temporary index --------
      • Set UM_Caster[0] = (Triggering unit)
      • -------- --------
      • -------- spawn offset --------
      • Custom script: set x = GetUnitX( udg_UM_Caster[ 0 ] )
      • Custom script: set y = GetUnitY( udg_UM_Caster[ 0 ] )
      • Custom script: set angle = Atan2( y2 - y , x2 - x )
      • Custom script: set x3 = x + udg_UM_MainCreationRange * Cos( angle )
      • Custom script: set y3 = y + udg_UM_MainCreationRange * Sin( angle )
      • -------- --------
      • -------- the main unit --------
      • Custom script: set udg_UM_Unit = CreateUnit( GetTriggerPlayer( ) , udg_UM_DummyType , x3 , y3 , angle * bj_RADTODEG )
      • Custom script: set udg_UM_ID = GetUnitUserData( udg_UM_Unit )
      • -------- --------
      • -------- allocations and properties --------
      • Set UM_Caster[UM_ID] = UM_Caster[0]
      • Set UM_CasterPlayer[UM_ID] = (Owner of UM_Caster[UM_ID])
      • Set UM_Level[UM_ID] = (Level of UM_Ability for UM_Caster[UM_ID])
      • Set UM_Main[UM_ID] = UM_Unit
      • Custom script: call SetUnitScale( udg_UM_Unit , udg_UM_MainSize[ udg_UM_Level[ udg_UM_ID ] ] , 0 , 0 )
      • Custom script: call SetUnitFlyHeight( udg_UM_Unit , udg_UM_MainHeight[ udg_UM_Level[ udg_UM_ID ] ] , 0 )
      • Custom script: set udg_UM_MainModelHandler[ udg_UM_ID ] = AddSpecialEffectTarget( udg_UM_Effect[ 1 ] , udg_UM_Unit , udg_UM_EffectAttach[ 1 ] )
      • Custom script: set udg_UM_MaxDistance[ udg_UM_ID ] = SquareRoot( ( x2 - x ) * ( x2 - x ) + ( y2 - y ) * ( y2 - y ) ) - udg_UM_MainCreationRange
      • Custom script: set udg_UM_MainAngle[ udg_UM_ID ] = angle
      • -------- --------
      • -------- counters --------
      • Set UM_CurrentDistance[UM_ID] = 0.00
      • -------- --------
      • -------- phase one insert main element --------
      • Set UM_Phase[UM_ID] = 1
      • Unit Group - Add UM_Unit to UM_Group
      • -------- --------
      • -------- When these blocks become RED or malfunctions when you imported, just double click it ( the line ) and press enter to renew the function. --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unstable Matter Loop <gen> is on) Equal to False
        • Then - Actions
          • Trigger - Turn on Unstable Matter Loop <gen>
        • Else - Actions
      • -------- --------
  • Unstable Matter Loop
    • Events
    • Conditions
    • Actions
      • -------- --------
      • -------- OnLoop --------
      • -------- --------
      • Unit Group - Pick every unit in UM_Group and do (Actions)
        • Loop - Actions
          • -------- --------
          • -------- declaration of locals: --------
          • Custom script: local real x
          • Custom script: local real y
          • Custom script: local real x2
          • Custom script: local real y2
          • Custom script: local real mX
          • Custom script: local real mY
          • Custom script: local real rX
          • Custom script: local real rY
          • Custom script: local real rX2
          • Custom script: local real rY2
          • Custom script: local integer i
          • -------- --------
          • Set UM_Unit = (Picked unit)
          • Custom script: set udg_UM_ID = GetUnitUserData( udg_UM_Unit )
          • -------- --------
          • -------- current element coordinates --------
          • Custom script: set x = GetUnitX( udg_UM_Unit )
          • Custom script: set y = GetUnitY( udg_UM_Unit )
          • -------- --------
          • -------- phase one moving main element --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • UM_Phase[UM_ID] Equal to 1
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • UM_CurrentDistance[UM_ID] Greater than or equal to UM_MaxDistance[UM_ID]
                • Then - Actions
                  • -------- --------
                  • -------- unstable matters creation --------
                  • For each (Integer UM_CustomInteger) from 1 to UM_MatterAmount[UM_Level[UM_ID]], do (Actions)
                    • Loop - Actions
                      • -------- --------
                      • -------- sub-elements --------
                      • Set UM_MatterAngle[UM_ID] = (UM_MatterAngle[UM_ID] + UM_CustomReal2[UM_Level[UM_ID]])
                      • Custom script: set x2 = x + udg_UM_Radius[ udg_UM_Level[ udg_UM_ID ] ] * Cos( udg_UM_MatterAngle[ udg_UM_ID ] * bj_DEGTORAD )
                      • Custom script: set y2 = y + udg_UM_Radius[ udg_UM_Level[ udg_UM_ID ] ] * Sin( udg_UM_MatterAngle[ udg_UM_ID ] * bj_DEGTORAD )
                      • Custom script: set udg_UM_CustomUnit = CreateUnit( udg_UM_CasterPlayer[ udg_UM_ID ] , udg_UM_DummyType , x2 , y2 , Atan2( y - y2 , x - x2 ) * bj_RADTODEG )
                      • Custom script: set udg_UM_CustomID = GetUnitUserData( udg_UM_CustomUnit )
                      • Custom script: set udg_UM_Main[ udg_UM_CustomID ] = udg_UM_Main[ udg_UM_ID ]
                      • -------- --------
                      • -------- allocations and properties --------
                      • Set UM_Caster[UM_CustomID] = UM_Caster[UM_ID]
                      • Set UM_CasterPlayer[UM_CustomID] = UM_CasterPlayer[UM_ID]
                      • Set UM_Level[UM_CustomID] = UM_Level[UM_ID]
                      • Set UM_MainModelHandler[UM_CustomID] = UM_MainModelHandler[UM_ID]
                      • Custom script: set udg_UM_CoreX[ udg_UM_CustomID ] = GetUnitX( udg_UM_Main[ udg_UM_CustomID ] )
                      • Custom script: set udg_UM_CoreY[ udg_UM_CustomID ] = GetUnitY( udg_UM_Main[ udg_UM_CustomID ] )
                      • Custom script: call SetUnitScale( udg_UM_CustomUnit , udg_UM_MatterSize[ udg_UM_Level[ udg_UM_CustomID ] ] , 0 , 0 )
                      • Custom script: call SetUnitFlyHeight( udg_UM_CustomUnit , udg_UM_MatterHeight[ udg_UM_Level[ udg_UM_CustomID ] ] , 0 )
                      • Custom script: set i = GetRandomInt( udg_UM_MatterMinimumEffect , udg_UM_MatterMaximumEffect )
                      • Custom script: set udg_UM_MatterModelHandler[ udg_UM_CustomID ] = AddSpecialEffectTarget( udg_UM_Effect[ i ] , udg_UM_CustomUnit , udg_UM_EffectAttach[ 2 ] )
                      • -------- --------
                      • -------- * LIGHTNING HANDLING SYSTEM * --------
                      • Set LH_DurationSet = UM_CustomReal4[UM_Level[UM_CustomID]]
                      • Set LH_LightningNameSet = UM_MatterLightningEffect[(Random integer number between UM_MatterMinimumLightning and UM_MatterMaximumLightning)]
                      • Set LH_UnitSourceSet = UM_CustomUnit
                      • Set LH_UnitTargetSet = UM_Main[UM_CustomID]
                      • Trigger - Run LH Unit2Unit <gen> (ignoring conditions)
                      • -------- --------
                      • -------- counters --------
                      • Set UM_MatterRevolveAngle[UM_CustomID] = UM_MatterAngle[UM_ID]
                      • Set UM_RevolveDurationCounter[UM_CustomID] = 0.00
                      • Set UM_MatterReturnTimeCounter[UM_CustomID] = 0.00
                      • Set UM_MatterCurrentDistance[UM_CustomID] = UM_Radius[UM_Level[UM_CustomID]]
                      • Set UM_CustomBoolean[UM_CustomID] = False
                      • Custom script: set udg_UM_MatterReturnAngle[ udg_UM_CustomID ] = Atan2( udg_UM_CoreY[ udg_UM_CustomID ] - y2, udg_UM_CoreX[ udg_UM_CustomID ] - x2 )
                      • -------- --------
                      • -------- phase two insert sub-elements --------
                      • Set UM_Phase[UM_CustomID] = 2
                      • Unit Group - Add UM_CustomUnit to UM_Group
                      • -------- --------
                  • -------- --------
                  • -------- temporary remove of main element reference from looping group --------
                  • Unit Group - Remove UM_Unit from UM_Group
                  • -------- --------
                • Else - Actions
                  • -------- --------
                  • -------- main element motion --------
                  • Custom script: set mX = x + udg_UM_CustomReal[ udg_UM_Level[ udg_UM_ID ] ] * Cos( udg_UM_MainAngle[ udg_UM_ID ] )
                  • Custom script: set mY = y + udg_UM_CustomReal[ udg_UM_Level[ udg_UM_ID ] ] * Sin( udg_UM_MainAngle[ udg_UM_ID ] )
                  • Custom script: call UM_Move( udg_UM_Unit , mX , mY , true )
                  • Set UM_CurrentDistance[UM_ID] = (UM_CurrentDistance[UM_ID] + UM_CustomReal[UM_Level[UM_ID]])
                  • -------- --------
              • -------- --------
            • Else - Actions
          • -------- --------
          • -------- phase two moving sub-elements --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • UM_Phase[UM_ID] Equal to 2
            • Then - Actions
              • -------- --------
              • -------- * LINE SEGMENT ENUMERATION SYSTEM * --------
              • -------- --------
              • -------- conversion --------
              • Custom script: set udg_LSE_Loc_1 = Location( x , y )
              • Custom script: set udg_LSE_Loc_2 = Location( udg_UM_CoreX[ udg_UM_ID ] , udg_UM_CoreY[ udg_UM_ID ] )
              • -------- width --------
              • Set LSE_Width = UM_MatterLightningWidth[UM_Level[UM_ID]]
              • Trigger - Run LSE_Trigger_GetUnits (ignoring conditions)
              • -------- --------
              • -------- !NotDestroy! --------
              • Unit Group - Pick every unit in LSE_Group and do (Actions)
                • Loop - Actions
                  • Set UM_PickedUnit = (Picked unit)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (UM_PickedUnit is dead) Equal to False
                      • (UM_PickedUnit is A structure) Equal to False
                      • (UM_PickedUnit is Magic Immune) Equal to False
                      • (UM_PickedUnit is A flying unit) Equal to False
                      • (UM_PickedUnit belongs to an enemy of UM_CasterPlayer[UM_ID]) Equal to True
                    • Then - Actions
                      • Unit - Cause UM_Caster[UM_ID] to damage UM_PickedUnit, dealing UM_CustomReal6[UM_Level[UM_ID]] damage of attack type UM_AttackType and damage type UM_DamageType
                    • Else - Actions
              • -------- --------
              • -------- remove leaks --------
              • Custom script: call RemoveLocation( udg_LSE_Loc_1 )
              • Custom script: call RemoveLocation( udg_LSE_Loc_2 )
              • -------- --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • UM_RevolveDurationCounter[UM_ID] Greater than or equal to UM_RevolveDuration[UM_Level[UM_ID]]
                • Then - Actions
                  • -------- --------
                  • -------- initial return effect --------
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • UM_CustomBoolean[UM_ID] Equal to False
                    • Then - Actions
                      • -------- --------
                      • Custom script: call DestroyEffect( AddSpecialEffect( udg_UM_Effect[ 12 ] , x , y ) )
                      • Set UM_CustomBoolean[UM_ID] = True
                      • -------- --------
                    • Else - Actions
                  • -------- --------
                  • -------- sub-elements return motion --------
                  • Custom script: set udg_UM_MatterReturnAngle[ udg_UM_ID ] = udg_UM_MatterReturnAngle[ udg_UM_ID ] + udg_UM_MatterRotationAngleSpeed[ udg_UM_Level[ udg_UM_ID ] ]
                  • Set UM_MatterCurrentDistance[UM_ID] = (UM_MatterCurrentDistance[UM_ID] - UM_CustomReal3[UM_Level[UM_ID]])
                  • Custom script: set rX2 = udg_UM_CoreX[ udg_UM_ID ] + udg_UM_MatterCurrentDistance[ udg_UM_ID ] * Cos( udg_UM_MatterReturnAngle[ udg_UM_ID ] )
                  • Custom script: set rY2 = udg_UM_CoreY[ udg_UM_ID ] + udg_UM_MatterCurrentDistance[ udg_UM_ID ] * Sin( udg_UM_MatterReturnAngle[ udg_UM_ID ] )
                  • Custom script: call UM_Move( udg_UM_Unit , rX2 , rY2 , true )
                  • Set UM_MatterReturnTimeCounter[UM_ID] = (UM_MatterReturnTimeCounter[UM_ID] + UM_LoopInterval)
                  • -------- --------
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • UM_MatterReturnTimeCounter[UM_ID] Greater than or equal to UM_MatterReturnTime[UM_Level[UM_ID]]
                    • Then - Actions
                      • -------- --------
                      • -------- referencing the main element from the looping group --------
                      • Custom script: set udg_UM_CustomID = GetUnitUserData( udg_UM_Main[ udg_UM_ID ] )
                      • Set UM_Caster[UM_CustomID] = UM_Caster[UM_ID]
                      • Set UM_CasterPlayer[UM_CustomID] = UM_CasterPlayer[UM_ID]
                      • Set UM_Level[UM_CustomID] = UM_Level[UM_ID]
                      • Set UM_MainModelHandler[UM_CustomID] = UM_MainModelHandler[UM_ID]
                      • -------- --------
                      • -------- phase three insert main element --------
                      • Set UM_Phase[UM_CustomID] = 3
                      • Unit Group - Add UM_Main[UM_ID] to UM_Group
                      • -------- --------
                      • -------- removing the sub-elements --------
                      • Special Effect - Destroy UM_MatterModelHandler[UM_ID]
                      • Unit - Kill UM_Unit
                      • Unit Group - Remove UM_Unit from UM_Group
                      • -------- --------
                    • Else - Actions
                • Else - Actions
                  • -------- --------
                  • -------- sub-elements revolve motion --------
                  • Set UM_MatterRevolveAngle[UM_ID] = (UM_MatterRevolveAngle[UM_ID] + UM_MatterRotationAngleSpeed[UM_Level[UM_ID]])
                  • Custom script: set rX = udg_UM_CoreX[ udg_UM_ID ] + udg_UM_Radius[ udg_UM_Level[ udg_UM_ID ] ] * Cos( udg_UM_MatterRevolveAngle[ udg_UM_ID ] * bj_DEGTORAD )
                  • Custom script: set rY = udg_UM_CoreY[ udg_UM_ID ] + udg_UM_Radius[ udg_UM_Level[ udg_UM_ID ] ] * Sin( udg_UM_MatterRevolveAngle[ udg_UM_ID ] * bj_DEGTORAD )
                  • Custom script: call UM_Move( udg_UM_Unit , rX , rY , true )
                  • Set UM_RevolveDurationCounter[UM_ID] = (UM_RevolveDurationCounter[UM_ID] + UM_LoopInterval)
                  • -------- --------
              • -------- --------
            • Else - Actions
          • -------- --------
          • -------- phase three moving explosion orbs * KB3D System * --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • UM_Phase[UM_ID] Equal to 3
            • Then - Actions
              • -------- --------
              • -------- explosion properties --------
              • Custom script: call DestroyEffect( AddSpecialEffectTarget( udg_UM_Effect[ 15 ] , udg_UM_Unit , udg_UM_EffectAttach[ 1 ] ) )
              • Custom script: call GroupEnumUnitsInRange( bj_lastCreatedGroup , x , y , udg_UM_ExplosionRadius[ udg_UM_Level[ udg_UM_ID ] ] , null )
              • Custom script: loop
              • Custom script: set udg_UM_PickedUnit = FirstOfGroup( bj_lastCreatedGroup )
              • Custom script: exitwhen udg_UM_PickedUnit == null
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (UM_PickedUnit is dead) Equal to False
                  • (UM_PickedUnit is A structure) Equal to False
                  • (UM_PickedUnit is Magic Immune) Equal to False
                  • (UM_PickedUnit is A flying unit) Equal to False
                  • (UM_PickedUnit belongs to an enemy of UM_CasterPlayer[UM_ID]) Equal to True
                • Then - Actions
                  • Unit - Cause UM_Caster[UM_ID] to damage UM_PickedUnit, dealing UM_ExplosionRadiusDamage[UM_Level[UM_ID]] damage of attack type UM_AttackType and damage type UM_DamageType
                • Else - Actions
              • Custom script: call GroupRemoveUnit( bj_lastCreatedGroup , udg_UM_PickedUnit )
              • Custom script: endloop
              • -------- --------
              • -------- explosion orbs creation * KB3D System * --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • UM_MatterCollideExplosion Equal to True
                • Then - Actions
                  • -------- --------
                  • For each (Integer UM_CustomInteger) from 1 to UM_ExplosionOrbsAmount[UM_Level[UM_ID]], do (Actions)
                    • Loop - Actions
                      • -------- --------
                      • Custom script: set udg_UM_CustomUnit = CreateUnit( udg_UM_CasterPlayer[ udg_UM_ID ] , udg_UM_DummyType , x , y , GetRandomReal( -bj_PI , bj_PI ) )
                      • Custom script: call SetUnitScale( udg_UM_CustomUnit , udg_UM_ExplosionOrbsSize[ udg_UM_Level[ udg_UM_ID ] ] , 0 , 0 )
                      • Set KB3D_Unit = UM_CustomUnit
                      • Set KB3D_Range = (Random real number between UM_CustomReal5[UM_Level[UM_ID]] and UM_ExplosionRadius[UM_Level[UM_ID]])
                      • Set KB3D_Speed = UM_ExplosionOrbsSpeed[UM_Level[UM_ID]]
                      • Set KB3D_Angle = (Random real number between 0.00 and 360.00)
                      • Set KB3D_D_ENEMY = True
                      • Set KB3D_EndFx = UM_Effect[14]
                      • Set KB3D_AoEEndDamage = UM_ExplosionOrbsDamage[UM_Level[UM_ID]]
                      • Set KB3D_EndwhenDead = True
                      • Set KB3D_KillatEnd = True
                      • Set KB3D_AoE = UM_ExplosionOrbsCollision[UM_Level[UM_ID]]
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Random integer number between 1 and 100) Less than or equal to UM_ExplosionOrbsArcChance
                        • Then - Actions
                          • Set KB3D_Arc = UM_ExplosionOrbsArc[UM_Level[UM_ID]]
                        • Else - Actions
                          • Set KB3D_Arc = 0.00
                      • Set KB3D_AttackType = UM_AttackType
                      • Set KB3D_DamageType = UM_DamageType
                      • Set KB3D_Damager = UM_Caster[UM_ID]
                      • Set KB3D_DestroyTree = UM_DestroyTrees
                      • Set KB3D_DisableUnit = True
                      • Set KB3D_FaceAngle = True
                      • Set KB3D_iKB = False
                      • Set KB3D_JumpOverCliff = True
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • UM_ExplosionOrbsModelSpecific Equal to True
                        • Then - Actions
                          • Set KB3D_TrailFx = UM_Effect[13]
                          • Set KB3D_Attach = UM_EffectAttach[3]
                        • Else - Actions
                          • Custom script: set i = GetRandomInt( udg_UM_MatterMinimumEffect , udg_UM_MatterMaximumEffect )
                          • Custom script: set udg_KB3D_TrailFx = udg_UM_Effect[ i ]
                          • Set KB3D_Attach = UM_EffectAttach[2]
                      • Set KB3D_UnpathableStop = False
                      • Set KB3D_Zoffset = (Random real number between UM_ExplosionOrbsMinHeight[UM_Level[UM_ID]] and UM_ExplosionOrbsMaxHeight[UM_Level[UM_ID]])
                      • -------- --------
                      • -------- KB3D Settings Registered --------
                      • Custom script: call ExecuteFunc( "KB3D_Registration" )
                      • -------- --------
                • Else - Actions
              • -------- --------
              • -------- removing the reference of main element in looping group --------
              • Special Effect - Destroy UM_MainModelHandler[UM_ID]
              • Unit - Kill UM_Unit
              • Unit Group - Remove UM_Unit from UM_Group
              • -------- --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Number of units in UM_Group) Equal to 0
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions
              • -------- --------
            • Else - Actions
          • -------- --------
          • -------- motion effects --------
          • Custom script: if GetRandomInt( 0 , 100 ) <= udg_UM_MotionEffectChance then
          • Custom script: call DestroyEffect( AddSpecialEffect( udg_UM_Effect[ 11 ], x , y ) )
          • Custom script: endif
          • -------- --------


" Unstable Orb should be the name but I think matter is scientifically powerful so it doesn't matter xD "

" Useful at damaging units in an area in terms of lightning, creates a powerful energy burst which creates a distribution of harmful matters! "

" It's time to give candies to your eyes! "

" The main purpose is to add a visual effects , aesthetics and express creativity! "

" Gives a visual life to the game environment! "
Contents

Unstable Matter v1.0 - GUI (Map)

Reviews
KILLCIDE
That's an insane amount of effects ._. So pretty to look at though. The spell concept itself is pretty bland, but the beautiful effects and the well organized code outweighs it. However, the overall spell duration is reeally long, I find it hard to...
Level 37
Joined
Jul 22, 2015
Messages
3,485
That's an insane amount of effects ._. So pretty to look at though. The spell concept itself is pretty bland, but the beautiful effects and the well organized code outweighs it. However, the overall spell duration is reeally long, I find it hard to see its practicality in a WarCraft map. This can obviously be changed thanks to your config trigger though (anything faster would just make the spell look weird imo).

My only suggestion for you is to use an integer counter to decide when to turn on the loop instead of using the "Trigger - Trigger Is On" function.


Approved with a 4/5 rating.
 
Level 20
Joined
Aug 13, 2013
Messages
1,696
About the duration the level 2 spell properties really fits into it ( but as you said it will make the spell weird xD )

About the integer counter, personally Im not convinced to use that as a checker inside the loop of unit groups ( I've had this problem before ) cause its actually doesnt turn off the loop trigger ( Ive also debug the integer counter but surprisingly it gave me odd results especially when casting a spell multiple times ) but Im not sure if Im just missing some things a long ago ^^.
 
Level 20
Joined
Aug 13, 2013
Messages
1,696
Declare integer global variable initialized to 0.

Basically behaves like a unit group;
onCast:
If IntegerCounter == 0 then
Turn On Loop
endif
Add Unit in UnitGroup
Set IntegerCounter = IntegerCounter + 1
onLoop:
Remove Unit in UnitGroup
Set IntegerCounter = IntegerCounter - 1
If IntegerCounter == 0 then
Turn Off
endif

This is what I did on my hashtable spell before but when I actually debug Ive found out ( especially rapid cast ) that it actually doesnt turn off the loop thats why I prefer to use counting units on a unitgroup. ( yeah in terms of efficiency it is bad, but more safe )
 
Level 20
Joined
Aug 13, 2013
Messages
1,696
The handle ID of the unit,

Anyway I can show you an example how I use that checking method on PM xD.

Edit: If Im just assumed that it is not working then atleast show how the method must be done ^^.
 
Top