I've a WeakAura that checks if someone used Counterspell and the trigger condition is just a generic hostile combatlog trigger (so any hostile unit using counterspell pops a 24sec CD icon and clones on duplicate events)- however, mages have a talent that reduces the cooldown in case the spell was successful - this can easily be usually done via a secondary trigger that checks if it interrupted, however, you need the ID of the unit. Is there a way to carry over the unit from trigger1 to trigger2 to check for that specific cloned instance and modify it accordingly?
#On cloned auras - are secondary triggers related to primary trigger? If not, how can I link it
25 messages · Page 1 of 1 (latest)
Triggers are independent of each other, so your idea doesn't work
I see. How could I grab the caster ID from the first trigger and forward it to second trigger?
I assume "%1.unitID" as a specific unit wouldn't work
Or is this simply impossible to do
this would involve guess work based on the timing of the events. You would have to assume that any counterspell that gets cast has a chance of interrupting something then check if another spell Interrupt event happens in the next 0.2 sec or so. then associate the events, but this would incorrectly associate any interrupt event that occurs with the couterspell. which would be wrong if for example 2 or more players press their interrupt at the same time which happens fairly often.
you could get a bit more specific by also checking the target of the counterspell but you still have the same issue as above if 2 or more players try to interrupt the same target which is again fairly common
That's way too clunky and unreliable. I guess two viable options are either making a custom code WeakAura that stores caster info then checks for both cast success and successful interrupt or making a specific unit weakaura so I have a caster source readily available to compare
Actually - what's the firing order for triggers in WeakAuras? Does the first trigger always get checked first before the second?
If yes then what could be done is a custom trigger function that checks either of the triggers but not both, and place trigger 1 to be spell->interrupt->counterspell with the proper reduced cooldown, trigger 2 to be ordinary counterspell cast
If the caster interrupts someone trigger 1 is fired and trigger 2 is ignored, if caster doesn't interrupt anyone trigger 2 is fired - is my logic sound or would this just create two clones of the same caster interrupting
Trigger State Updater is an advanced custom trigger type that allows for the creation of clones, as well as generally being a very flexible custom trigger for almost all situations. While it is complex, the wiki aims to be thorough so please do use it.
https://github.com/WeakAuras/WeakAuras2/wiki/Trigger-State-Updater-(TSU)/
That was something I was trying to avoid. My solution did work though, kind of, except it showed the longer aura after the first trigger finished.
Please do not spread related questions in multiple places. I will close your other post.
It's not related only to this problem though, is it not? It's quite a general question someone might find useful
It's deeply linked with this question and is then missing important context.
And the answer is you don't. You make a custom trigger. Don modify the internal variables.
In my case it is, yes, but it's also something that if answered in a separate thread is vague enough to be useful to someone else. It's not "pollution" IMO if someone in the future can pop "aura_env.state.expirationTime" in search bar and stumble upon it and maybe it's related to their question.
That's the same way I stumbled upon some other solutions and didn't have to open my own thread. I respectfully disagree with your decision the same way I disagree with people on StackOverflow doing the same.
As for your other reply, why not though? Is there a specific reason why tampering with internal variables is bad
I miss context
I gave up on the first idea of having a general hostile trigger because it would require a custom trigger (probably).
My secondary idea was to have a custom trigger function that tracks only trigger 1, which tracks specific unit's cast success in combatlog. Second trigger would check if it was a successful interrupt and would reduce the expirationTime by 4 but it'd reduce the expiry time on the aura itself and not hide it when the expiry time ended and it'd linger for the full duration of trigger1's timed event. I've made a different thread regarding the issue (asking how to reduce the internal duration because apparently modifying expirationTime doesn't modify the trigger duration from first trigger) because I felt it would be useful to someone else and wasn't connected to my previous idea.
Anyway I've solved it for anyone in the future who might have a similar question.
Trigger 1 is the combat log trigger that tracks spell success and times it to 24 seconds.
Trigger 2 is a spell interrupt trigger that fires off for 0.5 seconds.
Trigger 3 is a delayed spell interrupt trigger that fires off for 0.5 seconds after 18 seconds have expired
Condition 1 checks if trigger 2 is active then fires off custom code: aura_env.state.expirationTime=aura_env.state.expirationTime-4
Condition 2 checks if trigger 3 is active then fires off custom code: aura_env.state.show = false
It's not elegant or sophisticated by any means but it works
It's not a good solution, so if anyone have a similar question answer is still to make a TSU
I agree but not everyone knows LUA and asking for LUA help here is a hit or miss (which is perfectly fine, it's not a job for anyone here to help everyone with their stuff), so dirty solutions are kinda needed sometimes
