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

Passive effect using the item using trigger, help me!

Status
Not open for further replies.
Level 3
Joined
Oct 20, 2017
Messages
52
Hello,
sorry for my bad english, but i'm having trouble creating a trigger for my map, however i'm not very experienced with it.
How it would be: I wanted to create a passive effect of an item using a trigger that when the hero is in his inventory the item would have the effect, every time he uses a skill that causes damage to the target (either single target or area damage) he would activate the Forked Lightning ability on the first target that took damage and will have a cooldown for that effect. Is it possible to create a trigger with this effect or something similar?
 
Level 14
Joined
Nov 17, 2010
Messages
1,265
Basically you would just want to use a unit casts an ability event. Then you would check to see if the caster has your item in their inventory and make sure it is the correct unit. Then make a dummy cast forked lightning on the target unit of ability being cast. You will turn of the trigger then start a countdown timer to turn the trigger back on after the cooldown.
Im not sure what the best way to get the item to trigger its cooldown would be.
If I were on my computer I would give you an example trigger, but I’m on my phone at the moment.
 
Level 3
Joined
Oct 20, 2017
Messages
52
The part of the trigger detecting if the user has the item and creating an invisible dummy to use the ability I can do, but the part of applying the effect of the skill that I am not getting, in target skills I can apply the effect, but the area damage skills I can't, I'm looking for a way for the trigger to detect the first target that took the damage so that that target is the target of the item's passive ability.
 
Level 14
Joined
Nov 17, 2010
Messages
1,265
What if you made a unit group from all of the units in the target area and when one of them takes damage you run the trigger. You would need a DDS for that, but it might work
 
Level 3
Joined
Oct 20, 2017
Messages
52
What do you mean DDS? Just to let you know that I'm editing my map in version 1.26
 
Level 3
Joined
Oct 20, 2017
Messages
52
I didn't understand why DDS can help with my map, and I don't understand anything about JASS or vJASS, nor do I know how to import it into my map.
 
Level 28
Joined
Feb 18, 2014
Messages
3,579
  • Cast Spell
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • ((Triggering unit) is A hero) Equal to TRUE
      • ((Triggering unit) has an item of type Crown of Kings +5) Equal to TRUE
    • Actions
      • Set Point = (Position of (Triggering unit))
      • Set Group = (Random 1 units from (Units within 600.00 of Point matching (((Matching unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to TRUE)))
      • Unit - Create 1 DUMMY for (Owner of (Triggering unit)) at Point facing default building facing degree
      • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
      • Unit - Add Forked Lightning (Item) to (Last created unit)
      • Unit Group - Pick every unit in Group and do (Actions)
        • Loop - Actions
          • Unit - Order (Last created unit) to Neutral Naga Sea Witch - Forked Lightning (Picked unit)
      • Custom script: call RemoveLocation (udg_Point)
      • Custom script: call DestroyGroup (udg_Group)
The only issue when this trigger however is that it cannot detect which spell cause damage and which one doesn't (Like instant cast spell) So it will fire whenever the hero cast any spell. But you can limit it by adding conditions like these :

(Ability being cast) Not equal to Summon Water Elemental
(Ability being cast) Not equal to Avatar
(Ability being cast) Not equal to Raise Dead
etc...
 

Attachments

  • Passive Effect Item.w3x
    19.5 KB · Views: 15
Level 3
Joined
Oct 20, 2017
Messages
52
  • Cast Spell
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • ((Triggering unit) is A hero) Equal to TRUE
      • ((Triggering unit) has an item of type Crown of Kings +5) Equal to TRUE
    • Actions
      • Set Point = (Position of (Triggering unit))
      • Set Group = (Random 1 units from (Units within 600.00 of Point matching (((Matching unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to TRUE)))
      • Unit - Create 1 DUMMY for (Owner of (Triggering unit)) at Point facing default building facing degree
      • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
      • Unit - Add Forked Lightning (Item) to (Last created unit)
      • Unit Group - Pick every unit in Group and do (Actions)
        • Loop - Actions
          • Unit - Order (Last created unit) to Neutral Naga Sea Witch - Forked Lightning (Picked unit)
      • Custom script: call RemoveLocation (udg_Point)
      • Custom script: call DestroyGroup (udg_Group)
The only issue when this trigger however is that it cannot detect which spell cause damage and which one doesn't (Like instant cast spell) So it will fire whenever the hero cast any spell. But you can limit it by adding conditions like these :

(Ability being cast) Not equal to Summon Water Elemental
(Ability being cast) Not equal to Avatar
(Ability being cast) Not equal to Raise Dead
etc...
Thanks, it doesn't work the way I wanted, but it's similar to what I wanted, I did some tests and it worked the trigger you gave me. Thank you ^^
 
Status
Not open for further replies.
Top