- Joined
- Feb 27, 2019
- Messages
- 401
Hello,
In my map I am trying to make a triggered life steal that works for every units attack type (melee, ranged) and compatible with orb effects. I also want that it stacks.
To do so, I made the trigger that periodically check units every 0.25s for lifesteal-items/lifesteal-abilities/lifesteal-buffs, computes the stacked life steal percentage, and then gives a vampiric potion to the unit that gives the right percentage for 0.5s. Because vampiric potions work with ranged units, orbs, splashs/multi-attacks
In WE, I changed all abilities/buffs to 0% life steal (=dummy abilities) and removed abilities from lifesteal items (=dummy items). Also, because "Create item and give it to hero" makes the item visible on the floor for a short time, I set the model of my vampiric potions to dummy.mdx.
It works fine for heroes, and units without inventory (my map doesn't have units with inventory). However it does not work for illusions.
- Vampiric aura from other source displays a buff but have no effect (even in melee).
- Vampiric aura from self displays the effect but have no effect (even in melee).
- Vampiric potion with use when acquired: no effect or cannot be used (I don't know...).
- Adding Item Life Steal (Mask of Death) or Life Steal (Frostmourne) ability: no effect.
- Adding an item with Life Steal Ability: works.
Do you see a good solution to handle life steal on illusions please ? Better than hopping there is a free slow in their inventory, and adding an item that gives life steal...
For dummy lifesteal items, I can replace them by effective lifesteal items when illusions enter the map. What about the other cases (Abilities or buffs that give lifesteal) ???
My code below:
In my map I am trying to make a triggered life steal that works for every units attack type (melee, ranged) and compatible with orb effects. I also want that it stacks.
To do so, I made the trigger that periodically check units every 0.25s for lifesteal-items/lifesteal-abilities/lifesteal-buffs, computes the stacked life steal percentage, and then gives a vampiric potion to the unit that gives the right percentage for 0.5s. Because vampiric potions work with ranged units, orbs, splashs/multi-attacks
In WE, I changed all abilities/buffs to 0% life steal (=dummy abilities) and removed abilities from lifesteal items (=dummy items). Also, because "Create item and give it to hero" makes the item visible on the floor for a short time, I set the model of my vampiric potions to dummy.mdx.
It works fine for heroes, and units without inventory (my map doesn't have units with inventory). However it does not work for illusions.
- Vampiric aura from other source displays a buff but have no effect (even in melee).
- Vampiric aura from self displays the effect but have no effect (even in melee).
- Vampiric potion with use when acquired: no effect or cannot be used (I don't know...).
- Adding Item Life Steal (Mask of Death) or Life Steal (Frostmourne) ability: no effect.
- Adding an item with Life Steal Ability: works.
Do you see a good solution to handle life steal on illusions please ? Better than hopping there is a free slow in their inventory, and adding an item that gives life steal...
For dummy lifesteal items, I can replace them by effective lifesteal items when illusions enter the map. What about the other cases (Abilities or buffs that give lifesteal) ???
My code below:
-
UniversalLifeSteal
-
Events
-
Time - Every 0.25 seconds of game time
-
-
Conditions
-
Actions
-
For each (Integer A) from 1 to 8, do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
((Player((Integer A))) controller) Equal to User
-
-
Then - Actions
-
Set TempGroup = (Units owned by (Player((Integer A))))
-
Unit Group - Pick every unit in TempGroup and do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
((Picked unit) is A structure) Equal to False
-
((Picked unit) is dead) Equal to False
-
((Picked unit) is hidden) Equal to False
-
((Picked unit) is paused) Equal to False
-
((Picked unit) is Stunned) Equal to False
-
((Picked unit) is Sleeping) Equal to False
-
-
Then - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
((Picked unit) is an illusion) Equal to True
-
-
Then - Actions
-
[...] (What can I do ??)
-
-
Else - Actions
-
Set TempReal = 0.00
-
-------- Check aura effects --------
-
[...] (Increasing TempReal value depending of dummy lifesteal buffs the unit have)
-
-------- Check abilities --------
-
[...] (Increasing TempReal value depending of dummy lifesteal abilities the unit have)
-
-------- If hero, check items with life steal --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
((Picked unit) is A Hero) Equal to True
-
-
Then - Actions
-
[...] (Increase TempReal according to carried dummy lifesteal items)
-
-
Else - Actions
-
Do nothing
-
-
-
-------- All my lifesteals are multiple of 0.5 (=50%) --------
-
Set TempNumber = (Integer((TempReal / 0.50)))
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
TempNumber Equal to 0
-
-
Then - Actions
-
Do nothing
-
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
((Picked unit) is A Hero) Equal to True
-
-
Then - Actions
-
Do nothing
-
-
Else - Actions
-
Unit - Add Stacked Life Steal Unit Inventory (Human) to (Picked unit)
-
-
-
Hero - Create StackedLifeStealLevels[TempNumber] and give it to (Picked unit)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
((Picked unit) is A Hero) Equal to True
-
-
Then - Actions
-
Do nothing
-
-
Else - Actions
-
Unit - Remove Stacked Life Steal Unit Inventory (Human) from (Picked unit)
-
-
-
-------- Safety check: in cases where the unit could not fetch the item, delete it --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
((Last created item) is owned) Equal to False
-
-
Then - Actions
-
Item - Remove (Last created item)
-
-
Else - Actions
-
Do nothing
-
-
-
-
-
-
-
-
Else - Actions
-
Do nothing
-
-
-
-
-
Custom script: call DestroyGroup(udg_TempGroup)
-
-
Else - Actions
-
Do nothing
-
-
-
-
-
-
Last edited: