Heloes Hive Workshop
I have an idea for a skill, but not much any for making it work. The idea is, there's a skill, which makes a unit create illusions from every killed unit for as long, as the buff works (that is, 30 seconds).
Let me show you the script:
Okay now. I know it leaks - it's just a minute part of kinda big trigger, no leaks when it's complete.
The idea is, when a hero uses his skill he gets a buff, namely the 'B017'. As you can see, when he kills a unit, the dummy unit is created (I know 'FIrstOfGroup' would be better, but I got used to 'GroupPickRandomUnit' and copy+paste it everywhere ). Afterwards, the dummy gets an item, 'I02S', that is my version of Illusion Wand, which can target dead. For now everything is okay, but then... Illusion spell creates a copy of the target with EXACT SAME AMMOUNT OF HP, which is 0. So, my illusions die instantly
Any ideas how to fix it? I want the illusions to have 100% hp (they take 3x hits and hit 30% anyway). Maybe some kind of 'last created unit' but corresponding to a unit just summoned? I'd be glad for any help!
@EDIT: I had the idea to set unit's hp to 100% just after summoning, but it doesn't seem to work.
I have an idea for a skill, but not much any for making it work. The idea is, there's a skill, which makes a unit create illusions from every killed unit for as long, as the buff works (that is, 30 seconds).
Let me show you the script:
JASS:
//Manipulator - Spectre Army
if UnitHasBuffBJ(killer, 'B017') then
set dummy = GroupPickRandomUnit(CreateNUnitsAtLoc(1, 'e003', player, GetUnitLoc(killed), 0))
set item = CreateItemLoc('I02S', GetUnitLoc(dummy))
call UnitAddItem(dummy, item)
call UnitUseItemTarget(dummy, przedmiot, killed)
endif
Okay now. I know it leaks - it's just a minute part of kinda big trigger, no leaks when it's complete.
The idea is, when a hero uses his skill he gets a buff, namely the 'B017'. As you can see, when he kills a unit, the dummy unit is created (I know 'FIrstOfGroup' would be better, but I got used to 'GroupPickRandomUnit' and copy+paste it everywhere ). Afterwards, the dummy gets an item, 'I02S', that is my version of Illusion Wand, which can target dead. For now everything is okay, but then... Illusion spell creates a copy of the target with EXACT SAME AMMOUNT OF HP, which is 0. So, my illusions die instantly
Any ideas how to fix it? I want the illusions to have 100% hp (they take 3x hits and hit 30% anyway). Maybe some kind of 'last created unit' but corresponding to a unit just summoned? I'd be glad for any help!
@EDIT: I had the idea to set unit's hp to 100% just after summoning, but it doesn't seem to work.