Baltazhar
Active Member
- Reaction score
- 55
I made and remade this ability 3 times, because they wouldn't work.
The idea of the ability is: Use entangle, and another 5/10/15 nearby enemy creeps get hit as well.
I started by doing it from my own head, then checking for ideas from the 'Overgrowth' DotA spell, and then finally and tried making the same spell, but in a different manner.
Hope someone can see what I'm missing here.
Variables:
ChokingVinesPreviousTarget = Unit
ChokingVinesTarget = Unit
Both variables are only used in the posted trigger.
The idea was the following steps.
1: Hero casts basic entangle
2: Sets unitgroup within 300 of targeted unit
3: Remove dead and alrdy entangled units from group
4: Selects random from the remaining group
5: Create dummy unit, give it dummy ability, set dummy level of ability
6: Order dummy unit to entangle selected target from unit group
7: Repeat (Ability Level x 5 -1) times
What basically happens is, regular entangle, no additional ones.
I've checked that the number of repeats is correct, but the remaining number units in the group after the sorting out, seems a bit wrong somehow. Made a test where I had 3 enemy units, cast entangle on one of them (that one should be filtered out), and the still said there was 3 targets in the unit group.
Perhaps I'm blabbering too much in here, and should simply just have pasted the code and wrote "HELP!". Anyway, I'd be thankful for any clues that could lead to the solving of my problem. Rewarding reputation ofcourse.
Thanks in advance,
Baltazhar
The idea of the ability is: Use entangle, and another 5/10/15 nearby enemy creeps get hit as well.
I started by doing it from my own head, then checking for ideas from the 'Overgrowth' DotA spell, and then finally and tried making the same spell, but in a different manner.
Hope someone can see what I'm missing here.
Variables:
ChokingVinesPreviousTarget = Unit
ChokingVinesTarget = Unit
Both variables are only used in the posted trigger.
Code:
Choking Vines
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Choking Vines
Actions
Set ChokingVinesPreviousTarget = (Target unit of ability being cast)
For each (Integer A) from 1 to (((Level of Choking Vines for (Casting unit)) x 5) - 1), do (Actions)
Loop - Actions
Set Temp_Point = (Position of ChokingVinesPreviousTarget)
Set Temp_Group = (Units within 300.00 of Temp_Point matching (((Matching unit) belongs to an enemy of (Owner of (Casting unit))) Equal to True))
Custom script: call RemoveLocation (udg_Temp_Point)
Unit Group - Pick every unit in Temp_Group and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Or - Any (Conditions) are true
Conditions
((Picked unit) is dead) Equal to True
((Picked unit) has buff Choking Vines) Equal to True
Then - Actions
Unit Group - Remove (Picked unit) from Temp_Group
Else - Actions
Game - Display to (All players) the text: (String((Number of units in Temp_Group)))
Set ChokingVinesTarget = (Random unit from Temp_Group)
Custom script: call DestroyGroup (udg_Temp_Group)
Unit - Create 1 Choking Vines (unit) for (Owner of (Casting unit)) at Temp_Point facing Default building facing degrees
Unit - Add Choking Vines (dummy) to (Last created unit)
Unit - Set level of Choking Vines (dummy) for (Last created unit) to (Level of Choking Vines for (Casting unit))
Unit - Order (Last created unit) to Night Elf Keeper Of The Grove - Entangling Roots ChokingVinesTarget
Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
Set ChokingVinesPreviousTarget = ChokingVinesTarget
The idea was the following steps.
1: Hero casts basic entangle
2: Sets unitgroup within 300 of targeted unit
3: Remove dead and alrdy entangled units from group
4: Selects random from the remaining group
5: Create dummy unit, give it dummy ability, set dummy level of ability
6: Order dummy unit to entangle selected target from unit group
7: Repeat (Ability Level x 5 -1) times
What basically happens is, regular entangle, no additional ones.
I've checked that the number of repeats is correct, but the remaining number units in the group after the sorting out, seems a bit wrong somehow. Made a test where I had 3 enemy units, cast entangle on one of them (that one should be filtered out), and the still said there was 3 targets in the unit group.
Perhaps I'm blabbering too much in here, and should simply just have pasted the code and wrote "HELP!". Anyway, I'd be thankful for any clues that could lead to the solving of my problem. Rewarding reputation ofcourse.
Thanks in advance,
Baltazhar