- Joined
- Apr 10, 2009
- Messages
- 380
~How to make a Sword/Slash Ability~
Introduction
In this tutorial, I will teach you how to make a slash ability. It is pretty simple, so no worries!
The slash ability is a no target type spell. For example, if you presses the ability, the units that is in front of you will automatically takes damage.
All we need is some abilities and triggers.Now, let's get started, shall we?
Abilities
Firstly, let us make the abilities first. Without the abilities, the triggers can't be done.
Let's set up the spells now, we'll go step by step.
Trigger
It time for the final part now
For some of you, you might be thinking, "Oh no this will be my worst nightmare". Relax, it's pretty easy.
Let's get started! Here's the trigger:
That's all for now, good luck in triggering! Here, I added a sample map in case you wanted to see how it works.
In this tutorial, I will teach you how to make a slash ability. It is pretty simple, so no worries!
The slash ability is a no target type spell. For example, if you presses the ability, the units that is in front of you will automatically takes damage.
All we need is some abilities and triggers.Now, let's get started, shall we?
Unit:
A Dummy (I based the dummy from the chicken, and then I replaced the Wander ability to Locust. I removed the model of the chicken, replaced the path of the model into something like ".mdl" and then I removed the shadow of the chicken. Also, change the movement type from foot to fly to prevent collision bugs.)
Variables:
MeleeCaster (Unit Variable)
MeleeDummy (Unit Variable)
MeleePoints (Point Array Variable)
A Dummy (I based the dummy from the chicken, and then I replaced the Wander ability to Locust. I removed the model of the chicken, replaced the path of the model into something like ".mdl" and then I removed the shadow of the chicken. Also, change the movement type from foot to fly to prevent collision bugs.)
Variables:
MeleeCaster (Unit Variable)
MeleeDummy (Unit Variable)
MeleePoints (Point Array Variable)
Abilities
Firstly, let us make the abilities first. Without the abilities, the triggers can't be done.
Let's set up the spells now, we'll go step by step.
Make a custom Summon Bear first, I'll name it "Melee". I'll show you by pictures:

In this picture, I'm not making the ability as a hero spell because it looks kinda weird in my opinion.
I'm making the Summon Bear as "low profile" as possible by changing the summoned unit into a dummy, set it's duration to 0.01 second, and then I removed it's summoning effects.
Also, you'll need to make a custom buff for this ability. To do that, simply go to the Buff section and then create a custom buff based on "Bear". All you got to do at the buff is only removing it's effect so our "tricks" won't be "noticed".


In this picture, I'm not making the ability as a hero spell because it looks kinda weird in my opinion.
I'm making the Summon Bear as "low profile" as possible by changing the summoned unit into a dummy, set it's duration to 0.01 second, and then I removed it's summoning effects.
Also, you'll need to make a custom buff for this ability. To do that, simply go to the Buff section and then create a custom buff based on "Bear". All you got to do at the buff is only removing it's effect so our "tricks" won't be "noticed".
This one we'll use Fan of Knives spell as base, here's the picture of the ability's data:

For this one, I'll add 100 damage as the description of the Melee ability says.
I'm putting "Number of targets field" to 0 because it means infinite, which I can hurt as many opponent I want. So basically, if you want to hurt 1 unit only, you should put it to 1.
You might be noticing why I'm putting the projectile missile speed to 99999, it is because I wanted it to become instant damage, and I set the blood as it's missile to make it looked more interesting.
For the "Maximum Damage" I put it 999999 so the ability can handle as many opponent as you want.


For this one, I'll add 100 damage as the description of the Melee ability says.
I'm putting "Number of targets field" to 0 because it means infinite, which I can hurt as many opponent I want. So basically, if you want to hurt 1 unit only, you should put it to 1.
You might be noticing why I'm putting the projectile missile speed to 99999, it is because I wanted it to become instant damage, and I set the blood as it's missile to make it looked more interesting.
For the "Maximum Damage" I put it 999999 so the ability can handle as many opponent as you want.
Trigger
It time for the final part now
For some of you, you might be thinking, "Oh no this will be my worst nightmare". Relax, it's pretty easy.
Let's get started! Here's the trigger:
-
Melee
-
Events
-
Unit - A unit Starts the effect of an ability
-
-
Conditions
-
(Ability being cast) Equal to Melee
-
-
Actions
-
-------- I'll create some variables at first to make things easier. --------
-
Set MeleeCaster = (Triggering unit)
-
Set MeleePoints[1] = (Position of MeleeCaster)
-
Set MeleePoints[2] = (MeleePoints[1] offset by 50.00 towards (Facing of MeleeCaster) degrees)
-
-------- Now let's create a dummy to cast the damage that we has just created. --------
-
Unit - Create 1 Dummy for (Owner of MeleeCaster) at MeleePoints[2] facing Default building facing degrees
-
Set MeleeDummy = (Last created unit)
-
-------- I'm adding expiration time to make it disappear after 0.5 second, and give it an ability. --------
-
Unit - Add a 0.50 second Generic expiration timer to MeleeDummy
-
Unit - Add Melee Damage to MeleeDummy
-
-------- It's time to cast them! So let's add this action. --------
-
Unit - Order MeleeDummy to Night Elf Warden - Fan Of Knives
-
-------- Time to remove leaks in order to prevent ingame lags. --------
-
Custom script: call RemoveLocation(udg_MeleePoints[1])
-
Custom script: call RemoveLocation(udg_MeleePoints[2])
-
-------- You're done! --------
-
-------- Q: Why do create dummy unit at MeleePoints[2] but not [1]? --------
-
-------- A: Because hero attacks are facing front, so we're going create it a little in front--------
-
-------- Q: What is "Facing of MeleeCaster"? --------
-
-------- A: It means the facing direction of the caster, so it means if you want your dummy face your caster's left side, it should be "Facing of MeleeCaster + 90.00" and "Facing of MeleeCaster - 90.00" for right side.--------
-
-------- Q: Why do you use Warden - Fan of Knives ability to order dummy cast spells? --------
-
-------- A: Because we the melee damage spell was based from Fan of Knives. --------
-
-
That's all for now, good luck in triggering! Here, I added a sample map in case you wanted to see how it works.
Attachments
Last edited: