OK, I'll try to give explanation. Here the basic concept:
Your objective is: No enemy get hit more than once and each enemies who get hit will suffer a specific buff.
- Create a dummy unit. This dummy has attack damage equal to 1, has missile effect depending
on chain missile that you want, and has custom orb ability.
- The custom orb ability based on orb of slow ability with modified on its buff,
change the chance to hit enemy to 100%. Let say you modified the slow buff to purge buff.
- Don't forget to modify target allowed for the dummy, and attack cooldown.
Make the attack cooldown a large number, so each dummy will hit only one specified target.
Then, here's the trick:
- First prepare a unit group, make sure it was clear unit group.
- Create dummy on caster position order this dummy to attack the target of ability being cast,
gives 1 second expiration timer. Make sure the expiration timer is less than its attack cooldown,
so the dummy will die before attacks another enemy.
** - Add the target to unit group
- Wait for (distance between dummy and the target/missile speed) second
- then damage the target. In this case, the target will have purge buff.
- Do increment on the bounce counter
- Do checking, is the bounce limit has been reached? if yes, exit the loop
- Make another dummy on target position, and pick one random enemy nearby the dummy, match it.
Is the enemy already on the unit group?
- Then, order the dummy to attack it, and do it again as a loop, start on **
Note that you don't need to create exact trigger according to my explanation, as long as you get the trick behind it, then the code is up to you.
Don't forget to get rid the leaks, and if you use GUI, it is not multi-instanceable.
Hope this will help.