how to auto cast a spell

0rcL0rd

New Member
Reaction score
1
hi

I want to auto cast a Spell named GroundPuller, its the same ability as Ensnare, but i want it to autocast, (Its for a Tower).
 

Idontknowyou

New Member
Reaction score
33
Add Units to Entangle Group
Trigger:
  • Events
    • Unit - A unit enters (Playable map area)
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to EntangleTower
    • Actions
      • Unit Group - Add (Triggering unit) to EntangleTowers



Autocast Entangle
Trigger:
  • Events
    • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in EntangleTowers and do (Actions)
        • Loop - Actions
          • Set TempPoint = (Position of (Picked unit))
          • Set UnitsInRange = (Units within 500.00 of TempPoint)
          • Unit - Order (Picked unit) to Night Elf Keeper Of The Grove - Entangling Roots (Random unit from UnitsInRange)
    • Custom script: call RemoveLocation (udg_TempPoint)
    • Custom script: call DestroyGroup (udg_UnitsInRange)


This should work, let me know if it doesn't.

You should make the time period the cooldown of the spell, and you should set the value for "units within range of temp point" to be the range of the spell.




You could also spawn a dummy unit which casts entangle whenever the tower attacks if you'd rather do that.
 

Idontknowyou

New Member
Reaction score
33
This'll cause all towers to cast entangle at the same time though :O

This is true, although, if you make the periodic timer very short (0.1 or less), the towers should entangle units shortly after they come within range, their Cool downs will make it so that they don't always Cast at the same time.


The dummy spawn method will not have the synchronized casting issue, but will also be much more laggy.
(and TDs tend to lagg enough as it is)
 

jomik

New Member
Reaction score
17
Well, I guess they would no matter what since it's a TD, and the creeps comes in waves.
So they'd probably all have their cooldown reset. So, I'd say you should make a periodic timer with (Cooldown of ability + 0.10) or something
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top