Hello, so here's how you can post your triggers, doing so will make your life easier and make it easier for others to assist you.
TopHow To Post Your Triggers I've seen many members across the site—especially newcomers—who need help with their triggers but don't know how to properly post them in a thread. Posting your triggers clearly is very important when you're asking others for help in fixing or identifying issues...
www.hiveworkshop.com
Suggested fixes:
1) Change the Event from "Begins casting an ability" to "Starts the effect of an ability". Begins is like the pre-cast stage which can be cancelled. This Event is often used to introduce your own "Targets Allowed" requirements and Order the caster to cancel the spell manually if need be.
2) Change (Targeted unit) to (Target unit of ability being cast). That Event Response is meant to be used with the "Acquires target" Event. When choosing an Event Response, check to see if there's a "tip" tooltip near the bottom of the window that explains what Event it's meant to be used with.
3) I have no idea if (Previous owner) works, I've never used it before and didn't even know it existed to be honest. If the unit doesn't change back then assume this could be part of the reason why.
4) This trigger will break the moment you cast Madness on a unit that already has the Madness buff. When a trigger executes, it creates a new instance of itself. Multiple instances can exist at a time. These instances don't know about one another and will not work together (unless specifically designed to do so). In other words, your first instance of the ability will interfere with the second instance.
For example, here's a timeline of events when casting it twice on the same unit, with [
Timestamps]:
[
0:00] You cast Madness on the Paladin, changing it to Neutral Hostile, and starting a 15.00 second Wait.
[
0:02] You cast Madness again on the same Paladin, changing it to Neutral Hostile again, and starting a completely separate 15.00 second Wait.
[
0:15] The first Madness's Wait will have finished and the unit's ownership will change back to it's "Previous owner".
[
0:17] The second Madness's Wait will have finished and the unit's ownership will change back to it's "Previous owner".
See the issue? The first cast is going to end the second cast early. What you need to do is avoid using Waits and instead design your trigger to work similar to a stopwatch, where each time you start it you either start a fresh timer OR restart an existing timer. In other words, each Unit should only ever have one "Madness Buff Timer" running at a given time.
Here's an example of a temporary Charm effect I've made for someone in the past that avoids the issue mentioned above:
Hi all :) Ive seen many different posts about mind control and temporary charm triggers, but none of them meet my request... Im trying to figure out how to make a trigger for an item ability. Hardly tried to change the other already existed triggers of a temporary charm but didnt work at all...
www.hiveworkshop.com
Note that you'd want to check for a Buff -> "If Charm_Unit has buff Madness Equal to False" in the
Charm Loop trigger to ensure that the effects end early if the Buff is dispelled. So you'd check for that in addition to checking the
Charm_Duration.
-
Charm Loop
-

Events
-


Time - Every 0.05 seconds of game time
-

Conditions
-

Actions
-


Unit Group - Pick every unit in Charm_UnitGroup and do (Actions)
-



Loop - Actions
-




-------- If the Duration is <= 0.01 then it's finished: --------
-




If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-





If - Conditions
-






Or - Any (Conditions) are true
-







Conditions
-








Charm_Duration[Charm_CV] Less than or equal to 0.01
-








(Charm_Unit has buff Madness) Equal to False
-





Then - Actions
-





Else - Actions
^ I deleted the other Actions to help clarify what needs to be changed here. Do not actually delete anything.