It seems visualy counter intuitive to use constant duration loops that do not actually display the remaining duration of an illusion.
I know that blizzard doesn't provide proper natives, but maybe it should just not be supported then, to have dynamic durations.
Nice that alatering the death effect is supported.
Cohader's
break
is used, but the script should be compileable on Vexorian's JassHelper.
Don't do this:
hook DoNothing Operate
Run a registration trigger for example, it also can be achieved easily with GUI.
structs could be a win in this case I believe, but I read your reply on it above. So maybe it's okay for now.
JASS:
*/function IllusionDeathEvent takes code c returns nothing/*
- Adds a code to run when an illusion created from this system dies
^Does the user has access to the original unit of which the illusion was made in this death function?
Maybe there can be a "GetIllusionOrigin" function or so which returns the original unit of the illusion.
User might use it always, but also onDeath function it was useful.
I am not sure if there needs to be two seperate functions, CreateIllusion and Copy.
An illusion makes only sense if it also mimics everything else, like health/items/...
So using an Illusion which has full HP makes no sense if the original unit has only half of the HP, for example.
I suggest to make just an original unit as a requirement, instead of using only a general "base id" in CreateIllusion.
Idk if I did something wrong or changed something accidently, but this:
call CreateIllusion(Player(0), 'Hpal', 2, 0, 0, 0, 0, 0)
does not create the illusion for player red for me. ;o Could you test this maybe? Also the duration seemed wrong.
Goot attempt so far!