• 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.

Single Target Spell for Multiple Units

Rheiko

Spell Reviewer
Level 25
Joined
Aug 27, 2013
Messages
4,121
I just want to share my experience and knowledge with others and i don't think everyone knows about this. Especially those who just starts modding.​
Be aware that I don't recommend this tutorial if you don't understand basic triggering yet.​

Things You May Need

  • You must understand English
  • You have Warcraft III and World Editor
  • Knowledge about Triggers/Trigger Editor
  • Knowledge about Object Editor

Introduction

Did you ever wonder how to use a single target ability against multiple units?​
For example: Sleep, you can only use Sleep against single unit/target but you want to use it against multiple units, like units within range or something.​
We need a little bit of triggering to do this.​
If you think triggering is hard to understand, it is not as hard as you think! but i will try to explain it to you as simple as i can.​

Lets get this started

Without further ado, let's get down to the business. We will start with Object Editor then we will use trigger. We will make a Sleep ability with instant cast which will put units within range to sleep.​

Object Editor

I believe you're already familiar with Object Editor, so let's create the base ability. We will use Roar for this.​
  • Create a New Ability based on Roar (You may use any other instant cast abilities such as; Thunder Clap, War Stomp, Battle Roar/Roar, etc)
    • Art - Caster, change it to your desired special effect, this special effect will appeared when you cast the spell.
    • Data - Damage Increase (%), change it to 0.00, because we don't want the damage increase effect from this ability.
    • Stats - Buff, delete the available value. Buff is status effect which will appeared at Unit's status bar. Note that even if we delete the buff the buff will still appear at unit's status.
    • Stats - Duration - Hero
      Stats - Duration - Unit
      , change both of them to 0.00.
    • Stats - Target Allowed, change it to none

    This will be our unit's ability. This is the ability which will we click in the game, You may change its description to whatever you like.

  • Create a New Ability based on Sleep (Because we will need Sleep buff to put units to sleep, same to stun. You could use Storm Bolt/Fire Bolt to stun your target)
    • Data - Stun Duration, i'm not sure what is this for. But i will change it to 0.00
    • Stats - Cast Range, change it to 99999 to make sure our Dummy Unit could reach the target, but this still has a problem because of visibility
    • Stats - Duration - Hero
      Stats - Duration - Unit
      , change these to your desired duration. I will change it to 2 second.
    • Stats - Mana Cost, change it to 0, so our Dummy Unit can use the ability without mana.

    This will be our dummy's ability. It's an ability where you can't see it in the game. In order to do this we will need a help from a unit to cast the ability at the enemies. This unit is what the so called Dummy.)

  • Create a New Unit, i will base it on Footman. You may use any other unit, though.
    • Abilities - Normal, Add the sleep ability and Locust ability to the list. Locust ability allows our Dummy's Hit Points and Mana bar to be hidden
    • Art - Animation - Cast Backswing, change this to 0.000 otherwise this method won't work properly
    • Art - Animation - Cast Point, change this to 0.000 otherwise this method won't work properly
    • Art - Model File, use custom path and write "Dummy" on it. Because there is no Model File with "Dummy" as a name, if you put this inside the world editor it will appear as Green Box. But in the game it will appear without any model file.
    • Art - Shadow Image (Unit), change it to none. So Dummy will have no shadow beneath it.
    • Damage, we will make the Dummy has no damage. So it won't attack enemy unit.
      • Combat - Attack 1 - Damage Base, change it to 0
      • Combat - Attack 1 - Damage Number of Dice, change it to 0
      • Combat - Attack 1 - Damage Sides per Die, change it to 0
    • Movement - Type, change it to Fly. So Dummy won't collide with other units in battlefield.
    • Movement - Speed, change it to 0 otherwise this method won't work properly.
Take it slow and just follow the steps. You will understand how it works eventually.​
Now, we will begin with the triggering part. Is it hard? No, of course not. You will be just fine.​

Trigger

  • Trigger
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Sleep
    • Actions-
      • -------- This is the guy who use the ability --------
      • Set Caster = (Triggering unit)
      • -------- The Owner of Caster --------
      • Set Owner = (Triggering Player)
      • -------- Store Caster's position into a variable --------
      • Set TempPoint = (Position of Caster)
      • -------- We create our dummy --------
      • Unit - Create 1 Dummy for Owner at TempPoint facing Default building facing degrees
      • -------- Store him into a variable --------
      • Set DummyUnit = (Last created unit)
      • -------- We gives him the dummy's sleep ability --------
      • Unit - Add Sleep (Dummy) to DummyUnit
      • -------- We gives him an expiration timer, so he won't stay in the map forever --------
      • Unit - Add a 1.00 second Generic expiration timer to DummyUnit
      • -------- Pick units within 500 range of position of the caster --------
      • Set Group = (Units within 500.00 of TempPoint)
      • Unit Group - Pick every unit in Group and do (Actions)
        • Loop - Actions
          • -------- Store the picked unit into a variable first, because we'll use them more than once --------
          • Set TempUnit = (Picked unit
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (TempUnit belongs to an enemy of Owner) Equal to True
              • ((TempUnit is alive) Equal to True)
            • Then - Actions
              • -------- Order him to use it against all units within 500 range of Position of the caster --------
              • Unit - Order DummyUnit to Undead Dreadlord - Sleep TempUnit
              • Else - Actions
      • -------- We remove potential leaks --------
      • Custom script: call RemoveLocation(udg_TempPoint)
      • Custom script: call DestroyGroup(udg_Group)

Useful Links

So how was it?​
Quite simple right?​
I hope this can be useful for anyone who read this​
and you can use the test map if you want to confirm the validity of it or if you want to learn directly from the test map. You can download it - here

Credits

I'd like to thank these guys, for supporting and helping me in order to improve this tutorial.​
And Thank you for reading all of this ^^​
My thanks doesn't apply to those who just skip the tutorial and read this part, make sure to read them thoroughly!
 

Attachments

  • Sleep Test.w3x
    18.4 KB · Views: 721
Last edited:
Level 23
Joined
Oct 20, 2012
Messages
3,075
The images aren't showing onii-san. They need some fixin'

Anyway, this is a pretty nice and simple tutorial you have. You could add some more details to what you're doing and why though.
Tutorials should be retarded proof.
Oh and Maybe add some other examples too? Like AoE Sleep, AoE Roots. They use the same process but it would still be pretty nice to add here (imo).

Still a T-up from me. This could be useful to beginners in triggering/ the WE. :)
 
  • Like
Reactions: ILH
change color. That green is horrible i can't even read the tutorial lol.

In your triggers however you should show them how to do it with only 1 dummy unit even if the spell is cast 1k times.

For this
  • Set Group = (Units within 200.00 of TempPoint matching ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of Caster)) Equal to True)))
You should get rid of the conditions and just put an ITE in your group loop.
Also you should show them how to remove dead units.
And anything used twice or more should be stored into a variable. Example: Owner of Caster.
 
  • Like
Reactions: ILH
Level 22
Joined
Sep 24, 2005
Messages
4,821
Don't forget to set the dummy's art fields Cast Backswing and Cast Point to 0.
 
Last edited:
Level 37
Joined
Mar 6, 2006
Messages
9,243
  • I would base the ability on Channel. It is best that new users learn to use that ability
  • The dummy's death type should be can't raise, does not decay so it does not decay there for 90 seconds
  • Tell people the Locust makes the dummy invulnerable. Often I see Locust paired with invulnerability ability in spells.
    The separate invulnerability ability is not needed
  • You could set the level of the dummy ability to the ability level of the caster
  • Affected units become invulnerable briefly in the test map
  • Rather than setting three values to 0 for the dummy to disable its attack, set attacks enabled to none
  • The dummy gives a huge amount of vision. Usually it is not a problem since the hero is close and give even more vision.
    Still, you could set the dummys vision to a much lesser value
  • Locust disables collision so there is no need to set the movement type to fly
 
My thanks doesn't apply to those who just skip the tutorial and read this part

Oops.


Anyways. One thing i see is that you should add in a notation and an example of how to do this type of spell using only one dummy unit for the whole game.
On any spell that you think will get used more than a few times you should consider creating only one dummy unit at the beginning of the map. You should then move that dummy unit when you need it and order it to cast the spell onto the units. ( It is not needed but it is a good suggestion for people reading your tutorial)
 
Level 20
Joined
Aug 13, 2013
Messages
1,696
Oops.


Anyways. One thing i see is that you should add in a notation and an example of how to do this type of spell using only one dummy unit for the whole game.
On any spell that you think will get used more than a few times you should consider creating only one dummy unit at the beginning of the map. You should then move that dummy unit when you need it and order it to cast the spell onto the units. ( It is not needed but it is a good suggestion for people reading your tutorial)

It is optional ^^, but i prefer creating 1 dummy in every spell per cast in group enumeration and killing the dummy.
 
Top