• 🏆 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!

Destructo Disc v1.0

This bundle is marked as useful / simple. Simplicity is bliss, low effort and/or may contain minor bugs.
Destructo Disc

A GUI triggered spell useful and should look quite good to most.
1. File -> Preferences -> Automatically create unknown variables while pasting trigger data.
2. Export and then import all data of import manager in the map to your map to their respective location in this map.
3. Copy all custom abilities and buffs data to your map
4. Copy the Dummy (Destructo Disc), Dummy (Attack), Direction Controller (Movement) unit to your map.
5. Copy the Destructo Disc trigger folder to your map
6. Add the Initialization 1Disc1 trigger's code to your map's initialization trigger.
7. Rate this spell
  • Initialization 1Disc1
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- Hashtable Creation --------
      • Hashtable - Create a hashtable
      • Set Base_Hashtable_1Disc1 = (Last created hashtable)
      • Hashtable - Create a hashtable
      • Set Knock_Hashtable_1Disc1 = (Last created hashtable)
      • Hashtable - Create a hashtable
      • Set Move_Hashtable_1Disc1 = (Last created hashtable)
      • -------- Do Not Touch --------
  • On Cast 1Disc1
    • Events
      • Unit - A unit Spawns a summoned unit
    • Conditions
      • (Unit-type of (Summoned unit)) Equal to Dummy (Destructo Disc)
    • Actions
      • -------- Saving Values........ --------
      • Hashtable - Save (Level of Destructo Disc for (Summoning unit)) as (Key Level) of (Key (Summoned unit)) in Base_Hashtable_1Disc1
      • Hashtable - Save Handle Of(Summoned unit) as (Key Disc) of (Key (Summoned unit)) in Base_Hashtable_1Disc1
      • Hashtable - Save Handle Of(Summoning unit) as (Key User) of (Key (Summoned unit)) in Base_Hashtable_1Disc1
      • Hashtable - Save (Angle from (Position of (Summoning unit)) to (Position of (Summoned unit))) as (Key Angle) of (Key (Summoned unit)) in Base_Hashtable_1Disc1
      • -------- Duration of Destructo Disc - Configurable --------
      • Set Duration_1Disc1 = (((Real((Load (Key Level) of (Key (Summoned unit)) from Base_Hashtable_1Disc1))) x 10.00) + 10.00)
      • Hashtable - Save Duration_1Disc1 as (Key Duration) of (Key (Summoned unit)) in Base_Hashtable_1Disc1
      • -------- Starting Move Direction - Configurable --------
      • Hashtable - Save 0 as (Key Key_D) of (Key (Summoned unit)) in Base_Hashtable_1Disc1
      • -------- Making Hero Invulnerable and pausing it. Also creates and selects directional controller, --------
      • Unit - Pause (Summoning unit)
      • Unit - Make (Summoning unit) Invulnerable
      • Unit - Create 1 Direction Controller (Movement) for (Owner of (Summoning unit)) at ((Position of (Summoning unit)) offset by 200.00 towards (Load (Key Angle) of (Key (Summoned unit)) from Base_Hashtable_1Disc1) degrees) facing (Load (Key Angle) of (Key (Summoned unit)) from Base_Hashtable_1Disc1) degrees
      • Selection - Clear selection for (Owner of (Summoning unit))
      • Selection - Select (Last created unit) for (Owner of (Summoning unit))
      • Hashtable - Save Handle Of(Last created unit) as (Key D_Control) of (Key (Summoned unit)) in Base_Hashtable_1Disc1
      • -------- Proceeding......... --------
      • Unit Group - Add (Summoned unit) to Destructo_Discs_1Disc1
  • In Action cum Clean Up 1Disc1
    • Events
      • Time - Every 0.01 seconds of game time
    • Conditions
    • Actions
      • -------- Damage and Tree Kill --------
      • Unit Group - Pick every unit in Destructo_Discs_1Disc1 and do (Actions)
        • Loop - Actions
          • -------- Max Hits - Configurable --------
          • Set Max_Hits_1Disc1 = ((Load (Key Level) of (Key (Picked unit)) from Base_Hashtable_1Disc1) + 1)
          • Set Expiration_Disc_1Disc1 = ((Load (Key Timer_Ex) of (Key (Picked unit)) from Base_Hashtable_1Disc1) + 0.01)
          • Hashtable - Save Expiration_Disc_1Disc1 as (Key Timer_Ex) of (Key (Picked unit)) in Base_Hashtable_1Disc1
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Expiration_Disc_1Disc1 Less than or equal to (Load (Key Duration) of (Key (Picked unit)) from Base_Hashtable_1Disc1)
            • Then - Actions
              • -------- Level of Destructo Disc --------
              • Set Level_1Disc1 = (Load (Key Level) of (Key (Picked unit)) from Base_Hashtable_1Disc1)
              • -------- Destructo Disc --------
              • Set Destructo_Disc_1Disc1 = (Load (Key Disc) of (Key (Picked unit)) in Base_Hashtable_1Disc1)
              • Set Disc_Handle_1Disc1 = (Picked unit)
              • -------- Caster of Destructo Disc --------
              • Set Summoner_1Disc1 = (Load (Key User) of (Key (Picked unit)) in Base_Hashtable_1Disc1)
              • -------- Tree Kill --------
              • Destructible - Pick every destructible within 190.00 of (Position of Destructo_Disc_1Disc1) and do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Or - Any (Conditions) are true
                        • Conditions
                          • (Destructible-type of (Picked destructible)) Equal to Ashenvale Tree Wall
                          • (Destructible-type of (Picked destructible)) Equal to Ashenvale Canopy Tree
                          • (Destructible-type of (Picked destructible)) Equal to Barrens Tree Wall
                          • (Destructible-type of (Picked destructible)) Equal to Barrens Canopy Tree
                          • (Destructible-type of (Picked destructible)) Equal to Black Citadel Tree Wall
                          • (Destructible-type of (Picked destructible)) Equal to Cityscape Fall Tree Wall
                          • (Destructible-type of (Picked destructible)) Equal to Cityscape Snowy Tree Wall
                          • (Destructible-type of (Picked destructible)) Equal to Cityscape Summer Tree Wall
                          • (Destructible-type of (Picked destructible)) Equal to Cityscape Winter Tree Wall
                          • (Destructible-type of (Picked destructible)) Equal to Cityscape Ruined Tree Wall
                          • (Destructible-type of (Picked destructible)) Equal to Dalaran Ruins Tree Wall
                          • (Destructible-type of (Picked destructible)) Equal to Dungeon Tree Wall
                          • (Destructible-type of (Picked destructible)) Equal to Felwood Tree Wall
                          • (Destructible-type of (Picked destructible)) Equal to Felwood Canopy Tree
                          • (Destructible-type of (Picked destructible)) Equal to Icecrown Tree Wall
                          • (Destructible-type of (Picked destructible)) Equal to Icecrown Canopy Tree
                          • (Destructible-type of (Picked destructible)) Equal to Northrend Canopy Tree
                          • (Destructible-type of (Picked destructible)) Equal to Fall Tree Wall
                          • (Destructible-type of (Picked destructible)) Equal to Summer Tree Wall
                          • (Destructible-type of (Picked destructible)) Equal to Snowy Tree Wall
                          • (Destructible-type of (Picked destructible)) Equal to Winter Tree Wall
                          • (Destructible-type of (Picked destructible)) Equal to Snowy Tree Wall
                          • (Destructible-type of (Picked destructible)) Equal to Northrend Tree Wall
                          • (Destructible-type of (Picked destructible)) Equal to Outland Tree Wall
                          • (Destructible-type of (Picked destructible)) Equal to Ruins Tree Wall
                          • (Destructible-type of (Picked destructible)) Equal to Ruins Canopy Tree
                          • (Destructible-type of (Picked destructible)) Equal to Underground Tree Wall
                          • (Destructible-type of (Picked destructible)) Equal to Village Tree Wall
                    • Then - Actions
                      • Destructible - Kill (Picked destructible)
                    • Else - Actions
              • -------- Damage --------
              • -------- Units being hit --------
              • Unit Group - Pick every unit in (Units within 175.00 of (Position of Destructo_Disc_1Disc1) matching ((((Matching unit) is A ground unit) Equal to True) and ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is Magic Immune) Equal to False) and ((((Matching unit) is M and do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Load (Key (Picked unit)) of (Key Disc_Handle_1Disc1) from Base_Hashtable_1Disc1) Less than Max_Hits_1Disc1
                    • Then - Actions
                      • -------- The above condition controls the number of hit per unit. To change just replace the +1 with (<number of hits>+1). --------
                      • -------- Damaged Unit --------
                      • Set Approacher_1Disc1 = (Picked unit)
                      • -------- Dummy Creation --------
                      • Unit - Create 1 Dummy (Attack) for (Owner of Summoner_1Disc1) at (Position of (Picked unit)) facing Default building facing degrees
                      • Set Dummy_Attack_1Disc1 = (Last created unit)
                      • -------- Spell used by the dummy --------
                      • Unit - Order Dummy_Attack_1Disc1 to Human Mountain King - Storm Bolt Approacher_1Disc1
                      • -------- Damage Done --------
                      • Set Disc_Damage_1Disc1 = ((Real((Load (Key Level) of (Key Disc_Handle_1Disc1) from Base_Hashtable_1Disc1))) x 70.00)
                      • Unit - Cause (Load (Key User) of (Key Disc_Handle_1Disc1) in Base_Hashtable_1Disc1) to damage Approacher_1Disc1, dealing Disc_Damage_1Disc1 damage of attack type Spells and damage type Normal
                      • Unit Group - Add Approacher_1Disc1 to Knock_List_1Disc1
                      • -------- Distance/0.01 second during knockback --------
                      • Hashtable - Save 7.00 as (Key Distance_K) of (Key (Picked unit)) in Knock_Hashtable_1Disc1
                      • -------- Total time for knockback --------
                      • Hashtable - Save 1.00 as (Key Time_K) of (Key (Picked unit)) in Knock_Hashtable_1Disc1
                      • -------- Knockback Angle --------
                      • Hashtable - Save (Angle from (Position of Destructo_Disc_1Disc1) to (Position of Approacher_1Disc1)) as (Key Angle_K) of (Key (Picked unit)) in Knock_Hashtable_1Disc1
                      • Unit Group - Add Dummy_Attack_1Disc1 to Clean_Up_1Disc1
                      • Hashtable - Save ((Load (Key (Picked unit)) of (Key Disc_Handle_1Disc1) from Base_Hashtable_1Disc1) + 1) as (Key (Picked unit)) of (Key Disc_Handle_1Disc1) in Base_Hashtable_1Disc1
                    • Else - Actions
            • Else - Actions
              • -------- Clean Up --------
              • Unit - Unpause (Load (Key User) of (Key (Picked unit)) in Base_Hashtable_1Disc1)
              • Unit - Make (Load (Key User) of (Key (Picked unit)) in Base_Hashtable_1Disc1) Vulnerable
              • Unit - Order (Load (Key User) of (Key (Picked unit)) in Base_Hashtable_1Disc1) to Stop
              • Unit - Remove (Load (Key D_Control) of (Key (Picked unit)) in Base_Hashtable_1Disc1) from the game
              • Hashtable - Clear all child hashtables of child (Key (Picked unit)) in Move_Hashtable_1Disc1
              • Hashtable - Clear all child hashtables of child (Key (Picked unit)) in Base_Hashtable_1Disc1
              • Unit Group - Remove (Picked unit) from Destructo_Discs_1Disc1
      • -------- Knock Back --------
      • Unit Group - Pick every unit in Knock_List_1Disc1 and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) has buff Knock Back (Attack)) Equal to True
            • Then - Actions
              • -------- Loading Values...... --------
              • Set Attack_Knock_Distance_1Disc1 = (Load (Key Distance_K) of (Key (Picked unit)) from Knock_Hashtable_1Disc1)
              • Set Attack_Knock_TimeR_1Disc1 = (Load (Key Time_K) of (Key (Picked unit)) from Knock_Hashtable_1Disc1)
              • Set Attack_Knock_Angle_1Disc1 = (Load (Key Angle_K) of (Key (Picked unit)) from Knock_Hashtable_1Disc1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Attack_Knock_TimeR_1Disc1 Greater than 0.00
                • Then - Actions
                  • -------- Knocking Back --------
                  • Unit - Turn collision for (Picked unit) Off
                  • Unit - Move (Picked unit) instantly to ((Position of (Picked unit)) offset by Attack_Knock_Distance_1Disc1 towards Attack_Knock_Angle_1Disc1 degrees)
                  • Hashtable - Save (Attack_Knock_TimeR_1Disc1 - 0.01) as (Key Time_K) of (Key (Picked unit)) in Knock_Hashtable_1Disc1
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Load (Key Time_K) of (Key (Picked unit)) from Knock_Hashtable_1Disc1) Equal to 0.00
                    • Then - Actions
                      • -------- Clean Up --------
                      • Hashtable - Clear all child hashtables of child (Key (Picked unit)) in Knock_Hashtable_1Disc1
                      • Unit - Turn collision for (Picked unit) On
                      • Unit - Order (Picked unit) to Stop
                      • Unit Group - Remove (Picked unit) from Knock_List_1Disc1
                    • Else - Actions
                • Else - Actions
            • Else - Actions
      • -------- Disc Movement --------
      • Unit Group - Pick every unit in Destructo_Discs_1Disc1 and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Load (Key Key_D) of (Key (Picked unit)) from Base_Hashtable_1Disc1) Equal to 0
            • Then - Actions
              • -------- Straight --------
              • Set Disc_Move_Distance_1Disc1 = 6.00
              • Set Disc_Move_Angle_1Disc1 = (Load (Key Angle) of (Key (Picked unit)) from Base_Hashtable_1Disc1)
              • Hashtable - Save Disc_Move_Angle_1Disc1 as (Key Angle) of (Key (Picked unit)) in Base_Hashtable_1Disc1
              • Unit - Turn collision for (Picked unit) Off
              • Unit - Move (Picked unit) instantly to ((Position of (Picked unit)) offset by Disc_Move_Distance_1Disc1 towards Disc_Move_Angle_1Disc1 degrees)
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Load (Key Key_D) of (Key (Picked unit)) from Base_Hashtable_1Disc1) Equal to 1
            • Then - Actions
              • -------- Clockwise --------
              • Set Disc_Move_Distance_1Disc1 = 6.00
              • -------- Time Taken for 1 revolution --------
              • Set Disc_Move_Time_1Disc1 = 3.00
              • Set Disc_Move_Angle_1Disc1 = ((Load (Key Angle) of (Key (Picked unit)) from Base_Hashtable_1Disc1) - (360.00 / (Disc_Move_Time_1Disc1 x 100.00)))
              • Hashtable - Save Disc_Move_Angle_1Disc1 as (Key Angle) of (Key (Picked unit)) in Base_Hashtable_1Disc1
              • Unit - Turn collision for (Picked unit) Off
              • Unit - Move (Picked unit) instantly to ((Position of (Picked unit)) offset by Disc_Move_Distance_1Disc1 towards Disc_Move_Angle_1Disc1 degrees)
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Load (Key Key_D) of (Key (Picked unit)) from Base_Hashtable_1Disc1) Equal to 2
            • Then - Actions
              • -------- Anti-Clockwise --------
              • Set Disc_Move_Distance_1Disc1 = 6.00
              • -------- Time Taken for 1 revolution --------
              • Set Disc_Move_Time_1Disc1 = 3.00
              • Set Disc_Move_Angle_1Disc1 = ((Load (Key Angle) of (Key (Picked unit)) from Base_Hashtable_1Disc1) + (360.00 / (Disc_Move_Time_1Disc1 x 100.00)))
              • Hashtable - Save Disc_Move_Angle_1Disc1 as (Key Angle) of (Key (Picked unit)) in Base_Hashtable_1Disc1
              • Unit - Turn collision for (Picked unit) Off
              • Unit - Move (Picked unit) instantly to ((Position of (Picked unit)) offset by Disc_Move_Distance_1Disc1 towards Disc_Move_Angle_1Disc1 degrees)
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Load (Key Key_D) of (Key (Picked unit)) from Base_Hashtable_1Disc1) Equal to 3
            • Then - Actions
              • -------- Wavy --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Load (Key Half Wave Time) of (Key (Picked unit)) from Base_Hashtable_1Disc1) Less than 150
                • Then - Actions
                  • Set Disc_Move_Distance_1Disc1 = 6.00
                  • Set Disc_Move_Angle_1Disc1 = ((Load (Key Angle) of (Key (Picked unit)) from Base_Hashtable_1Disc1) + 1.20)
                  • Hashtable - Save ((Load (Key Half Wave Time) of (Key (Picked unit)) from Base_Hashtable_1Disc1) + 1) as (Key Half Wave Time) of (Key (Picked unit)) in Base_Hashtable_1Disc1
                  • Hashtable - Save Disc_Move_Angle_1Disc1 as (Key Angle) of (Key (Picked unit)) in Base_Hashtable_1Disc1
                  • Unit - Turn collision for (Picked unit) Off
                  • Unit - Move (Picked unit) instantly to ((Position of (Picked unit)) offset by Disc_Move_Distance_1Disc1 towards Disc_Move_Angle_1Disc1 degrees)
                • Else - Actions
                  • Set Disc_Move_Distance_1Disc1 = 6.00
                  • Set Disc_Move_Angle_1Disc1 = ((Load (Key Angle) of (Key (Picked unit)) from Base_Hashtable_1Disc1) - 1.20)
                  • Hashtable - Save ((Load (Key Half Wave Time) of (Key (Picked unit)) from Base_Hashtable_1Disc1) + 1) as (Key Half Wave Time) of (Key (Picked unit)) in Base_Hashtable_1Disc1
                  • Hashtable - Save Disc_Move_Angle_1Disc1 as (Key Angle) of (Key (Picked unit)) in Base_Hashtable_1Disc1
                  • Unit - Turn collision for (Picked unit) Off
                  • Unit - Move (Picked unit) instantly to ((Position of (Picked unit)) offset by Disc_Move_Distance_1Disc1 towards Disc_Move_Angle_1Disc1 degrees)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Load (Key Half Wave Time) of (Key (Picked unit)) from Base_Hashtable_1Disc1) Equal to 300
                    • Then - Actions
                      • Hashtable - Save 0 as (Key Half Wave Time) of (Key (Picked unit)) in Base_Hashtable_1Disc1
                    • Else - Actions
            • Else - Actions
      • -------- Clean Up --------
      • Unit Group - Pick every unit in Clean_Up_1Disc1 and do (Actions)
        • Loop - Actions
          • Hashtable - Save ((Load (Key Time_Clean_Up) of (Key (Picked unit)) from Base_Hashtable_1Disc1) + 0.01) as (Key Time_Clean_Up) of (Key (Picked unit)) in Base_Hashtable_1Disc1
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Load (Key Time_Clean_Up) of (Key (Picked unit)) from Base_Hashtable_1Disc1) Greater than or equal to 0.05
            • Then - Actions
              • Hashtable - Clear all child hashtables of child (Key (Picked unit)) in Base_Hashtable_1Disc1
              • Unit Group - Remove (Picked unit) from Clean_Up_1Disc1
              • Unit - Kill (Picked unit)
            • Else - Actions
  • Direction Change 1Disc1
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
    • Actions
      • -------- Movement Shift --------
      • Unit Group - Pick every unit in Destructo_Discs_1Disc1 and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Casting unit) Equal to (Load (Key D_Control) of (Key (Picked unit)) in Base_Hashtable_1Disc1)
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Ability being cast) Equal to Straight (Movement)
                • Then - Actions
                  • Hashtable - Save 0 as (Key Key_D) of (Key (Picked unit)) in Base_Hashtable_1Disc1
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Ability being cast) Equal to Clockwise (Movement)
                • Then - Actions
                  • Hashtable - Save 1 as (Key Key_D) of (Key (Picked unit)) in Base_Hashtable_1Disc1
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Ability being cast) Equal to Anti-Clockwise (Movement)
                • Then - Actions
                  • Hashtable - Save 2 as (Key Key_D) of (Key (Picked unit)) in Base_Hashtable_1Disc1
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Ability being cast) Equal to Wave (Movement)
                • Then - Actions
                  • Hashtable - Save 0 as (Key Half Wave Time) of (Key (Picked unit)) in Base_Hashtable_1Disc1
                  • Hashtable - Save ((Load (Key Angle) of (Key (Picked unit)) from Base_Hashtable_1Disc1) - 90.00) as (Key Angle) of (Key (Picked unit)) in Base_Hashtable_1Disc1
                  • Hashtable - Save 3 as (Key Key_D) of (Key (Picked unit)) in Base_Hashtable_1Disc1
                • Else - Actions
            • Else - Actions
114103-bdf0c5754dc696016b62f4e092f15b55.jpg
By
G.One
Previews
Contents

Destructo Disc v1.0 (Map)

Thanks for your submission
There's a number of issues which are rather glaring:
- Store event response values (summoning unit, triggering unit etc.) into temporary variables if you are going to reference them more than twice this also goes for things like picked unit and calculations
- Dummies should be owned by a dummy player, this is so the scorescreen is not interfered with by the ability
- Your tree filtering is very sub-optimal, look at ho some of the approved resources deal with this in order to get an idea of how to do it efficiently
- Your movement controls affect all Destructo Discs including those owned by an opponent
- You have many location leaks
- Knockback can very easily lead to stuck units, we tend to put in some checks and balances to minimize this happening (we make an exception typically if the nature of the ability opposes it)
- Lacks a configuration

I suggest looking at some of the spell tutorials on the site we have if you haven't already - in particular have a look at the "things that leak" or similar threads, as well as looking at how some of the approved resources were made in terms of configuration, efficiency (particularly in the form of code optimization and workarounds for issues such as dummy owners)
 
Top