Triggering - Event Response "Unit being targeted by item"?

Ouguiya

New Member
Reaction score
11
Solved: Triggering - Event Response "Unit being targeted by item"?

Hello everyone!

I hope someone can help me with this problem, as it's really not easy (at least for me) to solve.

The problem is as follows: I have created an item, let's call it item X, which is powerful to use. As such, I want to create an item to defend against Item X.

The plan is that the defensive item (Let's Call it Item W), has to be used, like a potion. Once used, it gives its user a buff.

Now, a trigger has to be made. The event of course being: "A unit uses an item".

Next, two conditions have to be evaluted:

1) Itemtype of (Item being manipulated) is equal to "Item X"
2) Targeted unit has specific buff

The only problem is that when looking at all the possible "unit types" for the condition, there is an "event response" unit for anything, the unit who is being attacked, the unit which has changed owner, bla bla... but not for the unit which was targeted by the item.

I also don't know how to get around the problem. Using an "ability being cast equal to" does not work, using "Unit targeted by spell" does not work either.

What I want to ask here, is if someone has an idea how to circumvent the lack of the event response - unit targeted by the item, or if someone knows a jass function for it, or something similar.

Thank you all in advance.

Yours,

Ouguiya
 

Curo

Why am I still playing this game...?
Reaction score
109
Try the event Unit - Starts the effect of the ability. I believe this is how you trigger item spells because they are in essence abilities. And watch your wording, you seem to be using "condition" and "event" interchangeably in some areas of your post.

You said an ability comparison condition didn't work, but I think that's because you were using the wrong event (a unit uses an item).
 

Exide

I am amazingly focused right now!
Reaction score
448

Ouguiya

New Member
Reaction score
11
Hello!

Thank you two for the quick replies.

To the first reply: I really would like to avoid the "Starts the effect of an ability", since I am already using around 50-60 triggered spells in this map, which all use the "starts effect of an ability", which I had to use certain tricks to stop them from laming down the entire map.

Adding yet more of these trigger with even more conditions would hammer the map performance if 12 people were to play it.

To the second answer: I want to thank you for the post you kindly provided. Sadly, even in that post, there was no concrete result given (the problem also was a bit a different one). They also suggest the "Starts the effect of an ability", but I truly wish to avoid this to cause any further memory use whenever a unit uses a spell (which will happen a lot).

Thanks again, but sadly, this does not totally resolve the case.
 

Ouguiya

New Member
Reaction score
11
Solution found

Hello again everybody!

I want to thank the two who have answered the post once again. After looking through the answers (and the provided post) a bit, I have found the solution to multiple problems.

To quickly name the solution:

The spells (which would have lagged the game) will all be put into one trigger, with a condition which is only fulfilled with all the spells.

Thus, I am able to use the first suggestion, and use the "starts the effect of an ability", hoping that this will work. If so, the problem is solved.

I thank again all who have taken the time to look through or even answer to this post.

Yours,

Ouguiya
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top