Fatal Sword GUI v1.2

This bundle is marked as useful / simple. Simplicity is bliss, low effort and/or may contain minor bugs.
Caster moves towards it enemy and slashes it. It's like Zoro skills in One Piece.
I know this spell is already made by KhaosMachine but in JASS. So, I've tried to make a GUI version for them who don't know JASS, like me :D

Level 1 - 100 damages
Level 2 - 200 damages
Level 3 - 300 damages

Give credits if used,
by fareezizfar

  • Spell Init
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- Change them whatever you want --------
      • Set FS_Ability = Fatal Sword
      • Set FS_Damage[1] = 100.00
      • Set FS_Damage[2] = 200.00
      • Set FS_Damage[3] = 300.00
      • -------- Don't touch this --------
      • Set FS_Speed = 50.00
  • FS Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to FS_Ability
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • FS_Temp Equal to 0
        • Then - Actions
          • Trigger - Turn on FS Loop <gen>
        • Else - Actions
      • -------- IMPORTANT PART. DON'T TOUCH THIS --------
      • Set FS_Temp = (FS_Temp + 1)
      • -------- ----------------------- --------
      • Set FS_Caster[FS_Temp] = (Triggering unit)
      • Set FS_CastLoc[FS_Temp] = (Position of FS_Caster[FS_Temp])
      • Set FS_Target[FS_Temp] = (Target unit of ability being cast)
      • Set FS_TargetLoc[FS_Temp] = (Position of FS_Target[FS_Temp])
      • Set FS_CastRange[FS_Temp] = (Distance between FS_CastLoc[FS_Temp] and FS_TargetLoc[FS_Temp])
      • Set FS_Range[FS_Temp] = (FS_CastRange[FS_Temp] x 1.25)
      • Unit - Turn collision for FS_Caster[FS_Temp] Off
      • Unit - Pause FS_Target[FS_Temp]
      • Animation - Play FS_Caster[FS_Temp]'s attack slam animation
      • Trigger - Turn on FS Loop <gen>
      • -------- END IMPORTANT PART --------
      • Special Effect - Create a special effect attached to the right hand of FS_Caster[FS_Temp] using Abilities\Weapons\PhoenixMissile\Phoenix_Missile.mdl
      • Set FS_SFX[FS_Temp] = (Last created special effect)
  • FS 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
          • FS_Range[FS_Temp] Greater than 0.00
        • Then - Actions
          • Set FS_Move[FS_Temp] = ((Position of FS_Caster[FS_Temp]) offset by FS_Speed towards (Facing of FS_Caster[FS_Temp]) degrees)
          • Unit - Move FS_Caster[FS_Temp] instantly to FS_Move[FS_Temp]
          • Set FS_Range[FS_Temp] = (FS_Range[FS_Temp] - FS_Speed)
        • Else - Actions
          • Special Effect - Destroy FS_SFX[FS_Temp]
          • Unit - Cause FS_Caster[FS_Temp] to damage FS_Target[FS_Temp], dealing FS_Damage[(Level of FS_Ability for FS_Caster[FS_Temp])] damage of attack type Spells and damage type Normal
          • Unit - Turn collision for FS_Caster[FS_Temp] On
          • Animation - Reset FS_Caster[FS_Temp]'s animation
          • Unit - Unpause FS_Target[FS_Temp]
          • Set FS_Temp = (FS_Temp - 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • FS_Temp Equal to 0
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions
Changelog
1.0 - Upload
1.1 - Removed some leaks with help of GywGod133
1.2 - Added MUI test

P/S : If there are anything to be added, post it like GywGod133 does. Coz i'm not a pro.

Keywords:
fatal, sword, gui, slash,
Contents

Fatal Sword GUI (Map)

Reviews
12th Dec 2015 IcemanBo: For long time as NeedsFix. Rejected. 15:02, 5th Jan 2015 Maker: Avoid using Pause unit action in spells.

Moderator

M

Moderator

12th Dec 2015
IcemanBo: For long time as NeedsFix. Rejected.

15:02, 5th Jan 2015
Maker: Avoid using Pause unit action in spells.
 
Level 13
Joined
Jul 16, 2012
Messages
679
EDIT:
You should change this Set FS_Caster[FS_Temp] = (Casting unit) to Set FS_Caster[FS_Temp] = (Triggering unit).

This Set FS_CastRange[FS_Temp] = (Distance between (Position of FS_Caster[FS_Temp]) and (Position of FS_Target[FS_Temp])), you have 2 leaks

In your Trigger Loop, Set FS_Move[FS_Temp] = ((Position of FS_Caster[FS_Temp]) offset by FS_Speed towards (Facing of FS_Caster[FS_Temp]) degrees) you have leak

EDIT 2:
This Trigger - Turn on FS Loop <gen> put it in ITE (IF THEN ELSE)

You need to change this Trigger - Turn off FS Loop <gen> into Trigger - Turn off this trigger and also put it in a ITE
 
Last edited:
Use triggering unit. Never use casting unit. Casting unit is slower and less efficient.

This is currently not MUI and will only work when one unit is casting.

You have the indexing part which is correct. But you never loop through all the indexes in the loop trigger and you need to de-index when an instance of the spell is over.

If you do anything with level of ability it should always be stored. Otherwise you can have someone cast the ability then level it and now the spell that was cast by them now gets the damage that the new level of the ability does.

The range should also be configurable.
 
Level 11
Joined
Jul 25, 2014
Messages
490
Make it MUI. You don't use the same array integer when you move your variables from init to loop. And at the start of the trigger use this:
  • For each (Integer Your_New_Integer_Variable) from 1 to FS_Temp, do (Actions)
There are still a lot of things for you to learn, please check some guides about MUI spells.

Edit: Btw, looks nothing like Zoro's Oni Giri. :/
 
Top