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

Trigger that auto-casts a unit's spell?

Status
Not open for further replies.
Level 3
Joined
Dec 19, 2004
Messages
23
Just what it says, I need help making a trigger that makes a unit cast a spell automatically when a unit comes in range. Thanks.
 
Level 3
Joined
Dec 19, 2004
Messages
23
Okay 2 questions. First, what function do I use to direct the trigger to every Prist [level 1] made? So far I have

Event
Unit - A unit comes within 500.00 of Priest [Level 1] 0218 <gen>

Condition

Action
Unit - Order Priest [Level 1] 0218 <gen> to Special Archimonde - Finger Of Death to (Triggering unit)

Which brings me to question number 2. After the unit comes in range my guy doesn't keep repeating casting the spell. It's a one shot deal. How do I make it so Priest [Level 1] continually casts the spell to anyone in range? Thanks.
 
Level 9
Joined
Nov 27, 2004
Messages
465
every time when unit with this buffer or without it will enter your priest area PRIEST ALWAYS will cast it !

it's ,of course, an autocast, but not as good as it could be..

You may add some conditions such as
(for healing)

event
Unit enters the Priest [level 1] (500 500)
Condition
entering unit health < max health
Action
Priest cast healing on entering unit

Eusira may we loop this trigger for curent unit
i mean this thing:

event
Unit enters the Priest [level 1] (500 500)
Condition
entering unit health < max health
Action
Priest cast healing on entering unit
reapeat cast health on entering unit until entering unit max health = health
 
Level 8
Joined
Apr 3, 2004
Messages
507
Maybe you should find an autocast ability that is used by AI in situations like the one you're trying to create, and use it as a dummy for a triggered effect.

For example, if you want it to be cast on all moving enemies within the cast range, use Slow as the base spell and trigger an effect that, when Slow is cast, something else happens.

Seems like a more straightforward and substantially less intense trigger.
 
Level 3
Joined
Dec 19, 2004
Messages
23
I would use your suggestion, Vampirekb, but I was this tower to be able to stand alone against rushes and according to the triggers, he only attacks wounded enemies.

Panto's idea with using an autocast ability that would automatically hit enemies seems like it would work. But What abilities autocast on enemies? The only problem with making it based on an auto cast ability is i couldnt make it bounce like chain lightening, that was my plan. Thanks.
 
Level 9
Joined
Nov 27, 2004
Messages
465
Autocast on enemy the first ability i remember is an ability of Sorceress "slow" as Panto said

about wounded units...
i don't know the reaction of an autocast,because it will be always attack 1 unit before it die.

With entering the region all will be better, BUT it will be attack only once.. (condition if attacked unit HP < attacked max unit hp)
 
Level 8
Joined
Apr 3, 2004
Messages
507
Sure, you could have it bounce. The Slow, or Faerie Fire, or Web, or whatever autocast-on-enemies skill you use is only a dummy spell to make an efficient event for your trigger.

Your trigger, then, would make a modelless invulnerable locust'd dummy caster unit at the position of the Slow-casting unit, order that dummy to Chain Lightning (or whatever bouncing spell you wanted), and then kill that dummy caster. You could do this with any spell you wanted. However, you'd want to make sure that the buff of whatever autocast spell you use is set to last very short, because the AI won't attempt to re-cast on a unit that already has the buff (and it's not pretty to leave unnecessary buffs lying around).
 
Level 3
Joined
Dec 19, 2004
Messages
23
Okay this is the trigger so far.

Events
Unit - A unit Begins casting an ability

Conditions
(Ability being cast) Equal to Sanctity [dummy]

Actions
Unit - Create 1 Dummy Caster for (Owner of (Casting unit)) at (Position of (Casting unit)) facing (Position of (Triggering unit))

The last thing I need is an action that orders the Dummy Caster to cast the spell against the reciver of sanctity [dummy]. What would I use is <
Unit - Order (Last created unit) to Attack (Random unit from (Units within 500.00 of (Position of (Triggering unit))))> but where I put attack I would enter the custom spell but the window that attack is in doesn't have my custom spells it just has the basic hero spells. Thanks.
 
Level 8
Joined
Apr 3, 2004
Messages
507
Firstly, instead of using (Triggering Unit) you'll almost certainly want (Target Unit of Ability Being Cast).

Secondly, what's your dummy spell based off of? Pretty much all of the root spells are available in that list, and since it's the orderstring and not the four-letter id that it needs, the root spell orderstring will be just fine for ordering your triggered-caster.
 
Status
Not open for further replies.
Top