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

Rolling Boulder v1.4

  • Like
Reactions: Ras and Almia
The caster releases a living boulder, the boulder increases its size for every 0.03 milliseconds, when the boulder encounters a living enemy unit, the unit will be damage and stuns for 2 seconds. |n|n|cffffcc00Level 1|r - 130 damage. |n|cffffcc00Level 2|r - 260 damage. |n|cffffcc00Level 3|r - 390 damage. |n|cffffcc00Level 4|r - 420 damage.

  • Configuration Trigger
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- -------------- --------
      • -------- Configurations --------
      • -------- -------------- --------
      • -------- Sets the Animation Speed --------
      • -------- -------------- --------
      • Set BoulderAnimSpeed = 200.00
      • -------- -------------- --------
      • -------- Set the Damages[1,2,3,4] --------
      • -------- -------------- --------
      • Set BoulderDamageHit[1] = 130.00
      • Set BoulderDamageHit[2] = 260.00
      • Set BoulderDamageHit[3] = 390.00
      • Set BoulderDamageHit[4] = 420.00
      • -------- -------------- --------
      • -------- Special Effect String --------
      • -------- -------------- --------
      • Set BoulderSFX = Abilities\Spells\Orc\WarStomp\WarStompCaster.mdl
      • -------- -------------- --------
      • -------- Sets the Boulder's Radius and the Boulder Hit --------
      • -------- -------------- --------
      • Set BoulderHit = 100.00
      • Set AoE[1] = 350.00
      • Set AoE[2] = 400.00
      • Set AoE[3] = 450.00
      • Set AoE[4] = 500.00
  • Boulder Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Boulder Roll
    • Actions
      • -------- -------------- --------
      • -------- VIS-(Very Important Sytem) Starts --------
      • -------- -------------- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • IndexSize Equal to 0
        • Then - Actions
          • Trigger - Turn on Boulder Loop <gen>
        • Else - Actions
      • -------- -------------- --------
      • -------- Increases the Index Size --------
      • -------- -------------- --------
      • Set IndexSize = (IndexSize + 1)
      • -------- -------------- --------
      • -------- DI-(Dynamic Index) Starts --------
      • -------- -------------- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • IndexSize Greater than IndexMaxSize
        • Then - Actions
          • Set Index[IndexSize] = IndexSize
          • Set IndexMaxSize = IndexSize
        • Else - Actions
      • -------- -------------- --------
      • -------- DI-(Dynamic Index) Ends --------
      • -------- -------------- --------
      • -------- VIS-(Very Important System) Ends --------
      • -------- -------------- --------
      • Set TempInt = Index[IndexSize]
      • -------- -------------- --------
      • -------- Settin' Up Arrays --------
      • -------- -------------- --------
      • Set TempLoc = (Position of (Triggering unit))
      • Set TempLoc2 = (Target point of ability being cast)
      • Set Caster[TempInt] = (Triggering unit)
      • -------- -------------- --------
      • -------- Creating the Boulder Unit --------
      • -------- -------------- --------
      • Unit - Create 1 Boulder for (Owner of Caster[TempInt]) at TempLoc facing (Angle from TempLoc to TempLoc2) degrees
      • Set Boulder[TempInt] = (Last created unit)
      • Unit - Move (Last created unit) instantly to TempLoc
      • Set Angle[TempInt] = (Angle from TempLoc to TempLoc2)
      • -------- -------------- --------
      • -------- Sets the Boulder's Animation Speed --------
      • -------- -------------- --------
      • Animation - Change Boulder[TempInt]'s animation speed to BoulderAnimSpeed% of its original speed
      • -------- -------------- --------
      • -------- Determines the Boulder's Speed and the Boulder's Duration --------
      • -------- -------------- --------
      • Set BoulderSpeed[TempInt] = 50.00
      • Set BoulderDuration[TempInt] = 10.00
      • -------- -------------- --------
      • -------- Removing Leaks --------
      • -------- -------------- --------
      • Custom script: call RemoveLocation(udg_TempLoc)
      • Custom script: call RemoveLocation(udg_TempLoc2)
  • Boulder Loop
    • Events
      • Time - Every 0.08 seconds of game time
    • Conditions
    • Actions
      • For each (Integer Loop) from 1 to IndexSize, do (Actions)
        • Loop - Actions
          • -------- -------------- --------
          • -------- This let look everything cleaner. --------
          • -------- -------------- --------
          • Set TempInt = Index[Loop]
          • -------- -------------- --------
          • -------- Increase the size of the Boulder --------
          • -------- -------------- --------
          • Set BoulderSize[TempInt] = (BoulderSize[TempInt] + 25.00)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • BoulderDuration[TempInt] Greater than 0.00
            • Then - Actions
              • -------- -------------- --------
              • -------- Move Out --------
              • -------- -------------- --------
              • Set TempLoc = (Position of Boulder[TempInt])
              • Set TempLoc2 = (TempLoc offset by BoulderSpeed[TempInt] towards Angle[TempInt] degrees)
              • Unit - Move Boulder[TempInt] instantly to TempLoc2, facing Angle[TempInt] degrees
              • -------- -------------- --------
              • -------- Size per 0.03 Seconds --------
              • -------- -------------- --------
              • Animation - Change Boulder[TempInt]'s size to (BoulderSize[TempInt]%, 0.00%, 0.00%) of its original size
              • -------- -------------- --------
              • -------- Attaching Special Effects on Boulder --------
              • -------- -------------- --------
              • Special Effect - Create a special effect at TempLoc using BoulderSFX
              • Set BoulderEffect = (Last created special effect)
              • Special Effect - Destroy BoulderEffect
              • Unit - Create 1 Dummy (Caster) for (Owner of Caster[TempInt]) at TempLoc2 facing Default building facing degrees
              • Set Stunner[TempInt] = (Last created unit)
              • Unit - Add a 1.00 second Generic expiration timer to Stunner[TempInt]
              • Unit - Add Stun to Stunner[TempInt]
              • Custom script: set bj_wantDestroyGroup=true
              • Unit Group - Pick every unit in (Units within BoulderHit of TempLoc2) and do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • ((Picked unit) is alive) Equal to True
                    • Then - Actions
                      • -------- -------------- --------
                      • -------- This Group is for Damaging --------
                      • -------- -------------- --------
                      • -------- The AoE Damage Increases in every Level of the Ability[Rolling Boulder] --------
                      • -------- -------------- --------
                      • Unit Group - Pick every unit in (Units within AoE[(Level of Boulder Roll for Caster[TempInt])] of TempLoc) and do (Actions)
                        • Loop - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • And - All (Conditions) are true
                                • Conditions
                                  • (((Picked unit) is alive) Equal to True) and ((Owner of (Picked unit)) Not equal to (Owner of Caster[TempInt]))
                            • Then - Actions
                              • -------- -------------- --------
                              • -------- Stuns and Damages --------
                              • -------- -------------- --------
                              • Unit - Order Stunner[TempInt] to Orc Tauren Chieftain - War Stomp
                              • Unit - Cause Caster[TempInt] to damage (Picked unit), dealing BoulderDamageHit[(Level of Boulder Roll for Caster[TempInt])] damage of attack type Spells and damage type Normal
                              • Set BoulderDuration[TempInt] = 0.00
                            • Else - Actions
                    • Else - Actions
              • Set BoulderDuration[TempInt] = (BoulderDuration[TempInt] - 0.30)
              • -------- -------------- --------
              • -------- Clearing Leaks again --------
              • -------- -------------- --------
              • Custom script: call RemoveLocation(udg_TempLoc)
              • Custom script: call RemoveLocation(udg_TempLoc2)
            • Else - Actions
              • -------- -------------- --------
              • -------- Explode on death --------
              • -------- -------------- --------
              • Unit - Order Stunner[TempInt] to Orc Tauren Chieftain - War Stomp
              • -------- -------------- --------
              • -------- Destroying Necessary Handles --------
              • -------- -------------- --------
              • Unit - Remove Boulder[TempInt] from the game
              • -------- -------------- --------
              • -------- Again VIS-(Very Important System) Starts --------
              • -------- -------------- --------
              • -------- Recycling Index Array --------
              • -------- -------------- --------
              • Set Index[Loop] = Index[IndexSize]
              • Set Index[IndexSize] = TempInt
              • Set IndexSize = (IndexSize - 1)
              • Set Loop = (Loop - 1)
              • Set BoulderSize[TempInt] = 0.00
              • -------- -------------- --------
              • -------- this trigger ends here --------
              • -------- -------------- --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • IndexSize Equal to 0
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                  • Skip remaining actions
                • Else - Actions
              • -------- VIS-(Very Important System) Ends --------
  • Removing Dummy Leaks
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Dying unit) Equal to Stunner[TempInt]
    • Actions
      • Unit - Remove Stunner[TempInt] from the game


v1.1 - Added expiration timer for dummy

v1.2 - Added a new Trigger on configuration trigger
-Removed Special Effect Bug [Thanks to David]

v1.3 - Removed dummy Leaks

v1.4 - Changed the name of the Configuration Variables, Smooth Animation, and decreased the Boulder's size per second.


Keywords:
Boulder, Roll, Hero, Size, doomhammer99, Indexing, Dynamic Index, with Configuration Trigger
Contents

Just another Warcraft III map (Map)

Reviews
19:57, 12th Oct 2012 Magtheridon96: Approved. Tips: - Special Effect - Create a special effect at TempLoc using BoulderSFX Set BoulderEffect = (Last created special effect) Special Effect - Destroy BoulderEffect You can simply destroy the last...

Moderator

M

Moderator

19:57, 12th Oct 2012
Magtheridon96: Approved.

Tips:
-
  • Special Effect - Create a special effect at TempLoc using BoulderSFX
  • Set BoulderEffect = (Last created special effect)
  • Special Effect - Destroy BoulderEffect
You can simply destroy the last created special effect without storing it into a variable.

- You can cache the picked unit into a variable inside the group enumeration loop instead of repeating the call more than once.
 
I'd suggest using Co-ordinates for moving the boulder - it generates a lot less lag (try casting a tonne of this spell at one time, or assume there are other spells in the map using the same function), is more efficient and could make things a lot smoother,as for "growth rate" being too fast as far as other people are saying, prehaps, use divide it by 2 or something? though 0.03 seconds loop would make it more smooth, in theory.

In eithercase here's the functions for using Co-ordinates if you want them:
  • Custom script: call SetUnitX()
  • Custom script: call SetUnitY()
You can either use the GetLocationX() and Y for your new location or calculate the new location mathematically i.e.

  • Custom script: call SetUnitX(Unit, GetUnitX(Unit) + Distance * Cos(Angle * bj_DEGTORAD))
  • Custom script: call SetUnitY(Unit, GetUnitY(Unit) + Distance * Sin(Angle * bj_DEGTORAD))
Note the Sine and Cosine for that

Hope this helps
 
Top