Triggering abilities via items

Level 5
Joined
Jul 15, 2018
Messages
112
I have a hero ability that has an added effect of turning the team of the targeted unit via triggers. How do I go about modifying the triggers so that it works as an item ability?

Working hero ability (no event):

Conditions
(Ability being cast) Equal to Madness |c0096FF96 [W]|r


If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Target unit of ability being cast) is A Hero) Equal to False
(Unit-type of (Target unit of ability being cast)) Not equal to |cffd27e00Wife|r
(Unit-type of (Target unit of ability being cast)) Not equal to |cffd27e00Husband|r
(Unit-type of (Target unit of ability being cast)) Not equal to Son
(Unit-type of (Target unit of ability being cast)) Not equal to Daughter
Then - Actions
Unit - Change ownership of (Target unit of ability being cast) to Neutral Hostile and Change color
Else - Actions



I have tried several methods for items, but no luck.

Conditions
(Item-type of (Item being manipulated)) Equal to Rage dust


Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Targeted unit) is A Hero) Equal to False
((Targeted unit) is A structure) Equal to False
(Unit-type of (Target unit of issued order)) Not equal to |cffd27e00Wife|r
(Unit-type of (Target unit of issued order)) Not equal to |cffd27e00Husband|r
(Unit-type of (Target unit of issued order)) Not equal to Son
(Unit-type of (Target unit of issued order)) Not equal to Daughter
Then - Actions
Unit - Change ownership of (Target unit of ability being cast) to Neutral Hostile and Change color
Else - Actions



Thanks in advance
 

Uncle

Warcraft Moderator
Level 44
Joined
Aug 10, 2018
Messages
4,337
I'm fairly certain that you use the "A unit starts the effect of an ability" event even for items.

Edit: Just tested it and it works. All you need to do is create an Item ability and add it to your item. Then in your trigger do this:
  • Cast Item
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Item Ability
    • Actions
      • Player - Set Player 1 (Red) Current gold to 750
 
Last edited:
Top