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

Command Earth v1.0

  • Like
Reactions: Losam
This spell is for my entry, The Legendary 2012 Event, my opponent is Marsal, and our theme is "Global Spell".

Calls upon the spirit of the earth to send a disturbance throughout the map that will cause enemy units to be tossed in the air by the violent tremor of the earth. Upon tossed (for both landing and flying), the unit will receive damage, both has the same damage. Upon landing, there is a chance that the earth spirit will consume the unit and kill it instantly. If the unit survive from the spirit, it will be further knockbacked. At the end of the knockback, the unit will be entangled by the earth spirit.

[Level 1] - Quake lasts 5 seconds, 700 tremor AOE, 100 damage impact, 5% chance to consume unit.
[Level 2] - Quake lasts 6 seconds, 800 tremor AOE, 150 damage impact, 10% chance to consume unit.
[Level 3] - Quake lasts 7 seconds, 900 tremor AOE, 200 damage impact, 15% chance to consume unit.
[Level 4] - Quake lasts 8 seconds, 1000 tremor AOE, 250 damage impact, 20% chance to consume unit.


  • CE Setup
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Custom script: set udg_CE_Hashtable = InitHashtable()
      • -------- DATA CONFIGURABLES --------
      • -------- ---------- --------
      • -------- X-AXIS CONFIGURABLES --------
      • -------- The formula is: Base + (LevelPerData * AbilityLevel) --------
      • -------- CE_BaseSpeedX is for Horizontal Acceleration (Base) --------
      • -------- CE_SpeedPerLevelX sets the Horizontal Acceleration per level --------
      • -------- CE_BaseDurationX is how long you stay on the land after landing from toss (Base) --------
      • -------- CE_DurationPerLevelX is how long you stay on the land after landing from toss per level --------
      • Set CE_BaseSpeedX = 500.00
      • Set CE_BaseDurationX = 0.00
      • Set CE_SpeedPerLevelX = 0.00
      • Set CE_DurationPerLevelX = 1.00
      • -------- Remember for formula ? --------
      • -------- The formula is: Base + (LevelPerData * AbilityLevel) --------
      • -------- Assume my unit has Level 1 Command Earth --------
      • -------- CE_SpeedX = BaseSpeedX + (SpeedPerLevelX * AbilityLevel) --------
      • -------- CE_SpeedX = 500 + (0 * 1) = 500 --------
      • -------- Since my SpeedPerLevelX is set to 0, it would be a constant horizontal speed of 500 per second --------
      • -------- Now, how long do you want the spell to be crossing the land (horizontal) ? --------
      • -------- CE_DurationX = 0 + (1 * 1) = 1 --------
      • -------- The tossed unit will travel through the horizontal axis for 1 second at Level 1, what about Level 2 ? Figure it out ;p --------
      • -------- Summation at Level 1: --------
      • -------- Tossed unit will move 500 MS horizontally while flying --------
      • -------- Right after it touches the ground, it will stop in 1 second --------
      • -------- X-AXIS CONFIGURABLES --------
      • -------- ---------- --------
      • -------- Y-AXIS CONFIGURABLES --------
      • -------- CE_BaseSpeedY sets the BASE speed in Vertical --------
      • -------- CE_BaseDurationY sets the BASE time for it to fall back to the ground --------
      • -------- CE_BaseSpeedY sets the speed per level in Vertical --------
      • -------- CE_BaseDurationY sets the time per level for it to fall back to the ground --------
      • Set CE_BaseSpeedY = 600.00
      • Set CE_BaseDurationY = 0.50
      • Set CE_SpeedPerLevelY = 100.00
      • Set CE_DurationPerLevelY = 0.50
      • -------- CURRENT SETUP AT LEVEL 1 WOULD BE: --------
      • -------- CE_SpeedY = 700 --------
      • -------- CE_DurationY = 1 --------
      • -------- Y-AXIS CONFIGURABLES --------
      • -------- ---------- --------
      • -------- SPELL CONFIGURABLES --------
      • -------- Same formula applies, Base + (DataPerLevel * AbilityLevel) --------
      • -------- The Duration sets how long the Quake is done by the Caster --------
      • Set CE_BaseDuration = 4.00
      • Set CE_DurationPerLevel = 1.00
      • -------- The AOE sets how big the AOE for the Quake to catch units into --------
      • Set CE_BaseAOE = 600.00
      • Set CE_AOE_PerLevel = 100.00
      • -------- The ImpactDamage would be the damage done to the tossed unit (both landing and newly tossed) --------
      • Set CE_BaseImpactDamage = 50.00
      • Set CE_ImpactDamagePerLevel = 50.00
      • -------- EarthKill would be the percentage for the earth spirit to consume the unit that lands after tossed --------
      • Set CE_BaseEarthKill = 0
      • Set CE_EarthKillPerLevel = 5
      • -------- QuakeInterval sets the interval per Quake, I suggest it would be nice to keep it above 0.20 --------
      • Set CE_QuakeInterval = 0.25
      • -------- SPELL CONFIGURABLES --------
      • -------- ---------- --------
      • -------- MISC CONFIGURABLES --------
      • -------- This is for SFX when the unit is tossed to the air --------
      • Set CE_ImpactFlyPathSFX = Abilities\Spells\Other\Volcano\VolcanoDeath.mdl
      • -------- This is for SFX when the unit lands --------
      • Set CE_ImpactLandPathSFX = Abilities\Spells\Orc\WarStomp\WarStompCaster.mdl
      • -------- This is for SFX when the unit is knockbacked --------
      • Set CE_DragPathSFX = Abilities\Spells\Human\FlakCannons\FlakTarget.mdl
      • -------- This is for SFX when the unit is entangled --------
      • Set CE_EntanglePathSFX = Abilities\Spells\NightElf\EntangleMine\Roots.mdl
      • -------- This is for SFX when the unit is killed by the earth spirit --------
      • Set CE_EarthKillPathSFX = Abilities\Spells\Items\AIso\AIsoTarget.mdl
      • -------- Self-explanatory --------
      • Set CE_AttackType = Spells
      • Set CE_DamageType = Normal
      • -------- Remember, if you want to use it in your map, make sure you copy first all Object Editors' data (Units/Abilities/Buffs/Effects) to your map and paste it --------
      • -------- Make sure for that buff, you change it in Object Editor too, because it uses Raw ID of a buff, well my buff is 'B000', I don't know yours --------
      • -------- After that, set it accordingly to each Unit ID (your map and my map can have different IDs, that's why you should set it back once pasted) --------
      • Set CE_BuffEntangle = Entangle
      • Set CommandEarth = Command Earth
      • Set CE_Entangle = Entangle (Command Earth)
      • Set CE_DummyType = Dummy (Command Earth)
      • -------- MISC CONFIGURABLES --------
      • -------- ---------- --------
      • Custom script: set udg_CE_DummyID = udg_CE_DummyType
      • Custom script: set udg_CE_Dummy = CreateUnit(Player(13), udg_CE_DummyID, 0.00, 0.00, 0.00)
      • -------- END OF CONFIGURABLES --------
      • -------- Do not touch if you don't know what you're doing --------
      • -------- This is to fix the error of calculating time travel by Y-axis, because it takes (2 * TimeToGetToMaxHeight) to fall back on ground --------
      • Set CE_BaseDurationY = (CE_BaseDurationY / 2.00)
      • Set CE_DurationPerLevelY = (CE_DurationPerLevelY / 2.00)
      • Set CE_MinimumFlyHeight = 10.00
      • Set CE_JumpInterval = 0.03
      • Set CE_MapBoundaryAdjustment = 50.00
      • -------- DO NOT TOUCH --------
      • Set TempReal = (CE_MinimumFlyHeight x 33.00)
      • Set TempReal2 = (CE_BaseSpeedY + CE_SpeedPerLevelY)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • TempReal2 Less than TempReal
        • Then - Actions
          • Game - Display to (All players) the text: (|cffffcc00WARNING: You have to change either CE_SpeedY or CE_SpeedPerLevelY or both, so that the summation of those two to will become greater than + ((String(TempReal)) + |r))
          • Game - Display to (All players) the text: (|cffffcc00Current Summation: + (String(TempReal2)))
          • Game - Display to (All players) the text: You cannot make the...
        • Else - Actions
      • Trigger - Add to CE Quake Loop <gen> the event (Time - Every CE_QuakeInterval seconds of game time)
      • Trigger - Add to CE Jump Loop <gen> the event (Time - Every CE_JumpInterval seconds of game time)
  • CE Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to CommandEarth
    • Actions
      • Set TempUnit = (Triggering unit)
      • Custom script: set udg_CE_Key = GetHandleId(udg_TempUnit)
      • Set TempInteger = (Level of CommandEarth for TempUnit)
      • Set CE_EarthKill = (CE_BaseEarthKill + (CE_EarthKillPerLevel x TempInteger))
      • Set CE_SpeedX = (CE_BaseSpeedX + (CE_SpeedPerLevelX x (Real(TempInteger))))
      • Set CE_SpeedY = (CE_BaseSpeedY + (CE_SpeedPerLevelY x (Real(TempInteger))))
      • Set CE_Duration = (CE_BaseDuration + (CE_DurationPerLevel x (Real(TempInteger))))
      • Set CE_AOE = (CE_BaseAOE + (CE_AOE_PerLevel x (Real(TempInteger))))
      • Set CE_ImpactDamage = (CE_BaseImpactDamage + (CE_ImpactDamagePerLevel x (Real(TempInteger))))
      • Set CE_DurationX = (CE_BaseDurationX + (CE_DurationPerLevelX x (Real(TempInteger))))
      • Set CE_DurationY = (CE_BaseDurationY + (CE_DurationPerLevelY x (Real(TempInteger))))
      • Set CE_SpeedReductionX = (CE_SpeedX / CE_DurationX)
      • Set CE_SpeedReductionY = (CE_SpeedY / CE_DurationY)
      • Set CE_SpeedPerIntervalX = (CE_SpeedX x CE_JumpInterval)
      • Set CE_SpeedPerIntervalY = (CE_SpeedY x CE_JumpInterval)
      • Set CE_SpeedReductionPerIntervalX = (CE_SpeedReductionX x CE_JumpInterval)
      • Set CE_SpeedReductionPerIntervalX = (CE_SpeedReductionPerIntervalX x CE_JumpInterval)
      • Set CE_SpeedReductionPerIntervalY = (CE_SpeedReductionY x CE_JumpInterval)
      • Set CE_SpeedReductionPerIntervalY = (CE_SpeedReductionPerIntervalY x CE_JumpInterval)
      • Unit Group - Add TempUnit to CE_CasterGroup
      • Hashtable - Save CE_SpeedPerIntervalX as 0 of CE_Key in CE_Hashtable
      • Hashtable - Save CE_Duration as 2 of CE_Key in CE_Hashtable
      • Hashtable - Save CE_SpeedReductionPerIntervalX as 3 of CE_Key in CE_Hashtable
      • Hashtable - Save CE_ImpactDamage as 4 of CE_Key in CE_Hashtable
      • Hashtable - Save CE_AOE as 5 of CE_Key in CE_Hashtable
      • Hashtable - Save CE_SpeedPerIntervalY as 7 of CE_Key in CE_Hashtable
      • Hashtable - Save CE_SpeedReductionPerIntervalY as 8 of CE_Key in CE_Hashtable
      • Hashtable - Save TempInteger as 10 of CE_Key in CE_Hashtable
      • Hashtable - Save CE_EarthKill as 14 of CE_Key in CE_Hashtable
      • Trigger - Turn on CE Quake Loop <gen>
  • CE Quake Loop
    • Events
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (CE_CasterGroup is empty) Equal to True
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions
          • Unit Group - Pick every unit in CE_CasterGroup and do (Actions)
            • Loop - Actions
              • Set CE_Caster = (Picked unit)
              • Custom script: set udg_CE_Key = GetHandleId(udg_CE_Caster)
              • Set CE_Duration = (Load 2 of CE_Key from CE_Hashtable)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (CE_Caster is alive) Equal to True
                  • CE_Duration Greater than 0.00
                • Then - Actions
                  • Hashtable - Save (CE_Duration - CE_QuakeInterval) as 2 of CE_Key in CE_Hashtable
                  • For each (Integer LoopingInteger) from 1 to 1, do (Actions)
                    • Loop - Actions
                      • Set TempLoc = (Random point in (Playable map area))
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Terrain pathing at TempLoc of type Walkability is off) Equal to True
                        • Then - Actions
                          • Set LoopingInteger = (LoopingInteger - 1)
                        • Else - Actions
                          • Set CE_SpeedPerIntervalX = (Load 0 of CE_Key from CE_Hashtable)
                          • Set CE_SpeedPerIntervalY = (Load 7 of CE_Key from CE_Hashtable)
                          • Set CE_SpeedReductionPerIntervalY = (Load 8 of CE_Key from CE_Hashtable)
                          • Set CE_SpeedReductionPerIntervalX = (Load 3 of CE_Key from CE_Hashtable)
                          • Set CE_AOE = (Load 5 of CE_Key from CE_Hashtable)
                          • Set CE_ImpactDamage = (Load 4 of CE_Key from CE_Hashtable)
                          • Set CE_AbilityLevel = (Load 10 of CE_Key from CE_Hashtable)
                          • Set CE_EarthKill = (Load 14 of CE_Key from CE_Hashtable)
                          • Environment - Create a 0.50 second Normal ripple deformation at TempLoc with starting radius CE_AOE, ending radius CE_AOE, and depth 128.00, using 1.00 second ripples spaced 512.00 apart
                          • Custom script: set bj_wantDestroyGroup = true
                          • Unit Group - Pick every unit in (Units within CE_AOE of TempLoc matching (((((Matching unit) is A structure) Equal to False) and (((Matching unit) has buff CE_BuffEntangle) Equal to False)) and ((((Matching unit) is A ground unit) Equal to True) and ((((Matching unit) is Magic Immune) Equal and do (Actions)
                            • Loop - Actions
                              • Custom script: local real x
                              • Custom script: local real y
                              • Set TempUnit = (Picked unit)
                              • Custom script: set udg_CE_Key = GetHandleId(udg_TempUnit)
                              • Set CE_IsFlying = (Load 1 of CE_Key from CE_Hashtable)
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • CE_IsFlying Equal to False
                                • Then - Actions
                                  • Set CE_Angle = (Random angle)
                                  • Set CE_IsFlying = True
                                  • Set CE_IsImpactLand = False
                                  • Set CE_IsEntangle = False
                                  • Set TempReal = (Current flying height of TempUnit)
                                  • Set TempLoc = (Position of TempUnit)
                                  • Unit - Turn collision for TempUnit Off
                                  • Unit - Cause CE_Caster to damage TempUnit, dealing CE_ImpactDamage damage of attack type CE_AttackType and damage type CE_DamageType
                                  • Custom script: if UnitAddAbility(udg_TempUnit, 'Amrf') then
                                  • Custom script: call UnitRemoveAbility(udg_TempUnit, 'Amrf')
                                  • Custom script: endif
                                  • Unit Group - Add TempUnit to CE_JumpGroup
                                  • Unit - Order TempUnit to Stop
                                  • Hashtable - Save CE_SpeedPerIntervalX as 0 of CE_Key in CE_Hashtable
                                  • Hashtable - Save CE_SpeedPerIntervalY as 7 of CE_Key in CE_Hashtable
                                  • Hashtable - Save CE_SpeedReductionPerIntervalY as 8 of CE_Key in CE_Hashtable
                                  • Hashtable - Save CE_SpeedReductionPerIntervalX as 3 of CE_Key in CE_Hashtable
                                  • Hashtable - Save CE_Angle as 6 of CE_Key in CE_Hashtable
                                  • Hashtable - Save CE_IsFlying as 1 of CE_Key in CE_Hashtable
                                  • Hashtable - Save CE_IsEntangle as 11 of CE_Key in CE_Hashtable
                                  • Hashtable - Save CE_IsImpactLand as 12 of CE_Key in CE_Hashtable
                                  • Hashtable - Save CE_AbilityLevel as 10 of CE_Key in CE_Hashtable
                                  • Hashtable - Save CE_ImpactDamage as 4 of CE_Key in CE_Hashtable
                                  • Hashtable - Save Handle OfCE_Caster as 13 of CE_Key in CE_Hashtable
                                  • Hashtable - Save CE_EarthKill as 14 of CE_Key in CE_Hashtable
                                  • Animation - Change TempUnit flying height to (TempReal + CE_SpeedPerIntervalY) at 0.00
                                  • Hashtable - Save (CE_SpeedPerIntervalY - CE_SpeedReductionPerIntervalY) as 7 of CE_Key in CE_Hashtable
                                  • Special Effect - Create a special effect at TempLoc using CE_ImpactFlyPathSFX
                                  • Special Effect - Destroy (Last created special effect)
                                  • Set TempLoc2 = (TempLoc offset by CE_SpeedPerIntervalX towards CE_Angle degrees)
                                  • Custom script: set x = GetUnitX(udg_TempUnit)
                                  • Custom script: set y = GetUnitY(udg_TempUnit)
                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    • If - Conditions
                                      • ((Playable map area) contains TempLoc2) Equal to True
                                      • (Terrain pathing at TempLoc2 of type Walkability is off) Equal to False
                                    • Then - Actions
                                      • Custom script: call SetUnitX(udg_TempUnit, x + udg_CE_SpeedPerIntervalX * Cos(udg_CE_Angle * bj_DEGTORAD))
                                      • Custom script: call SetUnitY(udg_TempUnit, y + udg_CE_SpeedPerIntervalX * Sin(udg_CE_Angle * bj_DEGTORAD))
                                    • Else - Actions
                                      • Custom script: call SetUnitX(udg_TempUnit, x)
                                      • Custom script: call SetUnitY(udg_TempUnit, y)
                                  • Custom script: call RemoveLocation(udg_TempLoc)
                                  • Custom script: call RemoveLocation(udg_TempLoc2)
                                • Else - Actions
                          • Trigger - Turn on CE Jump Loop <gen>
                      • Custom script: call RemoveLocation(udg_TempLoc)
                • Else - Actions
                  • Unit Group - Remove CE_Caster from CE_CasterGroup
                  • Hashtable - Clear all child hashtables of child CE_Key in CE_Hashtable
  • CE Jump Loop
    • Events
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (CE_JumpGroup is empty) Equal to True
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions
          • Unit Group - Pick every unit in CE_JumpGroup and do (Actions)
            • Loop - Actions
              • Custom script: local real x
              • Custom script: local real y
              • Set TempUnit = (Picked unit)
              • Unit - Order TempUnit to Stop
              • Custom script: set udg_CE_Key = GetHandleId(udg_TempUnit)
              • Set CE_IsEntangle = (Load 11 of CE_Key from CE_Hashtable)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • CE_IsEntangle Equal to True
                • Then - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (TempUnit has buff CE_BuffEntangle) Equal to True
                      • (TempUnit is alive) Equal to True
                    • Then - Actions
                    • Else - Actions
                      • Set CE_EntangleSFX = (Load 9 of CE_Key in CE_Hashtable)
                      • Special Effect - Destroy CE_EntangleSFX
                      • Unit Group - Remove TempUnit from CE_JumpGroup
                      • Hashtable - Clear all child hashtables of child CE_Key in CE_Hashtable
                • Else - Actions
                  • Set CE_SpeedPerIntervalX = (Load 0 of CE_Key from CE_Hashtable)
                  • Set CE_SpeedReductionPerIntervalX = (Load 3 of CE_Key from CE_Hashtable)
                  • Set CE_Angle = (Load 6 of CE_Key from CE_Hashtable)
                  • Set CE_AbilityLevel = (Load 10 of CE_Key from CE_Hashtable)
                  • Set TempLoc = (Position of TempUnit)
                  • Set TempReal = (Current flying height of TempUnit)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • TempReal Less than or equal to CE_MinimumFlyHeight
                    • Then - Actions
                      • Set CE_IsFlying = False
                      • Hashtable - Save CE_IsFlying as 1 of CE_Key in CE_Hashtable
                      • Animation - Change TempUnit flying height to 0.00 at 0.00
                      • Unit - Turn collision for TempUnit On
                      • Hashtable - Save (CE_SpeedPerIntervalX - CE_SpeedReductionPerIntervalX) as 0 of CE_Key in CE_Hashtable
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • CE_SpeedPerIntervalX Less than or equal to 0.00
                        • Then - Actions
                          • Special Effect - Create a special effect attached to the origin of TempUnit using CE_EntanglePathSFX
                          • Set CE_EntangleSFX = (Last created special effect)
                          • Hashtable - Save Handle OfCE_EntangleSFX as 9 of CE_Key in CE_Hashtable
                          • Unit - Move CE_Dummy instantly to TempLoc
                          • Unit - Set level of CE_Entangle for CE_Dummy to CE_AbilityLevel
                          • Unit - Order CE_Dummy to Night Elf Keeper Of The Grove - Entangling Roots TempUnit
                          • Hashtable - Save True as 11 of CE_Key in CE_Hashtable
                        • Else - Actions
                      • Special Effect - Create a special effect attached to the origin of TempUnit using CE_DragPathSFX
                      • Special Effect - Destroy (Last created special effect)
                      • Set CE_IsImpactLand = (Load 12 of CE_Key from CE_Hashtable)
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • CE_IsImpactLand Equal to False
                        • Then - Actions
                          • Set CE_Caster = (Load 13 of CE_Key in CE_Hashtable)
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (TempUnit is A Hero) Equal to True
                            • Then - Actions
                              • Set CE_IsImpactLand = True
                              • Set CE_ImpactDamage = (Load 4 of CE_Key from CE_Hashtable)
                              • Unit - Cause CE_Caster to damage TempUnit, dealing CE_ImpactDamage damage of attack type CE_AttackType and damage type CE_DamageType
                              • Special Effect - Create a special effect attached to the origin of TempUnit using CE_ImpactLandPathSFX
                              • Special Effect - Destroy (Last created special effect)
                              • Hashtable - Save CE_IsImpactLand as 12 of CE_Key in CE_Hashtable
                            • Else - Actions
                              • Set CE_EarthKill = (Load 14 of CE_Key from CE_Hashtable)
                              • Set TempInteger = (Random integer number between 1 and 100)
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • TempInteger Less than or equal to CE_EarthKill
                                • Then - Actions
                                  • Unit - Cause CE_Caster to damage TempUnit, dealing 1000000000.00 damage of attack type Chaos and damage type Unknown
                                  • Special Effect - Create a special effect attached to the origin of TempUnit using CE_ImpactFlyPathSFX
                                  • Special Effect - Destroy (Last created special effect)
                                  • Special Effect - Create a special effect attached to the origin of TempUnit using CE_EarthKillPathSFX
                                  • Special Effect - Destroy (Last created special effect)
                                • Else - Actions
                                  • Set CE_IsImpactLand = True
                                  • Set CE_ImpactDamage = (Load 4 of CE_Key from CE_Hashtable)
                                  • Unit - Cause CE_Caster to damage TempUnit, dealing CE_ImpactDamage damage of attack type CE_AttackType and damage type CE_DamageType
                                  • Special Effect - Create a special effect attached to the origin of TempUnit using CE_ImpactLandPathSFX
                                  • Special Effect - Destroy (Last created special effect)
                                  • Hashtable - Save CE_IsImpactLand as 12 of CE_Key in CE_Hashtable
                        • Else - Actions
                    • Else - Actions
                      • Set CE_SpeedPerIntervalY = (Load 7 of CE_Key from CE_Hashtable)
                      • Set CE_SpeedReductionPerIntervalY = (Load 8 of CE_Key from CE_Hashtable)
                      • Set TempReal = (Current flying height of TempUnit)
                      • Animation - Change TempUnit flying height to (TempReal + CE_SpeedPerIntervalY) at 0.00
                      • Hashtable - Save (CE_SpeedPerIntervalY - CE_SpeedReductionPerIntervalY) as 7 of CE_Key in CE_Hashtable
                  • Set TempLoc2 = (TempLoc offset by (CE_SpeedPerIntervalX + CE_MapBoundaryAdjustment) towards CE_Angle degrees)
                  • Custom script: set x = GetUnitX(udg_TempUnit)
                  • Custom script: set y = GetUnitY(udg_TempUnit)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • ((Playable map area) contains TempLoc2) Equal to True
                      • (Terrain pathing at TempLoc2 of type Walkability is off) Equal to False
                    • Then - Actions
                      • Custom script: call SetUnitX(udg_TempUnit, x + udg_CE_SpeedPerIntervalX * Cos(udg_CE_Angle * bj_DEGTORAD))
                      • Custom script: call SetUnitY(udg_TempUnit, y + udg_CE_SpeedPerIntervalX * Sin(udg_CE_Angle * bj_DEGTORAD))
                    • Else - Actions
                      • Custom script: call SetUnitX(udg_TempUnit, x)
                      • Custom script: call SetUnitY(udg_TempUnit, y)
                      • Set CE_IsFlying = (Load 1 of CE_Key from CE_Hashtable)
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • CE_IsFlying Equal to True
                        • Then - Actions
                        • Else - Actions
                          • Special Effect - Create a special effect attached to the origin of TempUnit using CE_EntanglePathSFX
                          • Set CE_EntangleSFX = (Last created special effect)
                          • Hashtable - Save Handle OfCE_EntangleSFX as 9 of CE_Key in CE_Hashtable
                          • Unit - Move CE_Dummy instantly to TempLoc
                          • Unit - Set level of CE_Entangle for CE_Dummy to CE_AbilityLevel
                          • Unit - Order CE_Dummy to Night Elf Keeper Of The Grove - Entangling Roots TempUnit
                          • Hashtable - Save True as 11 of CE_Key in CE_Hashtable
                  • Custom script: call RemoveLocation(udg_TempLoc)
                  • Custom script: call RemoveLocation(udg_TempLoc2)
v1.0
- Initial release


-


Keywords:
command, earth, nature, stone, knockback, fly, y-axis, x-axis, physics, land, toss, defskull, the, legendary, event, 2012, global, spell.
Contents

Just another Warcraft III map (Map)

Reviews
10:40, 3rd Aug 2012 Magtheridon96: Nananananananananananananananana Approved. Here's a fundamental rule for Warcraft III. When you have a variable holding a value that doesn't leak, if it is only being referenced once, you don't need it. You...

Moderator

M

Moderator

10:40, 3rd Aug 2012
Magtheridon96:
defskull said:
Awww come on, where's Mag :(

Nananananananananananananananana Approved.

Here's a fundamental rule for Warcraft III.
When you have a variable holding a value that doesn't leak, if it is only being referenced once, you don't need it. You can use it's value directly.

You can use this to shorten your code a bit in this resource. ;)
 
Be patient, eitherway from the way you're doing this I so, so strongly believe you should be using dynamic indexing, this whole code would be many times shorter if you did, on the cast trigger you could save a lot of the values directly into the hashtable to save a bit of processing instead of setting all those variables, all use one or two (depending on amount of types) array variables to store all of them in get rid of the redundant ones, using it as a cache.

Though I will say I don't see the need for two loops, since both running at the same time is half as efficient as them both being in the same, and one of them running at a time is almost the same, since if one was empty then you could skip the actions by putting them in the else section and it'd be just generally more efficient, While I understand that the delay will be different, might I suggest a MUI wait delay method to be applied? wouldn't be very difficult and would cater to both needs within the same trigger.
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
Always with the indexing, you're discriminating Hashtable user :/

About the loops, well I used 2 loops to handle 2 Unit Group, you suggest that I should merge those 2 Pick Unit Group Action in one trigger ?
And create an artificial wait either to one of the interval ?
And the trigger should be turned off when both Unit Group are empty ?

If I use your method, imagine how long the code would be ;p
Deal with it, there are pros and cons.
Also, to my eyes, the processing is fast enough.

Also, stop discriminating Hashtable.
You're like saying that Hashtable has no place for Spells..... and Systems.
 
Always with the indexing, you're discriminating Hashtable user :/

I constantly say it because your method of doing these things is always half-way there. I personally used hashtables all the time up to the last two spells I used myself, so I can't exactly discriminate against my own method.

defskull said:
About the loops, well I used 2 loops to handle 2 Unit Group, you suggest that I should merge those 2 Pick Unit Group Action in one trigger ?
And create an artificial wait either to one of the interval ?
And the trigger should be turned off when both Unit Group are empty ?

Yes because it would be more efficient and result in fewer triggers as well.

defskull said:
If I use your method, imagine how long the code would be ;p
Deal with it, there are pros and cons.
Also, to my eyes, the processing is fast enough.

Still shorter than most of my spells XD
Also, what are the pros? I personally can't think of any
For the record, though, how fast the processing is - what's good enough is up to the moderator who reviews it.

Anyway I'm not /attempting/ to discriminate at all, and do not think hashtables have no place, but rather think you're good enough to not since it'd cut off roughly 20+ lines of your code due to the way you're doing it, which actually bar having arrayed variables is almost there

On another note which I think got a bit left behind: As I said - since you set things into variables initially instead of directly to your hashtables, it's actually half as efficient (not literally but you get the idea) since it uses twice as many lines to do the same thing, which is why I say it's close to dyanmic indexing since if you just made those variables arrays and indexed them, you'd be done, - My point on using caches instead of a lot of different variables also got left behind, which is the typical method of using variables when loading from a hashtable, since there's not much point having individually named variables to load from each hashtable instead of having one or two arrayed variables able to store all the values.
 
@Tank-Commander, this could be faster by a ton, but here at THW, we can accept spells that use the group enumeration method.

Personally, I always use dynamic indexing for my spells and arrays only because it's the most efficient and cleanest way to write a spell, but if I made my personal standards a requirement on this site, the only resources that would be approved are some of yours that use dynamic indexing, mine, Nestharus' resources, iAyanami's resources, Bribe's, and a couple more.

I don't want to be oppressive :C
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
When you have a variable holding a value that doesn't leak, if it is only being referenced once, you don't need it. You can use it's value directly.
I don't get this one, can you give me a short trigger about this ? (doesn't have to be from my trigger)

the only resources that would be approved are some of yours that use dynamic indexing, mine, Nestharus' resources, iAyanami's resources, Bribe's...
Ouch.
 
Level 25
Joined
Jun 5, 2008
Messages
2,572
Also, stop discriminating Hashtable.
No he isn't, it's a common fact indexing was and is better in almost all situations.
There are situations where hashtables help but they are rare and most of the time indexing does it better.

I did tell you to try to remove the deformation :>

PS: Mag, My only left GUI resource uses dynamic indexing also :p
 
It's the same situation whenever you have a variable only being referenced once.

There are other instances in which you are using a variable and referencing it only once.

For example:

  • Special Effect - Create a special effect attached to the origin of TempUnit using CE_EntanglePathSFX
  • Set CE_EntangleSFX = (Last created special effect)
  • Hashtable - Save Handle OfCE_EntangleSFX as 9 of CE_Key in CE_Hashtable
 
Top