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

Sand Dive v1.0

This bundle is marked as useful / simple. Simplicity is bliss, low effort and/or may contain minor bugs.
Spell Description
He plunges into the earth and swims across to the targeted unit with ease, he is invulnerable while diving and have a speed of 1.5x his current speed. Once he arrived to the targeted unit, he will rise from below and pushes the earth to cause violent shudder and creates spikes around him covering 600 AOE. If he does not arrive at the targeted unit in time, he will lose focus due to the sand damaging his vision making him to stop the dive and stunned himself for 1 second.

Level 1 750 max range | 50 damage stun
Level 2 1000 max range | 100 damage stun
Level 3 1250 max range | 150 damage stun
Level 4 1500 max range | 200 damage stun
TRIGGERS
  • SD Setup
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set BaseRangeSD = 500.00
      • Set RangePerLevelSD = 250.00
      • -------- At level 1, the max range is 750 (500 + (250 * Level)) and so on --------
      • Set SpeedMultiplierSD = 1.50
      • -------- The caster will move 1.5 * his current speed per second --------
      • Set IntervalPerEventSD = 0.03
      • -------- This is to formulate the formula for speed --------
      • Set AoE_SD = 50.00
      • -------- This is for when caster is around the target unit, kinda like AOE detection --------
      • Set MaxSpikeSD = 8
      • -------- 8 spike covering 360 degrees for each spike angle at 45 degrees to each other --------
      • Set SpikeAngleSD = (360.00 / (Real(MaxSpikeSD)))
      • -------- Sets the ability of Sand Dive --------
      • Set SandDiveAbility = Sand Dive
      • -------- Sets the ability for dummy to impale the units --------
      • Set ImpaleAbility = Impale Dummy
      • -------- Creates a hashtable for a spell to be MUI --------
      • Hashtable - Create a hashtable
      • Set HashtableSD = (Last created hashtable)
      • -------- The SFX for the dusty effect --------
      • Set SFX_SD[1] = Objects\Spawnmodels\Undead\ImpaleTargetDust\ImpaleTargetDust.mdl
      • -------- Final effect when the caster submerge --------
      • Set SFX_SD[2] = Abilities\Spells\Other\Volcano\VolcanoDeath.mdl
      • -------- Sets the dummy unit --------
      • Set DummySD = Dummy
  • SD Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to SandDiveAbility
    • Actions
      • Set CasterSD = (Triggering unit)
      • Set AbilityLevelSD = (Level of SandDiveAbility for CasterSD)
      • Set RangeSD = (BaseRangeSD + (RangePerLevelSD x (Real(AbilityLevelSD))))
      • Set CurrentSpeedSD = (Current movement speed of CasterSD)
      • Set SandSpeedSD = (CurrentSpeedSD x SpeedMultiplierSD)
      • Set SpeedPerIntervalSD = (SandSpeedSD x IntervalPerEventSD)
      • Set TargetSD = (Target unit of ability being cast)
      • Custom script: set udg_HandleID_SD = GetHandleId(udg_CasterSD)
      • Hashtable - Save RangeSD as (Key RangeSD) of HandleID_SD in HashtableSD
      • Hashtable - Save SpeedPerIntervalSD as (Key SpeedPerIntervalSD) of HandleID_SD in HashtableSD
      • Hashtable - Save Handle OfTargetSD as (Key TargetSD) of HandleID_SD in HashtableSD
      • Unit Group - Add CasterSD to CasterGroupSD
      • Unit - Hide CasterSD
      • Trigger - Turn on SD Loop <gen>
  • SD Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (CasterGroupSD is empty) Equal to True
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions
          • Unit Group - Pick every unit in CasterGroupSD and do (Actions)
            • Loop - Actions
              • Set CasterSD = (Picked unit)
              • Set Point[1] = (Position of CasterSD)
              • Custom script: set udg_HandleID_SD = GetHandleId(udg_CasterSD)
              • Set TargetSD = (Load (Key TargetSD) of HandleID_SD in HashtableSD)
              • Custom script: set bj_wantDestroyGroup = true
              • Unit Group - Pick every unit in (Units within AoE_SD of Point[1]) and do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Picked unit) Equal to TargetSD
                    • Then - Actions
                      • Unit - Unhide CasterSD
                      • Special Effect - Create a special effect at Point[1] using SFX_SD[2]
                      • Special Effect - Destroy (Last created special effect)
                      • Animation - Play CasterSD's morph alternate animation
                      • Selection - Select CasterSD for (Owner of CasterSD)
                      • Unit - Order CasterSD to Attack TargetSD
                      • Hashtable - Clear all child hashtables of child HandleID_SD in HashtableSD
                      • Unit Group - Remove CasterSD from CasterGroupSD
                      • For each (Integer LoopingIntegerSD) from 1 to MaxSpikeSD, do (Actions)
                        • Loop - Actions
                          • Unit - Create 1 DummySD for (Owner of CasterSD) at Point[1] facing ((Facing of CasterSD) + ((Real(LoopingIntegerSD)) x SpikeAngleSD)) degrees
                          • Unit - Add a 0.50 second Generic expiration timer to (Last created unit)
                          • Unit - Set level of ImpaleAbility for (Last created unit) to (Level of SandDiveAbility for CasterSD)
                          • Set Point[4] = (Point[1] offset by 200.00 towards (Facing of (Last created unit)) degrees)
                          • Unit - Order (Last created unit) to Undead Crypt Lord - Impale Point[4]
                          • Custom script: call RemoveLocation(udg_Point[4])
                      • Set CasterSD = No unit
                    • Else - Actions
              • Set RangeSD = (Load (Key RangeSD) of HandleID_SD from HashtableSD)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (TargetSD is alive) Equal to True
                  • RangeSD Greater than 0.00
                • Then - Actions
                  • Set SpeedPerIntervalSD = (Load (Key SpeedPerIntervalSD) of HandleID_SD from HashtableSD)
                  • Set Point[2] = (Position of TargetSD)
                  • Set AngleSD = (Angle from Point[1] to Point[2])
                  • Set Point[3] = (Point[1] offset by SpeedPerIntervalSD towards AngleSD degrees)
                  • Special Effect - Create a special effect at Point[1] using SFX_SD[1]
                  • Special Effect - Destroy (Last created special effect)
                  • Custom script: call SetUnitX(udg_CasterSD, GetLocationX(udg_Point[3]))
                  • Custom script: call SetUnitY(udg_CasterSD, GetLocationY(udg_Point[3]))
                  • Hashtable - Save (RangeSD - SpeedPerIntervalSD) as (Key RangeSD) of HandleID_SD in HashtableSD
                  • Custom script: call RemoveLocation(udg_Point[2])
                  • Custom script: call RemoveLocation(udg_Point[3])
                • Else - Actions
                  • Unit - Unhide CasterSD
                  • Animation - Play CasterSD's morph alternate animation
                  • Selection - Select CasterSD for (Owner of CasterSD)
                  • Unit - Order CasterSD to Attack TargetSD
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • RangeSD Less than or equal to 0.00
                    • Then - Actions
                      • Unit - Create 1 DummySD for (Owner of CasterSD) at Point[1] facing Default building facing degrees
                      • Unit - Add a 0.50 second Generic expiration timer to (Last created unit)
                      • Unit - Order (Last created unit) to Human Mountain King - Storm Bolt CasterSD
                    • Else - Actions
                  • Hashtable - Clear all child hashtables of child HandleID_SD in HashtableSD
                  • Unit Group - Remove CasterSD from CasterGroupSD
              • Custom script: call RemoveLocation(udg_Point[1])
CHANGELOGS
v1.0
- Initial release
Keywords:
defskull, sand, dive, sand dive, sand king, crixalis, spike, stun, GUI, hashtable
Contents

Just another Warcraft III map (Map)

Reviews
12th Dec 2015 IcemanBo: Too long as NeedsFix. Rejected. Moderator: Pharaoh_ Date: 05:41, 8th Apr 2012 Instead of enumerating nearby units, until you find the main target, you could check distance between your caster and the target...

Moderator

M

Moderator

12th Dec 2015
IcemanBo: Too long as NeedsFix. Rejected.

160036-albums4747-picture55861.png

Moderator: Pharaoh_
Date: 05:41, 8th Apr 2012

Review
Instead of enumerating nearby units, until you find the main target, you could check distance between your caster and the target.

morph alternate string is an animation specifically used for this model. You may want to add a comment above that action.

The array for 4 instances of a location variable is not needed; simply use four different variables.

  • Set CasterSD = No unit
This is not needed.

Store the impaling dummy in a variable, before repeatedly referencing to it.

  • Selection - Select CasterSD for (Owner of CasterSD)
Prefer Add CasterSD to (Owner of CasterSD) selection; this will allow the player to retain the selection of every unit, before he commands their hero to cast this skill.

There are certain cases, where hidden units can still acquire targets and normally attack them. Add Cargo Hold (Burrow) when you hide the caster and remove it on impact -make sure you don't null the caster, as you currently do, otherwise it won't work-.

  • RangeSD Less than or equal to 0.00
This is not needed, the "Else" branch should automatically realize that it should switch the actions from the "Then" branch. Retain the Unit is alive condition and in the "Then" branch check the range; if it's higher than 0, subtract X, else, stun the caster.
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
The array for 4 instances of a location variable is not needed; simply use four different variables.
Is this heavily demanded for the spell to be approved ?
I mean, won't it be mass use of variable compared to index ?
Creating 4 variables, seems... inefficient

Set CasterSD = No unit
This is not needed.
If I remove this line, even if my Caster reaches the target and proceed with the stun, my Caster will be stunned
How do I prevent that ?

RangeSD Less than or equal to 0.00
This is not needed, the "Else" branch should automatically realize that it should switch the actions from the "Then" branch. Retain the Unit is alive condition and in the "Then" branch check the range; if it's higher than 0, subtract X, else, stun the caster.
This is to check if the Target is dead, then it stops the Caster and submerging it without stunning it
If I remove those condition in the Else action, even if the Target is dead (the spell is stopped abruptly because the Target simply died), the Caster will still be stunned
I want the Caster to not be stunned if the spell ended while the Target dies
If I remove this condition of part of the spell, then you are are correct, I should not add more conditions to it
But it seems I want the it the Caster will not be stunned if the Target is dead, then the condition branch should stay the same don't you think ?

NOTE: You can test this by using the triggers in that map in the Initialization folder

To all other matter, I will fix it, thanks for the review :)
 
Last edited:
Arrays are always created with 8100++ indexes, the number you set at the variable editor is just the indexes that will be given the value or initialized (like for a unit group array, it is the indexes that will be given a default group using CreateGroup()), and all other indexes from there up to 8190 I think is the max, will be either null, 0, false or whatever,

now tell me if making 4 variables is more efficient than initializing thousands of indexes...

As for the spell itself, well I thought it was some kinda burrow strike... but no, it works really different... I would like to say I like the idea of this spell... :)
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
Arrays are always created with 8100++ indexes, the number you set at the variable editor is just the indexes that will be given the value or initialized (like for a unit group array, it is the indexes that will be given a default group using CreateGroup()), and all other indexes from there up to 8190 I think is the max, will be either null, 0, false or whatever,

now tell me if making 4 variables is more efficient than initializing thousands of indexes...
Thanks for enlightening me :)

As for the spell itself, well I thought it was some kinda burrow strike... but no, it works really different... I would like to say I like the idea of this spell... :)
Err perhaps I should change the screenshot wouldn't it ? Haha
 
Maybe you could add more enemies and then use this on the middle enemy, but it would look like tidehunter's ravage then... The screenshot is pretty fitting as it is since that is exactly what the spell does...

just fix/improve the other parts and this will be good to go... and I hope to see more like this from you... :)
 
Top