• 🏆 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!

Triggering abilities via items

Status
Not open for further replies.
Level 5
Joined
Jul 15, 2018
Messages
111
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 64
Joined
Aug 10, 2018
Messages
6,537
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:
Status
Not open for further replies.
Top