1. Are you planning to upload your awesome spell or system to Hive? Please review the rules here.
    Dismiss Notice
  2. A slave to two rhythms, the 22nd Terraining Contest is here.
    Dismiss Notice
  3. The heavens smile on the old faithful. The 16th Techtree Contest has begun.
    Dismiss Notice
  4. The die is cast - the 6th Melee Mapping Contest results have been announced. Onward to the Hive Cup!
    Dismiss Notice
  5. The glory of the 20th Icon Contest is yours for the taking!
    Dismiss Notice
  6. Shoot to thrill, play to kill. Sate your hunger with the 33rd Modeling Contest!
    Dismiss Notice
  7. Do you hear boss music? It's the 17th Mini Mapping Contest!
    Dismiss Notice
  8. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

Charge-Slash 2.0v

Submitted by CoLd Bon3
This bundle is marked as approved. It works and satisfies the submission rules.
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. :)

Triggers
  • 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)


Change log
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
Moderator
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...
  1. 10 Feb 2012
    Bribe: Looks alright, thanks for sharing :)

    Approved 3.75/5

    Older reviews

    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.

     
  2. JollyD

    JollyD

    Joined:
    Jun 13, 2011
    Messages:
    1,275
    Resources:
    112
    Icons:
    111
    Skins:
    1
    Resources:
    112
    You are cruel ))
     
  3. KhaosMachine

    KhaosMachine

    Joined:
    Dec 30, 2011
    Messages:
    117
    Resources:
    6
    Spells:
    6
    Resources:
    6
    Nice ability, :)
     
  4. CoLd Bon3

    CoLd Bon3

    Joined:
    Aug 8, 2010
    Messages:
    945
    Resources:
    4
    Spells:
    4
    Resources:
    4
    Thanks! :)
     
  5. Maker

    Maker

    Joined:
    Mar 6, 2006
    Messages:
    9,174
    Resources:
    17
    Maps:
    2
    Spells:
    14
    Tutorials:
    1
    Resources:
    17
    It seems to me that you don't destroy the force if "CWait[CArray] Less than or equal to 0.00" is true.

    The ability is quite well done, the effects are subtle and fitting.
     
  6. CoLd Bon3

    CoLd Bon3

    Joined:
    Aug 8, 2010
    Messages:
    945
    Resources:
    4
    Spells:
    4
    Resources:
    4
    @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!
     
  7. Palooo3

    Palooo3

    Joined:
    Nov 24, 2010
    Messages:
    544
    Resources:
    2
    Maps:
    2
    Resources:
    2
    Finally found impressive GUI charge, Thank you ;)
     
  8. Maker

    Maker

    Joined:
    Mar 6, 2006
    Messages:
    9,174
    Resources:
    17
    Maps:
    2
    Spells:
    14
    Tutorials:
    1
    Resources:
    17
    The group is not removed here, thus it leaks:
    Trigger
    • 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)
     
  9. RoyalLich

    RoyalLich

    Joined:
    Mar 17, 2012
    Messages:
    7
    Resources:
    0
    Resources:
    0
    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
     
  10. Drazhar

    Drazhar

    Joined:
    May 11, 2010
    Messages:
    213
    Resources:
    0
    Resources:
    0
    Very nice ability, only problem i've had with it is that it isn't blocked by pathing blockers? Both ground and air.
     
  11. Slash_Raptor

    Slash_Raptor

    Joined:
    Jun 15, 2012
    Messages:
    9
    Resources:
    0
    Resources:
    0
    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?
     
  12. Mr. Reez

    Mr. Reez

    Joined:
    Jun 14, 2012
    Messages:
    18
    Resources:
    0
    Resources:
    0
    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)
     
  13. BUP

    BUP

    Joined:
    Sep 9, 2012
    Messages:
    149
    Resources:
    8
    Spells:
    8
    Resources:
    8
    @Cold Bon3
    Great Idea with the acceleration!!