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

Dark Wave v1.4

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

Dark Wave v1.4

----------------------------------------------------------------------------------
Discription
Caster dash to target location and making near enemy knockback damage.
Knockback Damage: 150/200/250/300
Maximun Distance: 800/900/1000/1100
Manacost: 75
Cooldown 15 seconds
----------------------------------------------------------------------------------
Changelog
v1.0
-First Upload
v1.1
-Trushing variables
-Add requirement
-Little fix
v1.2
-Lot of Fix
v1.3
-Fix ITE actions
v1.4
-Fix Trigger
----------------------------------------------------------------------------------
Credit
-None
----------------------------------------------------------------------------------
Triggers

Dark Wave


    • DW Config
      • Events
        • Map initialization
      • Conditions
      • Actions
        • -------- ----------------------------------- --------
        • Hashtable - Create a hashtable
        • Set Dark_Wave_Hash = (Last created hashtable)
        • -------- ----------------------------------- --------
        • Set Dark_Wave_Ability = Dark Wave
        • -------- ----------------------------------- --------
        • Set Dark_Wave_Speed[1] = 45.00
        • Set Dark_Wave_Speed[2] = 45.00
        • Set Dark_Wave_Speed[3] = 45.00
        • Set Dark_Wave_Speed[4] = 45.00
        • -------- ----------------------------------- --------
        • Set Dark_Wave_Radius_Detect[1] = 150.00
        • Set Dark_Wave_Radius_Detect[2] = 150.00
        • Set Dark_Wave_Radius_Detect[3] = 150.00
        • Set Dark_Wave_Radius_Detect[4] = 150.00
        • -------- ----------------------------------- --------
        • Set Dark_Wave_Effect = Abilities\Spells\Undead\DeathCoil\DeathCoilSpecialArt.mdl
        • -------- ----------------------------------- --------
        • Set Dark_Wave_DestroyTrees = True
        • Set Dark_Wave_Alive = True
        • Set Dark_Wave_Ally = False
        • Set Dark_Wave_Structure = False
        • Set Dark_Wave_Mechanical = False
        • Set Dark_Wave_MagicImmune = False
        • -------- ----------------------------------- --------
        • Set Dark_Wave_Time_Event = 0.03
        • -------- ----------------------------------- --------
        • Trigger - Add to DW Loop <gen> the event (Time - Every Dark_Wave_Time_Event seconds of game time)
        • -------- -------------------------------------------------------------------------------------------------------------------- --------
        • -------- Knockback System --------
        • -------- ----------------------------------- --------
        • Set DWKB_Speed[1] = 12.00
        • Set DWKB_Speed[2] = 12.00
        • Set DWKB_Speed[3] = 12.00
        • Set DWKB_Speed[4] = 12.00
        • -------- ----------------------------------- --------
        • Set DWKB_Distance[1] = 200.00
        • Set DWKB_Distance[2] = 200.00
        • Set DWKB_Distance[3] = 200.00
        • Set DWKB_Distance[4] = 200.00
        • -------- ----------------------------------- --------
        • Set DWKB_Damage[1] = 150.00
        • Set DWKB_Damage[2] = 200.00
        • Set DWKB_Damage[3] = 250.00
        • Set DWKB_Damage[4] = 300.00
        • -------- ----------------------------------- --------
        • Set Knockback_Attack_Type = Spells
        • Set Knockback_Damage_Type = Unknown
        • -------- ----------------------------------- --------
        • Set Knockback_Effect = Abilities\Spells\Undead\DeathCoil\DeathCoilSpecialArt.mdl
        • -------- ----------------------------------- --------
        • Hashtable - Create a hashtable
        • Set Knockback_Hash = (Last created hashtable)
        • -------- ----------------------------------- --------
        • Set Knockback_Time_Event = 0.03
        • -------- ----------------------------------- --------
        • Trigger - Add to DW KB <gen> the event (Time - Every Knockback_Time_Event seconds of game time)
        • -------- -------------------------------------------------------------------------------------------------------------------- --------
        • Custom script: set udg_IsDestructableHarvester = CreateUnit(Player(15), 'hpea', 0, 0, 0)
        • Custom script: call UnitAddAbility(udg_IsDestructableHarvester, 'Aloc')
        • Custom script: call UnitAddAbility(udg_IsDestructableHarvester, 'Ahrl')
        • Unit - Hide IsDestructableHarvester

    • DW Cast
      • Events
        • Unit - A unit Starts the effect of an ability
      • Conditions
        • (Ability being cast) Equal to Dark_Wave_Ability
      • Actions
        • Custom script: local integer h
        • Set Dark_Wave_Caster = (Triggering unit)
        • Set Dark_Wave_TempLoc1 = (Position of Dark_Wave_Caster)
        • Set Dark_Wave_TempLoc2 = (Target point of ability being cast)
        • Set Dark_Wave_Ability_Level = (Level of Dark_Wave_Ability for Dark_Wave_Caster)
        • Set Dark_Wave_Angle = (Angle from Dark_Wave_TempLoc1 to Dark_Wave_TempLoc2)
        • Set Dark_Wave_Distance = (Distance between Dark_Wave_TempLoc1 and Dark_Wave_TempLoc2)
        • Custom script: call RemoveLocation(udg_Dark_Wave_TempLoc1)
        • Custom script: call RemoveLocation(udg_Dark_Wave_TempLoc2)
        • -------- -------------------------------------------------------------------------------------------------------------------- --------
        • Custom script: set h = GetHandleId( udg_Dark_Wave_Caster)
        • Custom script: call SaveReal( udg_Dark_Wave_Hash, h, 0, udg_Dark_Wave_Angle)
        • Custom script: call SaveReal( udg_Dark_Wave_Hash, h, 1, udg_Dark_Wave_Distance)
        • Custom script: call SaveReal( udg_Dark_Wave_Hash, h, 2, udg_Dark_Wave_Speed[udg_Dark_Wave_Ability_Level])
        • Custom script: call SaveReal( udg_Dark_Wave_Hash, h, 3, udg_Dark_Wave_Radius_Detect[udg_Dark_Wave_Ability_Level])
        • -------- -------------------------------------------------------------------------------------------------------------------- --------
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Dark_Wave_CasterG is empty) Equal to True
          • Then - Actions
            • Trigger - Turn on DW Loop <gen>
          • Else - Actions
        • Unit - Turn collision for Dark_Wave_Caster Off
        • Unit Group - Add Dark_Wave_Caster to Dark_Wave_CasterG

    • DW Loop
      • Events
      • Conditions
      • Actions
        • Unit Group - Pick every unit in Dark_Wave_CasterG and do (Actions)
          • Loop - Actions
            • -------- create local variables for move action --------
            • Custom script: local real x
            • Custom script: local real y
            • -------- setting unit --------
            • Set Dark_Wave_Caster = (Picked unit)
            • -------- getting unit handle Id --------
            • Custom script: set udg_Dark_Wave_HandleID = GetHandleId( udg_Dark_Wave_Caster )
            • -------- distance reducer --------
            • Hashtable - Save ((Load 1 of Dark_Wave_HandleID from Dark_Wave_Hash) - (Load 2 of Dark_Wave_HandleID from Dark_Wave_Hash)) as 1 of Dark_Wave_HandleID in Dark_Wave_Hash
            • -------- unit location --------
            • Set Dark_Wave_TempLoc1 = (Position of Dark_Wave_Caster)
            • -------- get unit x --------
            • Custom script: set x = GetUnitX( udg_Dark_Wave_Caster )
            • -------- get unit y --------
            • Custom script: set y = GetUnitY( udg_Dark_Wave_Caster )
            • -------- create ITE --------
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • (Load 1 of Dark_Wave_HandleID from Dark_Wave_Hash) Greater than 0.00
                • (Terrain pathing at Dark_Wave_TempLoc1 of type Walkability is off) Equal to False
              • Then - Actions
                • -------- Move the unit --------
                • Custom script: call SetUnitX(udg_Dark_Wave_Caster, x + LoadReal( udg_Dark_Wave_Hash, udg_Dark_Wave_HandleID, 2 ) * Cos(LoadReal( udg_Dark_Wave_Hash, udg_Dark_Wave_HandleID, 0 ) * bj_DEGTORAD))
                • Custom script: call SetUnitY(udg_Dark_Wave_Caster, y + LoadReal( udg_Dark_Wave_Hash, udg_Dark_Wave_HandleID, 2 ) * Sin(LoadReal( udg_Dark_Wave_Hash, udg_Dark_Wave_HandleID, 0 ) * bj_DEGTORAD))
                • -------- create effect --------
                • Custom script: call DestroyEffect(AddSpecialEffect(udg_Dark_Wave_Effect, x, y))
                • -------- tree destroyer --------
                • Destructible - Pick every destructible within (Load 3 of Dark_Wave_HandleID from Dark_Wave_Hash) of Dark_Wave_TempLoc1 and do (Actions)
                  • Loop - Actions
                    • -------- get pick tree --------
                    • Set IsDestructableTree = (Picked destructible)
                    • -------- create ITE --------
                    • Custom script: if IssueTargetOrderById(udg_IsDestructableHarvester,852018,udg_IsDestructableTree) and IssueImmediateOrderById(udg_IsDestructableHarvester,851972) and GetWidgetLife(udg_IsDestructableTree) > 0.405 then
                    • -------- then if true kill the tree --------
                    • Destructible - Kill IsDestructableTree
                    • Custom script: else
                    • Custom script: endif
                • -------- create unit group variable --------
                • Set Dark_Wave_Search_Target = (Units within (Load 3 of Dark_Wave_HandleID from Dark_Wave_Hash) of Dark_Wave_TempLoc1)
                • -------- set the created group in action unit group --------
                • Unit Group - Pick every unit in Dark_Wave_Search_Target and do (Actions)
                  • Loop - Actions
                    • -------- get the pick unit --------
                    • Set Dark_Wave_Knockback_Unit = (Picked unit)
                    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                      • If - Conditions
                        • (Dark_Wave_Knockback_Unit is alive) Equal to Dark_Wave_Alive
                        • (Dark_Wave_Knockback_Unit is A structure) Equal to Dark_Wave_Structure
                        • (Dark_Wave_Knockback_Unit is Mechanical) Equal to Dark_Wave_Mechanical
                        • (Dark_Wave_Knockback_Unit is Magic Immune) Equal to Dark_Wave_MagicImmune
                        • (Dark_Wave_Knockback_Unit belongs to an ally of (Owner of Dark_Wave_Caster)) Equal to Dark_Wave_Ally
                        • (Dark_Wave_Knockback_Unit is in Knockback_Group) Equal to False
                        • Dark_Wave_Knockback_Unit Not equal to Dark_Wave_Caster
                      • Then - Actions
                        • -------- get location of picked unit --------
                        • Set Dark_Wave_TempLoc3 = (Position of Dark_Wave_Knockback_Unit)
                        • -------- get the level of ability of main unit --------
                        • -------- Dark_Wave_Caster is the main unit --------
                        • Set Dark_Wave_Ability_Level = (Level of Dark_Wave_Ability for Dark_Wave_Caster)
                        • -------- get handle id of pick unit --------
                        • -------- Dark_Wave_Knockback_Unit is the pick unit --------
                        • Custom script: set udg_Knockback_HandleId = GetHandleId( udg_Dark_Wave_Knockback_Unit)
                        • -------- saving damage of knockback --------
                        • Hashtable - Save DWKB_Damage[Dark_Wave_Ability_Level] as 0 of Knockback_HandleId in Knockback_Hash
                        • -------- saving distance --------
                        • Hashtable - Save DWKB_Distance[Dark_Wave_Ability_Level] as 1 of Knockback_HandleId in Knockback_Hash
                        • -------- saving speed --------
                        • Hashtable - Save DWKB_Speed[Dark_Wave_Ability_Level] as 2 of Knockback_HandleId in Knockback_Hash
                        • -------- saving angle --------
                        • Hashtable - Save (Angle from Dark_Wave_TempLoc1 to Dark_Wave_TempLoc3) as 3 of Knockback_HandleId in Knockback_Hash
                        • Hashtable - Save Handle OfDark_Wave_Caster as 4 of Knockback_HandleId in Knockback_Hash
                        • -------- saving main unit --------
                        • -------- I save the main unit to damage the pick unit --------
                        • -------- Create ITE for Turning on the DW KB trigger --------
                        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                          • If - Conditions
                            • (Knockback_Group is empty) Equal to True
                          • Then - Actions
                            • -------- if the condition is true then turn on --------
                            • Trigger - Turn on DW KB <gen>
                          • Else - Actions
                        • -------- turning off collision of pick unit --------
                        • Unit - Turn collision for Dark_Wave_Knockback_Unit Off
                        • -------- then add pick unit in group so that pick unit will not repeat it all ^^ --------
                        • Unit Group - Add Dark_Wave_Knockback_Unit to Knockback_Group
                        • -------- remove leak --------
                        • Custom script: call RemoveLocation(udg_Dark_Wave_TempLoc3)
                      • Else - Actions
                • -------- remove leak --------
                • Custom script: call RemoveLocation(udg_Dark_Wave_TempLoc1)
              • Else - Actions
                • -------- remove leak --------
                • Custom script: call RemoveLocation(udg_Dark_Wave_TempLoc1)
                • -------- turning on collision of main unit --------
                • Unit - Turn collision for Dark_Wave_Caster On
                • -------- remove main unit in this group --------
                • Unit Group - Remove Dark_Wave_Caster from Dark_Wave_CasterG
                • -------- remove all child key of main unit in Dark_Wave_Hash --------
                • Hashtable - Clear all child hashtables of child Dark_Wave_HandleID in Dark_Wave_Hash
                • -------- create ITE --------
                • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • (Dark_Wave_CasterG is empty) Equal to True
                  • Then - Actions
                    • -------- if coindtion is true the turn of this trigger --------
                    • Trigger - Turn off (This trigger)
                  • Else - Actions
                • -------- END --------


    • DW KB
      • Events
      • Conditions
      • Actions
        • Unit Group - Pick every unit in Knockback_Group and do (Actions)
          • Loop - Actions
            • -------- create local variables --------
            • Custom script: local real kbx
            • Custom script: local real kby
            • -------- get main unit --------
            • Set Knockback_Unit = (Picked unit)
            • -------- get main unit's X and Y --------
            • Custom script: set kbx = GetUnitX( udg_Knockback_Unit )
            • Custom script: set kby = GetUnitY( udg_Knockback_Unit )
            • -------- get main unit's location --------
            • Set Knockback_TempLoc1 = (Position of Knockback_Unit)
            • -------- get main unit's ID --------
            • Custom script: set udg_Knockback_HandleId = GetHandleId( udg_Knockback_Unit)
            • -------- distance reducer --------
            • Hashtable - Save ((Load 1 of Knockback_HandleId from Knockback_Hash) - (Load 2 of Knockback_HandleId from Knockback_Hash)) as 1 of Knockback_HandleId in Knockback_Hash
            • -------- create ITE for ending --------
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • (Load 1 of Knockback_HandleId from Knockback_Hash) Greater than 0.00
                • (Terrain pathing at Knockback_TempLoc1 of type Walkability is off) Equal to False
              • Then - Actions
                • -------- move the main unit by using X and Y --------
                • Custom script: call SetUnitX(udg_Knockback_Unit, kbx + LoadReal(udg_Knockback_Hash, udg_Knockback_HandleId, 2 ) * Cos(LoadReal( udg_Knockback_Hash, udg_Knockback_HandleId, 3 ) * bj_DEGTORAD))
                • Custom script: call SetUnitY(udg_Knockback_Unit, kby + LoadReal(udg_Knockback_Hash, udg_Knockback_HandleId, 2 ) * Sin(LoadReal( udg_Knockback_Hash, udg_Knockback_HandleId, 3 ) * bj_DEGTORAD))
                • -------- craete special effect --------
                • Custom script: call DestroyEffect(AddSpecialEffect(udg_Knockback_Effect, kbx, kby))
              • Else - Actions
                • -------- remove leak --------
                • Custom script: call RemoveLocation( udg_Knockback_TempLoc1 )
                • -------- damage the main unit --------
                • Unit - Cause (Load 4 of Knockback_HandleId in Knockback_Hash) to damage Knockback_Unit, dealing (Load 0 of Knockback_HandleId from Knockback_Hash) damage of attack type Knockback_Attack_Type and damage type Knockback_Damage_Type
                • -------- turn on collision of main unit --------
                • Unit - Turn collision for Knockback_Unit On
                • -------- remove main unit in this group --------
                • Unit Group - Remove Knockback_Unit from Knockback_Group
                • -------- remove all child key of main unit in Knockback_Hash --------
                • Hashtable - Clear all child hashtables of child Knockback_HandleId in Knockback_Hash
                • -------- create ITE --------
                • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • (Knockback_Group is empty) Equal to True
                  • Then - Actions
                    • -------- if condition is true then turn this trigger off --------
                    • Trigger - Turn off (This trigger)
                  • Else - Actions
            • -------- remove leak --------
            • Custom script: call RemoveLocation( udg_Knockback_TempLoc1 )

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


Keywords:
Dark, Water, Wave
Contents

Just another Warcraft III map (Map)

Reviews
18:03, 30th Jan 2015 Maker: The spell is a nice variant of a charge spell. The effects are good but triggering could be improved a bit. Not using move unit instantly action could give you more flexibility and fluidity. Also consider using Channel...

Moderator

M

Moderator

18:03, 30th Jan 2015
Maker: The spell is a nice variant of a charge spell.
The effects are good but triggering could be improved a bit.
Not using move unit instantly action could give you more flexibility
and fluidity. Also consider using Channel as the base ability in the future.
 

Kazeon

Hosted Project: EC
Level 33
Joined
Oct 12, 2011
Messages
3,449
  • You don't need variable for these triggers
    • Set Dark_Wave_Triggers[1] = DW Cast <gen>
    • Set Dark_Wave_Triggers[2] = DW Loop <gen>
  • These are not necessary to be done
    • Then - Actions
      • Custom script: set h = 0
      • Custom script: set udg_Dark_Wave_Ability_Level = 0
      • Custom script: set udg_Dark_Wave_Angle = 0.00
      • Custom script: set udg_Dark_Wave_Distance = 0.00
  • This is not mandatory but using dynamic indexing is better. Consider this:
    • Hashtable - Save ((Load 1 of Dark_Wave_HandleID from Dark_Wave_Hash) - (Load 2 of Dark_Wave_HandleID from Dark_Wave_Hash)) as 1 of Dark_Wave_HandleID in Dark_Wave_Hash
    vs
    • set Distance[index] = Distance[index] - Speed[index]
  • Try to load things only for once. This is one example:
    • Unit - Move Dark_Wave_Caster instantly to Dark_Wave_TempLoc2, facing (Load 0 of Dark_Wave_HandleID from Dark_Wave_Hash) degrees
    You have already loaded 0 (angle) from hashtable here:
    • Set Dark_Wave_TempLoc2 = (Dark_Wave_TempLoc1 offset by (Load 2 of Dark_Wave_HandleID from Dark_Wave_Hash) towards (Load 0 of Dark_Wave_HandleID from Dark_Wave_Hash) degrees)
    Try to avoid those.
  • "Harvester" and "Tree" are way too generic for variable name and "KB" is too generic for a trigger name. Change those.
  • You don't use TempLoc3 if the condition isn't met.
    • Unit Group - Pick every unit in Dark_Wave_Search_Target and do (Actions)
      • Loop - Actions
        • Set Dark_Wave_Knockback_Unit = (Picked unit)
        • Set Dark_Wave_TempLoc3 = (Position of Dark_Wave_Knockback_Unit)
        • ...
        • Custom script: call RemoveLocation(udg_Dark_Wave_TempLoc3)
  • I think the damage better be done when caster collide with targets, not after they are KB'ed.
  • You forgot to remove this group leak:
    • Set Dark_Wave_Search_Target = (Units within (Load 3 of Dark_Wave_HandleID from Dark_Wave_Hash) of Dark_Wave_TempLoc1)
  • You don't need to remove TempLoc3 here:
    • Else - Actions
      • Unit - Turn collision for Dark_Wave_Caster On
      • Custom script: call RemoveLocation(udg_Dark_Wave_TempLoc1)
      • Custom script: call RemoveLocation(udg_Dark_Wave_TempLoc2)
      • Custom script: call RemoveLocation(udg_Dark_Wave_TempLoc3)
      • Unit Group - Remove Dark_Wave_Caster from Dark_Wave_CasterG
    And you can move
    • Custom script: call RemoveLocation(udg_Dark_Wave_TempLoc1)
    • Custom script: call RemoveLocation(udg_Dark_Wave_TempLoc2)
    after the ITE (if then else) block and remove the same actions inside the "Then - action" block.
Those are minor improvements aside from those variable & trigger names problem and a single unit group leak. And I didn't see any problem with Object Editor data.
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
  • Unit group is empty -> trigger is off
  • You remove the locations in THEN and ELSE. Take them out of the IF/THEN/ELSE
  • Remove the else custom script, there is no code to execute there
  • Flying units?
  • No need for knockback location variables, use the dark wave location variables
  • No need to set variables to 0 in the cast trigger

EDIT: Just noticed Dalvengyr's post. Fix those issues :)
 
Top