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

Rushing Slash v1.2

Description

Slashes the target while rushing forward very fast.

Triggers

  • Rushing Slash Init
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- =========================================================================== --------
      • -------- -------- Configuration -------- --------
      • -------- =========================================================================== --------
      • -------- Sets the ability object --------
      • Set Rsla_Ability = Rushing Slash
      • -------- --------------------------- --------
      • -------- Sets the caster move speed --------
      • Set Rsla_MoveSpeed[1] = 25.00
      • Set Rsla_MoveSpeed[2] = 25.00
      • Set Rsla_MoveSpeed[3] = 25.00
      • Set Rsla_MoveSpeed[4] = 25.00
      • -------- --------------------------- --------
      • -------- Sets how many times should the caster slash the target --------
      • Set Rsla_SlashTimes[1] = 25
      • Set Rsla_SlashTimes[2] = 30
      • Set Rsla_SlashTimes[3] = 35
      • Set Rsla_SlashTimes[4] = 40
      • -------- --------------------------- --------
      • -------- Sets the damage of each slashes --------
      • Set Rsla_SlashDamage[1] = 10.00
      • Set Rsla_SlashDamage[2] = 12.00
      • Set Rsla_SlashDamage[3] = 14.00
      • Set Rsla_SlashDamage[4] = 16.00
      • -------- --------------------------- --------
      • -------- Sets the caster slash hit effect --------
      • Set Rsla_SlashEffect = Abilities\Weapons\AncientProtectorMissile\AncientProtectorMissile.mdl
      • -------- --------------------------- --------
      • -------- Sets the caster slash animation --------
      • Set Rsla_SlashAnimation = attack
      • -------- --------------------------- --------
      • -------- Sets the caster slash animation speed --------
      • Set Rsla_SlashAnimSpeed = 400.00
      • -------- --------------------------- --------
      • -------- Sets the attack-type --------
      • Set Rsla_AttackType = Normal
      • -------- --------------------------- --------
      • -------- Sets the damage-type --------
      • Set Rsla_DamageType = Normal
      • -------- --------------------------- --------
      • -------- =========================================================================== --------
      • -------- -------- End of Configuration -------- --------
      • -------- =========================================================================== --------
      • Set Rsla_TempLoc = (Point(0.00, 0.00))
      • Unit - Create 1 Peasant for Neutral Passive at Rsla_TempLoc facing 0.00 degrees
      • Set Rsla_Harvester = (Last created unit)
      • Custom script: call UnitAddAbility(udg_Rsla_Harvester, 'Aloc')
      • Unit - Hide Rsla_Harvester
      • Custom script: call RemoveLocation(udg_Rsla_TempLoc)
      • Custom script: call DestroyTrigger(GetTriggeringTrigger())
  • Rushing Slash Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Rsla_Ability
    • Actions
      • -------- Indexing --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Rsla_MaxIndex Equal to 0
        • Then - Actions
          • Trigger - Turn on Rushing Slash Loop <gen>
        • Else - Actions
      • Set Rsla_MaxIndex = (Rsla_MaxIndex + 1)
      • -------- --------------------------- --------
      • -------- Setting variables --------
      • Set Rsla_Caster[Rsla_MaxIndex] = (Triggering unit)
      • Set Rsla_Target[Rsla_MaxIndex] = (Target unit of ability being cast)
      • Set Rsla_Level[Rsla_MaxIndex] = (Level of Rsla_Ability for Rsla_Caster[Rsla_MaxIndex])
      • Set Rsla_TempLoc = (Position of Rsla_Caster[Rsla_MaxIndex])
      • Set Rsla_TempLoc2 = (Position of Rsla_Target[Rsla_MaxIndex])
      • Set Rsla_Angle[Rsla_MaxIndex] = (Angle from Rsla_TempLoc to Rsla_TempLoc2)
      • Set Rsla_Distance[Rsla_MaxIndex] = (Distance between Rsla_TempLoc and Rsla_TempLoc2)
      • Set Rsla_Counter[Rsla_MaxIndex] = 0
      • -------- --------------------------- --------
      • Unit - Turn collision for Rsla_Caster[Rsla_MaxIndex] Off
      • Animation - Change Rsla_Caster[Rsla_MaxIndex]'s animation speed to Rsla_SlashAnimSpeed% of its original speed
      • -------- Remove locations --------
      • Custom script: call RemoveLocation(udg_Rsla_TempLoc)
      • Custom script: call RemoveLocation(udg_Rsla_TempLoc2)
      • -------- --------------------------- --------
  • Rushing Slash Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • For each (Integer Rsla_Index) from 1 to Rsla_MaxIndex, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Rsla_Caster[Rsla_Index] is dead) Equal to False
              • (Rsla_Target[Rsla_Index] is dead) Equal to False
              • Rsla_Counter[Rsla_Index] Less than Rsla_SlashTimes[Rsla_Level[Rsla_Index]]
            • Then - Actions
              • -------- Stores some points used to move to --------
              • Set Rsla_TempLoc = (Position of Rsla_Target[Rsla_Index])
              • Set Rsla_TempLoc2 = (Rsla_TempLoc offset by Rsla_MoveSpeed[Rsla_Level[Rsla_Index]] towards Rsla_Angle[Rsla_Index] degrees)
              • Set Rsla_TempLoc3 = (Rsla_TempLoc2 offset by Rsla_Distance[Rsla_Index] towards (Rsla_Angle[Rsla_Index] + 180.00) degrees)
              • -------- --------------------------- --------
              • Unit - Move Rsla_Target[Rsla_Index] instantly to Rsla_TempLoc2
              • Unit - Move Rsla_Caster[Rsla_Index] instantly to Rsla_TempLoc3
              • -------- Kill nearby trees --------
              • Destructible - Pick every destructible within Rsla_Distance[Rsla_Index] of Rsla_TempLoc2 and do (Actions)
                • Loop - Actions
                  • Set Rsla_Tree = (Picked destructible)
                  • Unit - Order Rsla_Harvester to Harvest Rsla_Tree
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Current order of Rsla_Harvester) Equal to (Order(harvest))
                    • Then - Actions
                      • Destructible - Kill Rsla_Tree
                    • Else - Actions
              • Unit - Order Rsla_Harvester to Stop
              • -------- --------------------------- --------
              • Animation - Play Rsla_Caster[Rsla_Index]'s Rsla_SlashAnimation animation
              • Unit - Cause Rsla_Caster[Rsla_Index] to damage Rsla_Target[Rsla_Index], dealing Rsla_SlashDamage[Rsla_Level[Rsla_Index]] damage of attack type Rsla_AttackType and damage type Rsla_DamageType
              • Special Effect - Create a special effect at Rsla_TempLoc using Rsla_SlashEffect
              • Special Effect - Destroy (Last created special effect)
              • -------- Increases slash counter --------
              • Set Rsla_Counter[Rsla_Index] = (Rsla_Counter[Rsla_Index] + 1)
              • -------- --------------------------- --------
              • -------- Remove locations --------
              • Custom script: call RemoveLocation(udg_Rsla_TempLoc)
              • Custom script: call RemoveLocation(udg_Rsla_TempLoc2)
              • Custom script: call RemoveLocation(udg_Rsla_TempLoc3)
              • -------- --------------------------- --------
            • Else - Actions
              • -------- Backup to normal --------
              • Animation - Change Rsla_Caster[Rsla_Index]'s animation speed to 100.00% of its original speed
              • Unit - Turn collision for Rsla_Caster[Rsla_Index] On
              • -------- --------------------------- --------
              • -------- Recycling --------
              • Set Rsla_Angle[Rsla_Index] = Rsla_Angle[Rsla_MaxIndex]
              • Set Rsla_Caster[Rsla_Index] = Rsla_Caster[Rsla_MaxIndex]
              • Set Rsla_Caster[Rsla_MaxIndex] = No unit
              • Set Rsla_Counter[Rsla_Index] = Rsla_Counter[Rsla_MaxIndex]
              • Set Rsla_Level[Rsla_Index] = Rsla_Level[Rsla_MaxIndex]
              • Set Rsla_Target[Rsla_Index] = Rsla_Target[Rsla_MaxIndex]
              • Set Rsla_Target[Rsla_MaxIndex] = No unit
              • Set Rsla_MaxIndex = (Rsla_MaxIndex - 1)
              • Set Rsla_Index = (Rsla_Index - 1)
              • -------- --------------------------- --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Rsla_MaxIndex Equal to 0
                • Then - Actions
                  • -------- Turn off trigger when there's no more instance left --------
                  • Trigger - Turn off Rushing Slash Loop <gen>
                  • -------- --------------------------- --------
                • Else - Actions

Changelog

v1.0 - Initial version.
v1.1 - Fixed some codes.
v1.2 - Added new concept: killing nearby trees.

Credit

- Pyritie for his quick colorizer


Import instruction is in map. Please give me credit for my work if you use it.
Also thanks to deathismyfriend and AKA.GywGod133 for some help.


Keywords:
Slash, Sword, Blade, Rush, Move.
Contents

testmap (Map)

Reviews
10:34, 12th Sep 2014 PurgeandFire: A straightforward spell, but it is coded well and has a nice execution. Approved!

Moderator

M

Moderator

10:34, 12th Sep 2014
PurgeandFire: A straightforward spell, but it is coded well and has a nice execution. Approved!
 
Level 29
Joined
Oct 24, 2012
Messages
6,543
Remove the And all condition block.
The only time you ever need an and all condition block is inside an Or condition block.

You should also null target and caster after de-indexing them.
Like this.
  • Set Rsla_Caster[Rsla_Index] = Rsla_Caster[Rsla_MaxIndex]
  • Set Rsla_Caster[Rsla_MaxIndex] = No unit
  • Set Rsla_Target[Rsla_Index] = Rsla_Target[Rsla_MaxIndex]
  • Set Rsla_Target[Rsla_MaxIndex] = No unit
Instead of using Turn off this trigger you should use the trigger directly.
  • Trigger - Turn off Rushing Slash Loop <gen>
 
Level 3
Joined
Sep 6, 2014
Messages
13
Remove the And all condition block.
The only time you ever need an and all condition block is inside an Or condition block.

You should also null target and caster after de-indexing them.
Like this.
  • Set Rsla_Caster[Rsla_Index] = Rsla_Caster[Rsla_MaxIndex]
  • Set Rsla_Caster[Rsla_MaxIndex] = No unit
  • Set Rsla_Target[Rsla_Index] = Rsla_Target[Rsla_MaxIndex]
  • Set Rsla_Target[Rsla_MaxIndex] = No unit
Instead of using Turn off this trigger you should use the trigger directly.
  • Trigger - Turn off Rushing Slash Loop <gen>
I'll fix this soon.
Thanks!

Good coding...
Thanks.

Very clean code. +1 for that.

However I wont review it more than that due the coding method you use :p

rep+ (4) anyway
I make as clean as possible as this is my first spell. :vw_love:
This one took me about 3 days. 2 hours everyday.
 
Last edited:
Level 3
Joined
Sep 6, 2014
Messages
13
  • Animation - Play Rsla_Caster[Rsla_Index]'s Rsla_SlashAnimation animation
Just play the animation once at cast event.

Other than that it's definitedly approvable. Good job on the clean coding.
I'm aimming to make the caster hits the target many times as the caster pushes the target forward.

Good job indeed on your first spell. :infl_thumbs_up:
Thanks.


Updated to v1.2
 
Last edited:
Top