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

Shadow Rush v0.2

first spell :)

Description:
Scar create a shadow that will dash to target unit,dealing damage if shadow close to target unit also Scar will blink to it.Scar cannot hitted if the shadow is not close to target unit.

how to import
Copy Evasion (Dummy),Shadow rush ability and Shadows unit to your map
then copy Shadow trigger folder to your map make sure you check, Automatically create unknown variables while pasting trigger data
if its unchecked check it at File>Preferences>Automatically create unknown variables while pasting trigger data

afterr all is copyed setting the SD_Shadow = Shadows, SD_EvasionDummy = Evasion (Dummy) and SD_Ability = Shadow Rush, its placed at Configuration Trigger

[trigger=Configuration]Configuration
Events
Map initialization
Conditions
Actions
-------- Set Shadow Rush Ability --------
Set SD_Ability = Shadow Rush
-------- Set Evasion Dummy ability --------
Set SD_EvasionDummy = Evasion (Dummy)
-------- Set Shadows unit --------
Set SD_Shadow = Shadows
-------- distance if a shadow close to the target it will explode] --------
Set SD_Distance = 20.00
-------- shadow running speed --------
Set SD_Speed = 900.00
-------- Set the damage here --------
Set SD_Damage[1] = 300.00
Set SD_Damage[2] = 450.00
Set SD_Damage[3] = 650.00
-------- Attack type and Damage Type --------
Set SD_DamageType = Death
Set SD_AttackType = Spells
-------- Animation and Animation speed for shadow --------
Set SD_Animation = walk
Set SD_AnimSpeed = 200.00
-------- the distance over which the shadow will be created --------
Set SD_Offset = 500.00
-------- Degrees where shadow created --------
-------- Maximum value is 360 --------
Set SD_Degrees = (Random real number between 0.00 and 360.00)
-------- Minimum value is 0 --------
-------- Special effect when casting and when blink --------
Set SD_SFX1 = Abilities\Spells\Undead\DeathCoil\DeathCoilSpecialArt.mdl
Set SD_SFX2 = Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl

[/trigger]
[trigger=Execute]Execute
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to SD_Ability
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
SD_IndexSize Equal to 0
Then - Actions
Trigger - Turn on S Loop <gen>
Else - Actions
Set SD_IndexSize = (SD_IndexSize + 1)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
SD_IndexSize Greater than SD_MaxIndexSize
Then - Actions
Set SD_Index[SD_IndexSize] = SD_IndexSize
Set SD_MaxIndexSize = SD_IndexSize
Else - Actions
Set SD_TempInt = SD_Index[SD_IndexSize]
-------- store the caster to variable --------
Set SD_Caster[SD_TempInt] = (Triggering unit)
-------- store the target to variable --------
Set SD_Target[SD_TempInt] = (Target unit of ability being cast)
-------- setting the position --------
Set SD_Loc[1] = (Position of SD_Caster[SD_TempInt])
Set SD_Loc[2] = (Position of SD_Target[SD_TempInt])
-------- this is where the shadow is created --------
Set SD_Loc[3] = (SD_Loc[2] offset by SD_Offset towards SD_Degrees degrees)
-------- create the shadow --------
Unit - Create 1 SD_Shadow for (Owner of SD_Caster[SD_TempInt]) at SD_Loc[3] facing SD_Loc[2]
-------- store the shadow to variable --------
Set SD_Shadows[SD_TempInt] = (Last created unit)
Set SD_Loc[4] = (Position of SD_Shadows[SD_TempInt])
-------- play shadow walk animation --------
Animation - Play SD_Shadows[SD_TempInt]'s SD_Animation animation
Animation - Change SD_Shadows[SD_TempInt]'s animation speed to SD_AnimSpeed% of its original speed
-------- create SFX at shadow and destroy it for removing leak --------
Special Effect - Create a special effect at SD_Loc[4] using SD_SFX2
Special Effect - Destroy (Last created special effect)
-------- store the level of ability to variable --------
Set SD_LOA[SD_TempInt] = (Level of SD_Ability for SD_Caster[SD_TempInt])
-------- add evasion to caster --------
Unit - Add SD_EvasionDummy to SD_Caster[SD_TempInt]
-------- removing point --------
Custom script: call RemoveLocation (udg_SD_Loc[1])
Custom script: call RemoveLocation (udg_SD_Loc[2])
Custom script: call RemoveLocation (udg_SD_Loc[3])
Custom script: call RemoveLocation (udg_SD_Loc[4])

[/trigger]
[trigger=Loop]S Loop
Events
Time - Every 0.03 seconds of game time
Conditions
Actions
For each (Integer SD_Looper) from 1 to SD_IndexSize, do (Actions)
Loop - Actions
Set SD_TempInt = SD_Index[SD_Looper]
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(SD_Target[SD_TempInt] is alive) Equal to True
Then - Actions
Set SD_Loc[1] = (Position of SD_Shadows[SD_TempInt])
Set SD_Loc[2] = (Position of SD_Target[SD_TempInt])
-------- If distance between shadow and target greater than SD_Distance it will move toward target --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Distance between SD_Loc[1] and SD_Loc[2]) Greater than SD_Distance
Then - Actions
Set SD_Angle[SD_TempInt] = (Angle from SD_Loc[1] to SD_Loc[2])
Set SD_Loc[3] = (SD_Loc[1] offset by (0.03 x SD_Speed) towards SD_Angle[SD_TempInt] degrees)
Unit - Move SD_Shadows[SD_TempInt] instantly to SD_Loc[3], facing SD_Angle[SD_TempInt] degrees
Custom script: call RemoveLocation (udg_SD_Loc[3])
Else - Actions
-------- else If distance between shadow and target less than SD_Distance it will explode --------
Unit - Cause SD_Caster[SD_TempInt] to damage SD_Target[SD_TempInt], dealing SD_Damage[SD_LOA[SD_TempInt]] damage of attack type SD_AttackType and damage type SD_DamageType
Unit - Move SD_Caster[SD_TempInt] instantly to SD_Loc[2]
Special Effect - Create a special effect attached to the origin of SD_Shadows[SD_TempInt] using SD_SFX1
Special Effect - Destroy (Last created special effect)
Special Effect - Create a special effect attached to the origin of SD_Caster[SD_TempInt] using SD_SFX1
Special Effect - Destroy (Last created special effect)
Unit - Remove SD_EvasionDummy from SD_Caster[SD_TempInt]
Unit - Kill SD_Shadows[SD_TempInt]
Custom script: set udg_SD_Angle[udg_SD_TempInt] = 0.00
Custom script: set udg_SD_Caster[udg_SD_TempInt] = null
Custom script: set udg_SD_Shadows[udg_SD_TempInt] = null
Custom script: set udg_SD_Target[udg_SD_TempInt] = null
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Then - Actions
Set SD_Index[SD_Looper] = SD_Index[SD_IndexSize]
Set SD_Index[SD_IndexSize] = SD_TempInt
Set SD_IndexSize = (SD_IndexSize - 1)
Set SD_Looper = (SD_Looper - 1)
Else - Actions
Custom script: call RemoveLocation (udg_SD_Loc[1])
Custom script: call RemoveLocation (udg_SD_Loc[2])
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
SD_IndexSize Equal to 0
Then - Actions
Trigger - Turn off (This trigger)
Else - Actions
Else - Actions
-------- else If target is death the shadow will instantly killed and remove evasion dummy from caster --------
Unit - Kill SD_Shadows[SD_TempInt]
Unit - Remove SD_EvasionDummy from SD_Caster[SD_TempInt]
Custom script: set udg_SD_Angle[udg_SD_TempInt] = 0.00
Custom script: set udg_SD_Caster[udg_SD_TempInt] = null
Custom script: set udg_SD_Shadows[udg_SD_TempInt] = null
Custom script: set udg_SD_Target[udg_SD_TempInt] = null
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Then - Actions
Set SD_Index[SD_Looper] = SD_Index[SD_IndexSize]
Set SD_Index[SD_IndexSize] = SD_TempInt
Set SD_IndexSize = (SD_IndexSize - 1)
Set SD_Looper = (SD_Looper - 1)
Else - Actions
Custom script: call RemoveLocation (udg_SD_Loc[1])
Custom script: call RemoveLocation (udg_SD_Loc[2])
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
SD_IndexSize Equal to 0
Then - Actions
Trigger - Turn off (This trigger)
Else - Actions

[/trigger]


v0.1: first release
v0.2: add configuration some stuff and MUI (credit to KILLCIDE)


sorry for bad english
Feel free to give comment :)


Keywords:
shadow,dash,rush,explode,blink
Contents

Shadow Rush (Map)

Reviews
09:22, 17th Oct 2015 Bribe: Very good for your first spell. Works properly and I can't find any memory leaks

Moderator

M

Moderator

09:22, 17th Oct 2015
Bribe: Very good for your first spell. Works properly and I can't find any memory leaks
 

Deleted member 238226

D

Deleted member 238226

your first spell? looks pretty cool :)
 
Last edited by a moderator:
Level 37
Joined
Jul 22, 2015
Messages
3,485
Euugh I love it when people add documentation. Anyway, at quick glance:
  • Your spell is currently not MUI. Look more into dynamic indexing
  • I'd recommend making all these configurable:
    • Offset & degrees for shadow creation
    • Animation & animation speed
    • Attack type & damage type
  • Set the death timer of the dummy to 0 seconds

As of right now, this spell is pretty simple. I'd suggest adding an effect of when the dummy gets created and or when the caster gets teleported to the targeted unit.
 
Level 37
Joined
Jul 22, 2015
Messages
3,485
You're getting the hang of it, but it still needs some work. You should update your map by the way... it's an older version. Another quick look at your triggers:
  • You don't need this ITE. Just make your arrays refer to IndexSize
    • Set SD_IndexSize = (SD_IndexSize + 1)
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • SD_IndexSize Greater than SD_MaxIndexSize
      • Then - Actions
        • Set SD_Index[SD_IndexSize] = SD_IndexSize
        • Set SD_MaxIndexSize = SD_IndexSize
      • Else - Actions
    • Set SD_TempInt = SD_Index[SD_IndexSize]
  • Anything with an array size in your loop should refer to the loop integer
  • You're going to want to deindex these variables:
    • SD_Caster
    • SD_Target
    • SD_Shadows
    • SD_LOA
  • I'm not a big fan of having two places in one trigger that can turn off the loop. Set up an Or - Conditions that checks if distance is met or if the target died. Afterwards, check if the target is alive (if so damage), then deindex
 

Deleted member 238226

D

Deleted member 238226

congrats for the first approved spell :)
 
Top