• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] Ability Clicked event

Status
Not open for further replies.
Level 28
Joined
Feb 18, 2014
Messages
3,579
Maybe something like this:

Events:

A unit is issued an order targeting an object
A unit is issued an order targeting a point
A unit is issued an order with no target

Conditions:

Issued order Not Equal to (move)
Issued order Not Equal to (attack)
Issued order Not Equal to (smart)
Etc...

Actions:

Do what you want here

Edit: Or you can check when a unit loses mana (if the ability cost mana though)

Edit 2: Actually, you can just use "A unit starts the effect of an ability" I totally forgot about that! :p
 
Last edited:

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,537
There is no generic way of doing this as far as I'm aware, but this works for a specific ability:
  • Events
    • Game - Button for ability Shockwave and order Orc Tauren Chieftain - Shockwave pressed.
This Event runs when you click the Ability button or press it's hotkey. It's very useful!
 
Last edited:
Level 8
Joined
Feb 17, 2018
Messages
114
What if you used some no target ability (like fan of knvies for example) since it requires no traget and is used when clicked, then trigger if unit casts this spell it will remove te unit or am I missing something?
 
Level 12
Joined
Feb 5, 2018
Messages
521
  • Yay
    • Events
      • Game - Button for ability Shockwave and order Orc Tauren Chieftain - Shockwave pressed.
    • Conditions
    • Actions
      • Custom script: local integer i = GetUnitTypeId(GetTriggerUnit())
      • Custom script: local integer ii = GetUnitUserData(GetTriggerUnit())
      • Custom script: local player p = GetTriggerPlayer()
      • Custom script: local integer iii = GetPlayerId(p)
Try some of these. :D

EDIT: It just actually refers to triggering unit, so no need to do anything fancy.

  • Yay
    • Events
      • Game - Button for ability Shockwave and order Orc Tauren Chieftain - Shockwave pressed.
    • Conditions
    • Actions
      • Game - Display to (All players) the text: (Name of (Owner of (Triggering unit)))
      • Game - Display to (All players) the text: (Name of (Triggering unit))
 
Last edited:
Status
Not open for further replies.
Top