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

How to make it if Caster Unit moves, attack, etc. the trigger is cancelled?

Status
Not open for further replies.
Level 5
Joined
Mar 18, 2023
Messages
52
Hi. I'm a recent scrub to WE and been messing around. I made this trigger for a custom Mass Teleport to affect surrounding allied heroes instead of your own units. I want to make it that if the Caster does aynthing besides standing in one place, the trigger will cancel. It'll basically act like a normal channeling spell. I'll also post a Video Example of it just incase. But yeah, big thanks if someone can help me with this!

Mass TP OG
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Jaina's Mass Teleport
Actions
Set VariableSet MassTPUnit = (Casting unit)
Set VariableSet MassTPUnitAOE = (Position of MassTPUnit)
Set VariableSet MassTPTarget = (Target point of ability being cast)
Unit - Create 1 TP Dummy (Jaina) for (Owner of (Casting unit)) at MassTPUnitAOE facing Default building facing degrees
Animation - Change (Last created unit)'s animation speed to 400.00% of its original speed
Unit - Add a 5.00 second Generic expiration timer to (Last created unit)
Wait 5.00 seconds
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(MassTPUnit is alive) Equal to True
(MassTPUnit has buff Stunned (Pause)) Equal to False
(MassTPUnit has buff Sleep (Stun)) Equal to False
(MassTPUnit has buff Stunned) Equal to False
(MassTPUnit has buff Entangling Roots) Equal to False
Then - Actions
Unit Group - Pick every unit in (Units within 400.00 of MassTPUnitAOE matching ((((Matching unit) belongs to an ally of (Owner of MassTPUnit).) Equal to True) and (((Unit-type of (Matching unit)) is A Hero) Equal to True)).) and do (Actions)
Loop - Actions
Unit - Move (Picked unit) instantly to MassTPTarget
Unit - Create 1 TP Dummy (Jaina) for (Owner of (Casting unit)) at MassTPTarget facing Default building facing degrees
Sound - Play MassTeleportTarget <gen> at 60.00% volume, attached to (Last created unit)
Animation - Change (Last created unit)'s animation speed to 700.00% of its original speed
Unit - Add a 0.90 second Generic expiration timer to (Last created unit)
Else - Actions
Custom script: call RemoveLocation(udg_MassTPUnitAOE)
Custom script: call RemoveLocation(udg_MassTPTarget)
 
Level 8
Joined
Apr 26, 2020
Messages
62
May this prove useful:
zzz.gif
Wait until ((Current order of Hero) Not equal to (Order(hold position))), checking every 0.75 seconds
For you must switch the (hold position) to (channeling) to be done.

I used this in [GUI] - Backpack Inventory System for Rpg (Eazy, Simple, Compatible)
 
Level 24
Joined
Feb 27, 2019
Messages
833
This should work for the original mass teleport if teleported units are set to 0 by holding shift before pressing the field but it should work for any channeling ability. To set a negative value, negative values have to be enabled. In the editor, press File > Preferences > General and tick the box for allow negative values. Its also suggested to tick automatically create unknown variables.

Trigger 1 - Begin spell
Unit - A unit Begins channeling an ability
Turn on trigger 2 and 3

Trigger 2 - Cancel spell
Unit - A unit Is issued an order targeting an object
Unit - A unit Is issued an order targeting a point
Unit - A unit Is issued an order with no target
Turn off trigger 2 and 3

Trigger 3 - Finish spell
Unit - A unit Finishes casting an ability
Turn off trigger 2 and 3
 
Status
Not open for further replies.
Top