• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Charge-Slash 2.0v

Hello! I present you : Charge-Slash. I have seen other charge spells, but mine is different - mine has acceleration for the speed (for both moving and animation speed), it also has a slash at the end of the charge. It's MUI and i think it's leakless.

Spell description : Charge at the enemy. With each passing moment, you begin to gain speed. When you get to your target, you slash it with lightning speed, you deal damage and you stun it for 1 second. Level 1 - 100 damage, 700 units cast range. Level 2 - 200 damage, 1000 units cast range. Level 3 - 300 damage, 1300 units cast range. You can't charge if you are within 300 units of your target tough.

Comment, rate, give credits if you use. :)

  • Cast Trigger
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Charge
    • Actions
      • Set CCasterCheck = (Triggering unit)
      • Set CTargetCheck = (Target unit of ability being cast)
      • Set CCasterPosCheck = (Position of CCasterCheck)
      • Set CTargetPosCheck = (Position of CTargetCheck)
      • Set CPlayaGroupCheck = (All players controlled by a ((Owner of CCasterCheck) controller) player)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Distance between CCasterPosCheck and CTargetPosCheck) Greater than or equal to 300.00
        • Then - Actions
        • Else - Actions
          • Game - Display to CPlayaGroupCheck the text: Your hero is too cl...
          • Custom script: call DestroyForce(udg_CPlayaGroupCheck)
          • Skip remaining actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ID2 Equal to 0
        • Then - Actions
          • Trigger - Turn on Loop Trigger <gen>
        • Else - Actions
      • Set ID2 = (ID2 + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ID2 Greater than IDMax
        • Then - Actions
          • Set ID[ID2] = ID2
          • Set IDMax = ID2
        • Else - Actions
      • Set CArray = ID[ID2]
      • Set CCaster[CArray] = CCasterCheck
      • Set CTarget[CArray] = CTargetCheck
      • Set CLevel[CArray] = (Level of Charge for CCaster[CArray])
      • Set CEndOfCharge[CArray] = False
      • Set CPlayaGroup[CArray] = (All players controlled by a ((Owner of CCaster[CArray]) controller) player)
      • Unit - Turn collision for CCaster[CArray] Off
      • Special Effect - Create a special effect attached to the overhead of CCaster[CArray] using Abilities\Spells\Human\Invisibility\InvisibilityTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • -------- --------------- THINGS THAT YOU CAN CHANGE --------------- --------
      • -------- CAcceleration = starting acceleration of the caster. Greater value = greater start speed and faster animation. --------
      • Set CAcceleration[CArray] = 7.00
      • -------- CAnimSpeed = starting speed of the animation of the caster. --------
      • Set CAnimSpeed[CArray] = 100.00
      • -------- CWait = the time the slash animation is. Change that if you have a unit with longer/shorter slash animation. --------
      • Set CWait[CArray] = 0.40
      • -------- CDamage = damage of the slash. LevelOfCharge x 100 in this case. --------
      • Set CDamage[CArray] = ((Real(CLevel[CArray])) x 100.00)
      • -------- CAccelerationRate = the rate of the acceleration. Greater value = faster acceleration. --------
      • Set CAccelerationRate = 0.60
      • -------- --------------- THINGS THAT YOU CAN CHANGE --------------- --------
      • Custom script: call RemoveLocation(udg_CCasterPosCheck)
      • Custom script: call RemoveLocation(udg_CTargetPosCheck)
      • Custom script: call RemoveLocation(udg_CCasterPos)
      • Custom script: call RemoveLocation(udg_CTargetPos)
  • Loop Trigger
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • For each (Integer CLoop) from 1 to ID2, do (Actions)
        • Loop - Actions
          • Set CArray = ID[CLoop]
          • Set CCasterPos = (Position of CCaster[CArray])
          • Set CTargetPos = (Position of CTarget[CArray])
          • Set CAngle[CArray] = (Angle from CCasterPos to CTargetPos)
          • Unit - Make CCaster[CArray] face CAngle[CArray] over 0.00 seconds
          • Set CDistance[CArray] = (Distance between CCasterPos and CTargetPos)
          • Custom script: call RemoveLocation(udg_CTargetPos)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • CDistance[CArray] Less than or equal to (100.00 + CAcceleration[CArray])
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • CEndOfCharge[CArray] Equal to False
                • Then - Actions
                  • Unit - Create 1 Dummy for (Owner of CCaster[CArray]) at CCasterPos facing Default building facing degrees
                  • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
                  • Unit - Order (Last created unit) to Human Mountain King - Storm Bolt CTarget[CArray]
                  • Animation - Change CCaster[CArray]'s animation speed to 200.00% of its original speed
                  • Animation - Reset CCaster[CArray]'s animation
                  • Animation - Play CCaster[CArray]'s Attack Slam animation
                  • Set CEndOfCharge[CArray] = True
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • CWait[CArray] Less than or equal to 0.00
                • Then - Actions
                  • Unit - Cause CCaster[CArray] to damage CTarget[CArray], dealing CDamage[CArray] damage of attack type Spells and damage type Normal
                  • Special Effect - Create a special effect attached to the chest of CTarget[CArray] using Abilities\Spells\Other\Stampede\StampedeMissileDeath.mdl
                  • Special Effect - Destroy (Last created special effect)
                  • Animation - Change CCaster[CArray]'s animation speed to 100.00% of its original speed
                  • Unit - Turn collision for CCaster[CArray] On
                  • Unit - Order CCaster[CArray] to Attack CTarget[CArray]
                  • Set ID[CLoop] = ID[ID2]
                  • Set ID[ID2] = CArray
                  • Set ID2 = (ID2 - 1)
                  • Set CLoop = (CLoop - 1)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • ID2 Equal to 0
                    • Then - Actions
                      • Trigger - Turn off (This trigger)
                    • Else - Actions
                • Else - Actions
                  • Set CWait[CArray] = (CWait[CArray] - 0.03)
                  • Unit - Order CCaster[CArray] to Stop
            • Else - Actions
              • Unit - Order CCaster[CArray] to Stop
              • -------- -------------------- THE CUSTOM SCRIPT FOR THE ''WALK'' ANIMATION -------------------- --------
              • -------- If you change the model of your hero, probably the new model won't play it's 'Walk' animation. --------
              • -------- If so - change the value in the custom script below. --------
              • -------- call SetUnitAnimationByIndex(udg_CCaster[udg_CArray],<<6>>) set the number in the triangle brackets from 0 to the number of animation your unit has --------
              • -------- At one point - you are going to find the right value for the walk animation. Test the map, cast the spell. If the 'Walk' animation does not play - change the value as i said before and test again. :) --------
              • Custom script: call SetUnitAnimationByIndex(udg_CCaster[udg_CArray],6)
              • -------- -------------------- THE CUSTOM SCRIPT FOR THE ''WALK'' ANIMATION -------------------- --------
              • Set CAcceleration[CArray] = (CAcceleration[CArray] + CAccelerationRate)
              • Set CMovePoint = (CCasterPos offset by CAcceleration[CArray] towards CAngle[CArray] degrees)
              • Custom script: call RemoveLocation(udg_CCasterPos)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • CAnimSpeed[CArray] Less than or equal to 200.00
                • Then - Actions
                  • Set CAnimSpeed[CArray] = (CAnimSpeed[CArray] + (CAcceleration[CArray] / 3.00))
                  • Animation - Change CCaster[CArray]'s animation speed to CAnimSpeed[CArray]% of its original speed
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Or - Any (Conditions) are true
                    • Conditions
                      • (CTarget[CArray] is alive) Equal to False
                      • (Terrain pathing at CMovePoint of type Walkability is off) Equal to True
                • Then - Actions
                  • Game - Display to CPlayaGroup[CArray] the text: Charge aborted.
                  • Custom script: call DestroyForce(udg_CPlayaGroup[udg_CArray])
                  • Animation - Change CCaster[CArray]'s animation speed to 100.00% of its original speed
                  • Unit - Turn collision for CCaster[CArray] On
                  • Unit - Order CCaster[CArray] to Stop
                  • Animation - Reset CCaster[CArray]'s animation
                  • Set ID[CLoop] = ID[ID2]
                  • Set ID[ID2] = CArray
                  • Set ID2 = (ID2 - 1)
                  • Set CLoop = (CLoop - 1)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • ID2 Equal to 0
                    • Then - Actions
                      • Trigger - Turn off (This trigger)
                    • Else - Actions
                • Else - Actions
                  • Custom script: call SetUnitX(udg_CCaster[udg_CArray], GetLocationX (udg_CMovePoint))
                  • Custom script: call SetUnitY(udg_CCaster[udg_CArray], GetLocationY (udg_CMovePoint))
                  • Custom script: call RemoveLocation(udg_CMovePoint)
Charge-Slash 1.0v - spell's creation
Charge-Slash 2.0v - player group leak removed, the distance check is now in the beginning of the Cast Trigger, arrays arn't used anymore for the locations in the Loop Trigger, importing instructions added to the map file, the loop trigger now turns off, charge's caster no longer charges trough cliffs and deep water


Keywords:
charge, slash, charge-slash, acceleration, accelerate, damage, cut, unit, slice, ninja, gui, mui.
Contents

Charge-Slash 2.0v spell by ColdBone (Map)

Reviews
10 Feb 2012 Bribe: Looks alright, thanks for sharing :) Approved 3.75/5 LeakGame - Display to (All players controlled by a ((Owner of CCaster[CArray]) controller) player) the text: ... You should do the distance check as early as...

Moderator

M

Moderator

10 Feb 2012
Bribe: Looks alright, thanks for sharing :)

Approved 3.75/5


Reviewed by Maker, Charge-Slash v1.0, 9th Feb 2012

  • Leak
    • Game - Display to (All players controlled by a ((Owner of CCaster[CArray]) controller) player) the text: ...
  • You should do the distance check as early as possible in the cast trigger to avoid useless actions
  • Don't use arrays for the locations
  • Some locations are not correctly removed in the looping trigger
  • Add importing instructions into the map file
  • The looping trigger is never turned off
The caster can get stuck on deep water and can charge through cliffs and buildings. Maybe these things are intended, but getting stuck on water could be an issue.
 
Level 14
Joined
Aug 8, 2010
Messages
1,022
@Maker - i thought i should not destroy the force because i don't use it when CWait is less than or equal to 0 and i have never used it before in the trigger. :? I have used it only when i have to erm... send a game message to that force (when the hero is too close to his target (in the cast trigger) and when there is a cliff or deep water (later in the trigger)). Please, tell me if i'm wrong so that i can update the map spell. :)

Thank you!
 
Level 37
Joined
Mar 6, 2006
Messages
9,243
@Maker - i thought i should not destroy the force because i don't use it when CWait is less than or equal to 0 and i have never used it before in the trigger. :? I have used it only when i have to erm... send a game message to that force (when the hero is too close to his target (in the cast trigger) and when there is a cliff or deep water (later in the trigger)). Please, tell me if i'm wrong so that i can update the map spell. :)

The group is not removed here, thus it leaks:
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
  • If - Conditions
  • CWait[CArray] Less than or equal to 0.00
  • Then - Actions
  • Unit - Cause CCaster[CArray] to damage CTarget[CArray], dealing CDamage[CArray] damage of attack type Spells and damage type Normal
  • Special Effect - Create a special effect attached to the chest of CTarget[CArray] using Abilities\Spells\Other\Stampede\StampedeMissileDeath.mdl
  • Special Effect - Destroy (Last created special effect)
  • Animation - Change CCaster[CArray]'s animation speed to 100.00% of its original speed
  • Unit - Turn collision for CCaster[CArray] On
  • Unit - Order CCaster[CArray] to Attack CTarget[CArray]
  • Set ID[CLoop] = ID[ID2]
  • Set ID[ID2] = CArray
  • Set ID2 = (ID2 - 1)
  • Set CLoop = (CLoop - 1)
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
  • If - Conditions
  • ID2 Equal to 0
  • Then - Actions
  • Trigger - Turn off (This trigger)
 
Level 1
Joined
Mar 17, 2012
Messages
6
Nice model name for your dummy dick in a box :xxd:
It looks nice, and I like how neat you made the triggers
its easy to find things, and learn how to make it. ty
 
Level 6
Joined
May 11, 2010
Messages
237
Very nice ability, only problem i've had with it is that it isn't blocked by pathing blockers? Both ground and air.
 
Level 2
Joined
Jun 15, 2012
Messages
9
How do you use this? I started coding the triggers and what not, but when I got to the part where it says "(Ability being cast) Equal to Charge", it stumped me. There is no "Charge" variable. There's a "Charge Gold and Lumber" variable, but that's not it. It almost seems like you have to create the the spell itself first before writing the triggers, but how can you do that if there's no already existing spell to base it off of?
 
Level 2
Joined
Jun 14, 2012
Messages
18
How do you use this? I started coding the triggers and what not, but when I got to the part where it says "(Ability being cast) Equal to Charge", it stumped me. There is no "Charge" variable. There's a "Charge Gold and Lumber" variable, but that's not it. It almost seems like you have to create the the spell itself first before writing the triggers, but how can you do that if there's no already existing spell to base it off of?

You are supposed to copy from the test map, buffs (when there are buffs) then spells, then Dummy units, then you tick the "Automatically create unknown variable while pasting trigger data" (found in File - Preferences) and finally you can either write it line by line, or just copy the whole trigger then configure it in that order. (I think)
 
Top