• Check out the results of the Techtree Contest #19!
  • 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.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

Trigger for when unit its channeling an ability

Level 7
Joined
Sep 10, 2023
Messages
112
Hello I have this trigger for when a unit is channeling an ability, but I want it to remove the created unit when the initial casting unit gets interrupted or finishes channeling the ability.

Also I want to ask, you can make only the created units casts the preset abilities thats on the list or you can make them cast custom skills?

  • Oratio Redemptis
    • Events
      • Unit - A unit Begins channeling an ability
    • Conditions
      • (Ability being cast) Equal to Oratio Redemptionis
    • Actions
      • Set VariableSet PaladinPosition = (Position of (Triggering unit))
      • Unit - Create 1 Oratio Redemption Tranquility for (Owner of (Triggering unit)) at PaladinPosition facing (Position of (Triggering unit))
      • Unit - Order (Last created unit) to Night Elf Keeper Of The Grove - Tranquility.
 
Stops casting is whenever the unit stops casting. It will always occur if the ability has started casting. Finishes casting is basically only used for channeled abilities to detect if it was successfully cast for the entire duration.

Custom abilities will use the same order from the list as it was based on. So if you make a custom ability from War stomp it will be War stomp from the list.
 
hey there i think i have made what you need. so i made if the casting unit stops or finishes it channeling the ability and i made the skill in to that a dummy is being made and that cast the spell
  • start
    • Events
      • Unit - A unit Begins channeling an ability
    • Conditions
      • (Ability being cast) Equal to Tranquility
    • Actions
      • Set VariableSet TempPoint = (Position of (Triggering unit))
      • Set VariableSet TempInteger = (Custom value of (Triggering unit))
      • Set VariableSet TempInteger = (TempInteger + 1)
      • Unit - Set the custom value of (Triggering unit) to TempInteger
      • Unit - Create 1 Dummy Unit for (Owner of (Triggering unit)) at TempPoint facing Default building facing degrees
      • Unit - Add Tranquility to (Last created unit)
      • Unit - Order (Last created unit) to Night Elf Keeper Of The Grove - Tranquility.
      • Set VariableSet OratioDummy[TempInteger] = (Last created unit)
      • Custom script: call RemoveLocation(udg_TempPoint)
  • end
    • Events
      • Unit - A unit Stops casting an ability
      • Unit - A unit Finishes casting an ability
      • Unit - A unit Is issued an order with no target
      • Unit - A unit Is issued an order targeting a point
      • Unit - A unit Is issued an order targeting an object
    • Conditions
      • Tranquility Equal to Tranquility
    • Actions
      • Unit - Remove OratioDummy[(Custom value of (Triggering unit))] from the game
      • Set VariableSet OratioDummy[(Custom value of (Triggering unit))] = No unit
but if you add in Unit - Add a x second Generic expiration timer to (Last created unit) insted you dont need 2 trigger
 

Attachments

Last edited:
The condition in end trigger seems sus. It looks like a tautology to me.
End trigger requires only single event: Stops casting an ability - that event will be fired when finishing/cancelling cast no matter what.
You should also make sure that you use proper conditions in End trigger if OratioDummy is shared across multiple triggers/spells, as the End trigger is generic enough to remove dummy even when unit did something else than stop casting Tranquility.
 
Stops casting is whenever the unit stops casting. It will always occur if the ability has started casting. Finishes casting is basically only used for channeled abilities to detect if it was successfully cast for the entire duration.

Custom abilities will use the same order from the list as it was based on. So if you make a custom ability from War stomp it will be War stomp from the list.
So you can only modify the base war stomp? Because I have many spells that are copy of melee spells but with different names and values, I cant use those right?
 
No. When you create a custom spell based off Warstomp and you want a unit to cast that custom spell (assuming unit has that spell), you issue an order to that unit to cast Warstomp (the original spell your custom one is based off).

It may sound strange at fist, but simply put each base spell has an order string. Those order strings are kind of unique across base spells. It is those order strings you use when you issue an order to a unit via triggers.
When you create a custom spell it inherits the base spell's order string. There are a few exceptions, but the general rule is that order strings cannot be changed.
It is also the reason why a single unit cannot have two custom spells based off same base spell - because when you give an order to the unit to cast one of them, there is an order string clash.
 
I think I didn't express myself clearly. The original skill is Starfall, that's the initial spell. I want a dummy to be created at the caster's position when Starfall is cast, and that dummy should cast Tranquility. But I also want the Tranquility casting to be interrupted if the Starfall casting is interrupted.

So I guess I have to make a trigger for ending the cast of tranquility, now I have to remove the dummy in the actions but cant find how, is there a way to link one trigger with another? or maybe I have to add the end event with the first trigger. Im confused. This is probably not that hard

  • Oratio Redemptis End
    • Events
      • Unit - A unit Stops casting an ability
    • Conditions
      • (Ability being cast) Equal to Oratio Redemptionis
    • Actions
      • Unit - Remove (Ordered unit) from the game
 
Last edited:
Ok I made it

This is the start trigger
  • Oratio Redemptis Start
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Oratio Redemptionis
    • Actions
      • Set VariableSet PaladinPosition = (Position of (Triggering unit))
      • Unit - Create 1 Oratio Redemption Tranquility for (Owner of (Triggering unit)) at PaladinPosition facing (Position of (Triggering unit))
      • Set VariableSet Oratioredempiotranquility = (Last created unit)
      • Unit - Order (Last created unit) to Night Elf Keeper Of The Grove - Tranquility.
and this is the end

  • Oratio Redemptis End
    • Events
      • Unit - A unit Stops casting an ability
    • Conditions
      • (Ability being cast) Equal to Oratio Redemptionis
    • Actions
      • Unit - Remove Oratioredempiotranquility from the game
Now I want to remove the points and all to make the trigger more efficient, any tips? should make something like custom script that removes the point?
 
Back
Top