Hi I'm trying to implement this solution adding an item with life steal to units within range and I'm having a small issue
I have created a region for each hero these are off-map at the beginning of the game,
If a hero picks vamp aura the following trigger moves the region around them
-
Update Regions
-
Events
-
Time - Every 1.00 seconds of game time
-
Conditions
-
WeHaveVampAura Equal to True
-
Actions
-
For each (Integer TempInt) from 1 to 12, do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
VampAuraHeros[TempInt] Not equal to No unit
-
Then - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Distance between (Position of VampAuraHeros[TempInt]) and (Center of VampiricAuraRegions[TempInt])) Greater than 50.00
-
Then - Actions
-
Floating Text - Create floating text that reads (Centering vamp region + ((String(TempInt)) + ( to + (String((Center X of VampiricAuraRegions[TempInt])))))) at (Position of VampAuraHeros[TempInt]) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
-
Set tempPoint2 = (Position of VampAuraHeros[TempInt])
-
Region - Center VampiricAuraRegions[TempInt] on tempPoint2
-
Custom script: call RemoveLocation (udg_tempPoint2)
-
Else - Actions
-
Else - Actions
This trigger works fine my twelve regions are called VampAura1 -VampAura12 I have tested with the output floating text that the region is moving with the player correctly and that the variable for regions i use does refer to the original vampAura1 region
When a player picks the skill vamp aura the following function adds the item ability to them and turns on the vamp aura triggers if they weren't on already
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
abilityListB[(Player number of (Owner of (Learning Hero)))] Equal to Vampiric Aura
-
Then - Actions
-
Set WeHaveVampAura = True
-
Unit - Add VampAuraItem to (Learning Hero)
-
Unit - Set level of VampAuraItem for (Learning Hero) to (Level of Vampiric Aura for (Learning Hero))
-
Set VampAuraHeros[(Player number of (Owner of (Learning Hero)))] = (Learning Hero)
-
Floating Text - Create floating text that reads (Adding vamp aura to + ((String((Level of Vampiric Aura for (Learning Hero)))) + ( player num = + (String((Player number of (Owner of (Learning Hero)))))))) at (Position of (Learning Hero)) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
-
Else - Actions
I have tested this and it does add the item ranged heroes do gain lifesteal the player number corresponds to the correct vamp region that it should
So now we reach the actual issue
-
Enter Region 1
-
Events
-
Unit - A unit enters VampAura1 <gen>
-
Conditions
-
And - All (Conditions) are true
-
Conditions
-
WeHaveVampAura Equal to True
-
VampAuraHeros[1] Not equal to No unit
-
((Owner of (Entering unit)) is an ally of (Owner of VampAuraHeros[1])) Equal to True
-
Actions
-
Set TempInt = 1
-
Floating Text - Create floating text that reads (adding vamp item lvl + ((String((Level of Vampiric Aura for VampAuraHeros[TempInt]))) + ( to + (Proper name of (Entering unit))))) at (Position of VampAuraHeros[TempInt]) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Level of VampAuraItem for (Entering unit)) Equal to 0
-
Then - Actions
-
Unit - Add VampAuraItem to (Entering unit)
-
Unit - Set level of VampAuraItem for (Entering unit) to (Level of Vampiric Aura for VampAuraHeros[TempInt])
-
Else - Actions
-
Unit - Set level of VampAuraItem for (Entering unit) to (Level of Vampiric Aura for VampAuraHeros[TempInt])
This code never executes I have tried removing all the conditions which makes no difference
I originally though perhaps there is a mismatch between the real region specified in start up for the map and the regions in the variables but i checked that when outputting text showing the variable x coordinate and the VampAura1 x coordinate as the hero was moving around and they were changing in sync
I then thought maybe because the region is always moving the enter condition is not being run so i added the range check so it doesn't always move unless its the hero has gone a certain distance I also tested standing still and letting another hero go into the area and this did nothing again
I have a leave region trigger but its the same for some reason it never fires
-
Leave Region 1
-
Events
-
Unit - A unit leaves VampAura1 <gen>
-
Conditions
-
WeHaveVampAura Equal to True
-
VampAuraHeros[1] Not equal to No unit
-
((Owner of (Entering unit)) is an ally of (Owner of VampAuraHeros[1])) Equal to True
-
Actions
-
Set TempInt = 1
-
Unit - Remove VampAuraItem from (Leaving unit)
-
Floating Text - Create floating text that reads (vamp item removed from + (Proper name of (Leaving unit))) at (Position of VampAuraHeros[1]) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
The region varibles are initilised at Melee Initilisation like so
-
Set VampiricAuraRegions[1] = VampAura1 <gen>
Thats repeated for all 11 more regions
The enter and leave region triggers also have 11 copies with the number incremented for each region and hero indicated
Does anyone know why the enter and exit regions aren't working?