- Joined
- Jun 10, 2007
- Messages
- 780
Creating a Custom Spell!
After you have all the requirements and you know the definitions, you are ready to start this tutorial!
Introduction
Sometimes while creating a map, you want to have great things to impress the players and make them want to replay the map. People use models, sounds, icons, and more to make there map stand out. An example is Dota. With models, sometimes you wont find spells in the normal ability editor that would "match" your hero appearence. In this tutorial, I will teach you the basic of spell making through triggers!
Spell types
You may be saying "What are spell types?". Well, spell types are spells that have different ways of being casted. An example is warstomp from the Tauren Chieftain and shock wave from the Tauren Chieftain. War stomp is a simple click spell, clicking the icon will activate it. Shockwave is a little different, after clicking you will have a small little cross hair (I like to call it) and it will ask you to choose a point. After choosing the point, the spell will activate at that point. Choosing the right spell to make your custom ability off of is a key factor.
*Note: A hero can't have the same base ability twice. doing this will cause casting errors. An example is having two warstomp abilities, even if you change the entire spell, this error will still occur. Use other base abilities like thunderclap if you needed another warstomp-type ability.
Some Spell types are
AoE: Area of effect/Example:War stomp
No Target: Spells that activate on click or hotkey press/Example:Thunder Clap
Target (Single):Spells that require you to click an ability and then choose a target/Example:Storm bolt
No Target Casts: Spells that require a click, then choosing a point or unit/Example:Shockwave
Passive: The spell is unclickable and does the work automatically/Example:Bash
Dummy's
Dummies are things that have affects but usually arent supposed to be noticed. For example, if you wanted to cast two shockwaves you would use a dummy. You could cast one and you could make a dummy that would cast one. These are basically supposed to be unknown objects that help in special effects, spell effects, contributing to the spell, or even make the entire spell.
The Trigger Editor
The Trigger Editor is very good for custom spells because you can do beyond the normal warcraft spells by adding effects, spawning dummy's and such. The Trigger Editor is very easy to use when making custom spells and can be leak less (if you do it right, which can often be difficult.)
Variables
Another important part that deals with the trigger editor. Variables can store LOTS of information and can be used for spells. Variables are easy to learn. Just remember them as a copycat, they can store or "copy" data for later use. An example is if you spawn a unit and you have a wait action, then after the wait the unit will cast an ability. This ability will not work right if someone else uses the same ability because the 'last created unit' action will overlap, causing the spell to be VERY buggy. Variables, however, defeat this problem very easily. Check out this trigger below
Creating a Simple Triggered Spell
After reading that, you may have a headache because you were bombarded with information but dont worry, it is easy after you make a few spells in the editor.
Suppose I want to make a simple spell that when its clicked, rocks will fly out of the ground and hit units and damage them. That may sound hard to make but it is actually pretty easy. First I will need a dummy unit, I will use the demolisher because he can already shoot rocks.
Notice the unit has the locust ability, has no "real" model file, has 0 collision, and has 0 shadow. Locust makes it unclickable, no model file makes it blank, 0 collision makes it unable to be stopped if a unit is close to it, and 0 shadow makes it look like its not even there. Our dummy unit is now impossible to be seen. Also, make the unit have alot of range so that it doesn't have to move while it is about to attack. Shall we continue?
Next, we will need to make a dummy ability. What I mean by dummy is that it does nothing, it is just there to click and activate the spell.
I made all the damage properties 0 because as I said it is a dummy spell. All you need to keep is the mana, the cooldown, and the spell description.
After making the spell and the dummy unit, we can now trigger the spell.
Note*If you were to create 4 at once instead of 1 at a time, the action will be 10x more buggy and sometimes the dummies may not do there thing.
See screen shot below if you need help
Heres what it would look like if it had more then one level
Since the units were just created, we need to make then shoot the rocks, but how? All you have to do is this.
The random real number makes the rocks shoot in random locations and not at a certain location. The number 300-650 is range, so the farthest it could go is 650 and the shortest is 300. The random angle makes it shoot in any position.
You may also want to secure that all the units have died and were removed from the game so you may want to add an experation timer to them.
The spell is complete but I am not quite happy with it, it needs more effects. Luckly, we can do that with a simple action!
Demo Of The Spell View attachment Demo Spell.w3x
Section 2
Dummy Casting Units
In section one you learned about dummy units and now know how to make a simple spell with dummy units. This time, instead of the dummy being an attacking demolisher, we will make the dummy cast. Making dummy units casting spells can be tricky, though, so I will give you some basics.
First, to allow a dummy to cast an ability, you will need to make the ability itself. This is pretty easy and all. Remember to base the ability off of the type of spell it is (if its a simple click base it off of war stomp etc..). Here are some things to keep in mind:
You cant have 2 abilities both based off of the same ability.
(Example, a unit may not have two spells based off of war stomp, if you do, it will cause the spell to glitch or not work).
If the ability will be casted once, make the cooldown very long (like 9999) to prevent the ability from being casted twice. You may want to do the same with manacost.
If the ability involves multi-casting, make the cooldown short and make the manacost 0. If the unit should only cast like say 5 times, make the spell cost 1 mana, make the unit have 5 mana, give the unit no mana regain.
Doing these will help your ability leak ALOT less!
Part B
Now this tutorial will teach you the basics of triggering the ability. If you did not read the above "Section 2" then do so now or risk having a poorly made spell. As I said earlier, "a unit may not have 2 of the same ability or based ability on them", this is important.
Side note: Remember what you based the spell off of.
Lets say we wanted a entangling root spell just like the one that Keeper of the Grove has exept we want it to root a random target and make it a simple click spell. You may be thinking that its hard, but rest assure, if you can do the first spell I made, this will be cake. The thing is, the click root spell that your hero has (assuming you made one and you based it off of warstomp or something by that means) is just a dummy itself. Your dummy spell triggers a dummy unit whom activates the real spell. Confusing? You wont be for long.
Creating a Simple Dummy Casting Spell
First off, make a dummy spell based off of warstomp (I always use it as a base). Name is Root or something by that means, remove the damage and everything exept the cooldown (keep it at 8 seconds). Make desired tooltips and such.
Second, make a dummy unit (something like a shaman) and make sure it has no shadow, has the locust ability, has invulnerable and remove the model file. This is simaller to the dummy demolisher unit. Remove its attack and movespeed as well. This will make the dummy not move and not screw up the spell. Once your dummy unit is finished, move onto the next paragraph.
Third, make another spell but this time, base it off of entangling roots, make it unit, and modify whatever you want the spell to do (damage, seconds rooted etc..). All that really matters is the damage and seconds rooted, the rest like the cooldown wont work because the dummy will be removed in a few seconds. It is important for this to be a unit spell and not hero.
Forth, Now that your dummy spell, your dummy unit, and your real spell that does all the work are set, its time for the obvious triggering part.
All triggers (unless activated by another) require an action, so lets just use this one.
Now we must create the dummy unit.
I like to have a small wait function in all my triggers to make sure the thing registers.
Now, we must make the unit that we just created (the dummy) cast the ability. Now do this:
Well, there you go, a completed spell that took lower then 8 actions to make. If you want to make sure that dummy unit goes away then add this at the bottom of the trigger
TestRequirements
[x]World Editor
[x]General Trigger knowledge
[x]Object Editor knowledge
[x]Some Variable knowledge
[x]Wc3 The Frozen Throne
TestDefinitions
[x]Dummy unit, a unit that serves a purpose when making a spell. It may just be used for the spell damage, or for things like special effects.
[x]Variable, can store data.
[x]AOE, Area of effect spells, ex: War stomp.
[x]Passive,Unclickable spells ex:Bash
Will add more if needed.
TestFont
Size 2, a note
Size 4,a section of the tutorial
Bold is important
After you have all the requirements and you know the definitions, you are ready to start this tutorial!
Introduction
Sometimes while creating a map, you want to have great things to impress the players and make them want to replay the map. People use models, sounds, icons, and more to make there map stand out. An example is Dota. With models, sometimes you wont find spells in the normal ability editor that would "match" your hero appearence. In this tutorial, I will teach you the basic of spell making through triggers!
Spell types
You may be saying "What are spell types?". Well, spell types are spells that have different ways of being casted. An example is warstomp from the Tauren Chieftain and shock wave from the Tauren Chieftain. War stomp is a simple click spell, clicking the icon will activate it. Shockwave is a little different, after clicking you will have a small little cross hair (I like to call it) and it will ask you to choose a point. After choosing the point, the spell will activate at that point. Choosing the right spell to make your custom ability off of is a key factor.
*Note: A hero can't have the same base ability twice. doing this will cause casting errors. An example is having two warstomp abilities, even if you change the entire spell, this error will still occur. Use other base abilities like thunderclap if you needed another warstomp-type ability.
Some Spell types are
AoE: Area of effect/Example:War stomp
No Target: Spells that activate on click or hotkey press/Example:Thunder Clap
Target (Single):Spells that require you to click an ability and then choose a target/Example:Storm bolt
No Target Casts: Spells that require a click, then choosing a point or unit/Example:Shockwave
Passive: The spell is unclickable and does the work automatically/Example:Bash
Dummy's
Dummies are things that have affects but usually arent supposed to be noticed. For example, if you wanted to cast two shockwaves you would use a dummy. You could cast one and you could make a dummy that would cast one. These are basically supposed to be unknown objects that help in special effects, spell effects, contributing to the spell, or even make the entire spell.
The Trigger Editor
The Trigger Editor is very good for custom spells because you can do beyond the normal warcraft spells by adding effects, spawning dummy's and such. The Trigger Editor is very easy to use when making custom spells and can be leak less (if you do it right, which can often be difficult.)
Variables
Another important part that deals with the trigger editor. Variables can store LOTS of information and can be used for spells. Variables are easy to learn. Just remember them as a copycat, they can store or "copy" data for later use. An example is if you spawn a unit and you have a wait action, then after the wait the unit will cast an ability. This ability will not work right if someone else uses the same ability because the 'last created unit' action will overlap, causing the spell to be VERY buggy. Variables, however, defeat this problem very easily. Check out this trigger below
-
Spell
-
Events
- Unit - A unit Begins casting an ability
-
Conditions
- (Ability being cast) Equal to Animate Dead
-
Actions
- Unit - Create 1 Footman for (Owner of (Triggering unit)) at (Position of (Triggering unit)) facing Default building facing (270.0) degrees
- Wait 5.00 seconds
- Unit - Order (Last created unit) to Human Archmage - Blizzard (Position of (Triggering unit))
- Unit - Add a 5.00 second Generic expiration timer to (Last created unit)
-
Events
-
Spell 2
-
Events
- Unit - A unit Begins casting an ability
-
Conditions
- (Ability being cast) Equal to Animate Dead
-
Actions
- Unit - Create 1 Footman for (Owner of (Triggering unit)) at (Position of (Triggering unit)) facing Default building facing (270.0) degrees
- Set StoreUnit = (Last created unit)
- Wait 5.00 seconds
- Unit - Order StoreUnit to Human Archmage - Blizzard (Position of (Triggering unit))
- Unit - Add a 5.00 second Generic expiration timer to StoreUnit
-
Events
Creating a Simple Triggered Spell
After reading that, you may have a headache because you were bombarded with information but dont worry, it is easy after you make a few spells in the editor.
Suppose I want to make a simple spell that when its clicked, rocks will fly out of the ground and hit units and damage them. That may sound hard to make but it is actually pretty easy. First I will need a dummy unit, I will use the demolisher because he can already shoot rocks.
Notice the unit has the locust ability, has no "real" model file, has 0 collision, and has 0 shadow. Locust makes it unclickable, no model file makes it blank, 0 collision makes it unable to be stopped if a unit is close to it, and 0 shadow makes it look like its not even there. Our dummy unit is now impossible to be seen. Also, make the unit have alot of range so that it doesn't have to move while it is about to attack. Shall we continue?
Next, we will need to make a dummy ability. What I mean by dummy is that it does nothing, it is just there to click and activate the spell.
I made all the damage properties 0 because as I said it is a dummy spell. All you need to keep is the mana, the cooldown, and the spell description.
After making the spell and the dummy unit, we can now trigger the spell.
-
Events
- Unit - A unit Begins casting an ability
-
Conditions
- (Ability being cast) Equal to TheSpellWeAreMaking
- Unit - Create 1Dummy for (Owner of (Triggering unit)) at (Position of (Triggering unit)) facing Default building facing (270.0) degrees)
- Unit - Create 1Dummy for (Owner of (Triggering unit)) at (Position of (Triggering unit)) facing Default building facing (270.0) degrees)
- Unit - Create 1Dummy for (Owner of (Triggering unit)) at (Position of (Triggering unit)) facing Default building facing (270.0) degrees)
- Unit - Create 1Dummy for (Owner of (Triggering unit)) at (Position of (Triggering unit)) facing Default building facing (270.0) degrees)
Note*If you were to create 4 at once instead of 1 at a time, the action will be 10x more buggy and sometimes the dummies may not do there thing.
See screen shot below if you need help
Heres what it would look like if it had more then one level
- If ((Level of SpellWeAREMaking for (Triggering unit)) Equal to 1) then do (Unit - Create 1Dummy for (Owner of (Triggering unit)) at (Position of (Triggering unit)) facing Default building facing (270.0) degrees) else do (Do nothing)
Since the units were just created, we need to make then shoot the rocks, but how? All you have to do is this.
- Unit - Order (Last created unit) to Attack Ground ((Position of (Triggering unit)) offset by (Random real number between 250.00 and 360.00) towards (Random angle) degrees)
- Unit - Create 1 Footman for (Owner of (Triggering unit)) at (Position of (Triggering unit)) facing Default building facing (270.0) degrees
- Unit - Order (Last created unit) to Attack Ground ((Position of (Triggering unit)) offset by (Random real number between 250.00 and 360.00) towards (Random angle) degrees)
The random real number makes the rocks shoot in random locations and not at a certain location. The number 300-650 is range, so the farthest it could go is 650 and the shortest is 300. The random angle makes it shoot in any position.
You may also want to secure that all the units have died and were removed from the game so you may want to add an experation timer to them.
- Unit Group - Pick every unit in (Units of type Dummy) and do (Unit - Add a 4.00 second Generic expiration timer to (Triggering unit))
The spell is complete but I am not quite happy with it, it needs more effects. Luckly, we can do that with a simple action!
- Environment - Create a 0.50 second Temporary crater deformation at (Position of (Casting unit)) with radius 1000.00 and depth 64.00
-
TheSpellWeAreMaking
-
Events
- Unit - A unit Begins casting an ability
-
Conditions
- (Ability being cast) Equal to SpellBeingMade
-
Actions
- Environment - Create a 0.50 second Temporary crater deformation at (Position of (Casting unit)) with radius 1000.00 and depth 64.00
- If ((Level of Spellbeingmade for (Triggering unit)) Equal to 1) then do (Unit - Create 4 Dummy for (Owner of (Triggering unit)) at (Position of (Triggering unit)) facing Default building facing (270.0) degrees) else do (Do nothing)
-
Events
-
Unit - Add a 5.00 second Generic expiration timer to (Last created unit)
- If ((Level of Spellbeingmade for (Triggering unit)) Equal to 2) then do (Unit - Create 6 Dummy for (Owner of (Triggering unit)) at (Position of (Triggering unit)) facing Default building facing (270.0) degrees) else do (Do nothing)
-
Unit - Add a 5.00 second Generic expiration timer to (Last created unit)
- If ((Level of Spellbeingmade for (Triggering unit)) Equal to 3) then do (Unit - Create 8 Dummy for (Owner of (Triggering unit)) at (Position of (Triggering unit)) facing Default building facing (270.0) degrees) else do (Do nothing)
-
Unit - Add a 5.00 second Generic expiration timer to (Last created unit)
- Unit Group - Pick every unit in (Units of type Dummy) and do (Unit - Order (Picked unit) to Attack Ground ((Position of (Triggering unit)) offset by (Random real number between 300.00 and 650.00) towards (Random angle) degrees))
Demo Of The Spell View attachment Demo Spell.w3x
Section 2
Dummy Casting Units
In section one you learned about dummy units and now know how to make a simple spell with dummy units. This time, instead of the dummy being an attacking demolisher, we will make the dummy cast. Making dummy units casting spells can be tricky, though, so I will give you some basics.
First, to allow a dummy to cast an ability, you will need to make the ability itself. This is pretty easy and all. Remember to base the ability off of the type of spell it is (if its a simple click base it off of war stomp etc..). Here are some things to keep in mind:
You cant have 2 abilities both based off of the same ability.
(Example, a unit may not have two spells based off of war stomp, if you do, it will cause the spell to glitch or not work).
If the ability will be casted once, make the cooldown very long (like 9999) to prevent the ability from being casted twice. You may want to do the same with manacost.
If the ability involves multi-casting, make the cooldown short and make the manacost 0. If the unit should only cast like say 5 times, make the spell cost 1 mana, make the unit have 5 mana, give the unit no mana regain.
Doing these will help your ability leak ALOT less!
Part B
Now this tutorial will teach you the basics of triggering the ability. If you did not read the above "Section 2" then do so now or risk having a poorly made spell. As I said earlier, "a unit may not have 2 of the same ability or based ability on them", this is important.
Side note: Remember what you based the spell off of.
Lets say we wanted a entangling root spell just like the one that Keeper of the Grove has exept we want it to root a random target and make it a simple click spell. You may be thinking that its hard, but rest assure, if you can do the first spell I made, this will be cake. The thing is, the click root spell that your hero has (assuming you made one and you based it off of warstomp or something by that means) is just a dummy itself. Your dummy spell triggers a dummy unit whom activates the real spell. Confusing? You wont be for long.
Creating a Simple Dummy Casting Spell
First off, make a dummy spell based off of warstomp (I always use it as a base). Name is Root or something by that means, remove the damage and everything exept the cooldown (keep it at 8 seconds). Make desired tooltips and such.
Second, make a dummy unit (something like a shaman) and make sure it has no shadow, has the locust ability, has invulnerable and remove the model file. This is simaller to the dummy demolisher unit. Remove its attack and movespeed as well. This will make the dummy not move and not screw up the spell. Once your dummy unit is finished, move onto the next paragraph.
Third, make another spell but this time, base it off of entangling roots, make it unit, and modify whatever you want the spell to do (damage, seconds rooted etc..). All that really matters is the damage and seconds rooted, the rest like the cooldown wont work because the dummy will be removed in a few seconds. It is important for this to be a unit spell and not hero.
Forth, Now that your dummy spell, your dummy unit, and your real spell that does all the work are set, its time for the obvious triggering part.
All triggers (unless activated by another) require an action, so lets just use this one.
-
Events
- Unit - A unit Begins casting an ability
-
Conditions
- (Ability being cast) Equal to Roots
Now we must create the dummy unit.
- Unit - Create 1 Dummy For Roots Spell for (Owner of (Triggering unit)) at (Position of (Triggering unit)) facing Default building facing (270.0) degrees
- Set StoreUnit = (Last created unit)
I like to have a small wait function in all my triggers to make sure the thing registers.
- Wait .20 seconds
Now, we must make the unit that we just created (the dummy) cast the ability. Now do this:
- Unit - Order StoreUnit to Night Elf Keeper Of The Grove - Entangling Roots (Random unit from (Units within 900.00 of (Position of (Last created unit))))
Well, there you go, a completed spell that took lower then 8 actions to make. If you want to make sure that dummy unit goes away then add this at the bottom of the trigger
- Unit - Add a 5.00 second Generic expiration timer to StoreUnit
Last edited: