I want it to have 5 seconds before happening so player get a chance to run before the boss healing off them and i tried to do all you just said but its not workingBtw, how would your healing mechanic work exactly?
- Enumerate all units within range of that unit.
- Filter out Heroes from units within the group, either in filtering phase or enumeration phase (
)
Unit Group - Pick all units in <unit group> and do (Actions)
- Get the resulting number of units in the group.
- Do your healing mechanic here. (Edited)
PlayerEvent:watch(EVENT_PLAYER_UNIT_SPELL_EFFECT, function()
doAfter(5.00, function()
enumUnitsInRange()
filterHeroes()
getGroupCount()
doHeal()
end)
end)
i dont want it to be every second lol just heals instantly if there are units around himSo the healing mechanic behaves like this? (Pseudo-code below)
Lua:PlayerEvent:watch(EVENT_PLAYER_UNIT_SPELL_EFFECT, function() doAfter(5.00, function() enumUnitsInRange() filterHeroes() getGroupCount() doHeal() end) end)
If so, then 2 triggers can be configured to do what you need to do in GUI (if map script is in vJASS, otherwise it would be trivial in Lua).
Delayed Trigger Effect:
Watching Trigger (The trigger that will activate the Delayed Effect Trigger)
Delayed Trigger Effect
Events
Event - Every <interval> seconds of game-time
Conditions
Actions
For each (Integer <index_var>) from 1 to <spell_max_index>, do (Actions)
Loop - Actions
Set <remaining_dur_var>[<index_var>] = <remaining_dur_var>[<index_var>] - <interval>
If - If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
<remaining_dur_var>[<index_var>] less than or equal to 0.00
Then - Actions
-------- Do the enumeration and filtering portion here --------
Set <temp_point> = (Position of <spell_unit>[<index_var>])
Set <enum_group> = Units within <spell_range> of <temp_point>
Unit Group - Pick every unit in <enum_group> and do (Actions)
Loop - Actions
-------- Apply filter here. If the unit doesn't pass the filter, remove it from the group --------
Set <hero_count> = (Number of units in <enum_group>)
-------- Do the healing mechanic here --------
-------- Dynamic Indexing clean-up --------
Set <spell_unit>[<index_var>] = <spell_unit>[<spell_max_index>]
Set <spell_unit>[<spell_max_index>] = No unit
Set <spell_max_index> = <spell_max_index> - 1
Set <index_var> = <index_var> - 1
Else - Actions
Watching Trigger
Events
Conditions
Actions
-------- The Core actions --------
Set <spell_max_index> = <spell_max_index> + 1
Set <spell_unit>[<spell_max_index>] = (The Desired unit)
-------- Activate the Delayed Trigger Effect --------
If - If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
<spell_max_index> Equal To 1
Then - Actions
Trigger - Turn on Delayed Trigger Effect
Else - Actions
and no jass please!So the healing mechanic behaves like this? (Pseudo-code below)
Lua:PlayerEvent:watch(EVENT_PLAYER_UNIT_SPELL_EFFECT, function() doAfter(5.00, function() enumUnitsInRange() filterHeroes() getGroupCount() doHeal() end) end)
If so, then 2 triggers can be configured to do what you need to do in GUI (if map script is in vJASS, otherwise it would be trivial in Lua).
Delayed Trigger Effect:
Watching Trigger (The trigger that will activate the Delayed Effect Trigger)
Delayed Trigger Effect
Events
Event - Every <interval> seconds of game-time
Conditions
Actions
For each (Integer <index_var>) from 1 to <spell_max_index>, do (Actions)
Loop - Actions
Set <remaining_dur_var>[<index_var>] = <remaining_dur_var>[<index_var>] - <interval>
If - If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
<remaining_dur_var>[<index_var>] less than or equal to 0.00
Then - Actions
-------- Do the enumeration and filtering portion here --------
Set <temp_point> = (Position of <spell_unit>[<index_var>])
Set <enum_group> = Units within <spell_range> of <temp_point>
Unit Group - Pick every unit in <enum_group> and do (Actions)
Loop - Actions
-------- Apply filter here. If the unit doesn't pass the filter, remove it from the group --------
Set <hero_count> = (Number of units in <enum_group>)
-------- Do the healing mechanic here --------
-------- Dynamic Indexing clean-up --------
Set <spell_unit>[<index_var>] = <spell_unit>[<spell_max_index>]
Set <spell_unit>[<spell_max_index>] = No unit
Set <spell_max_index> = <spell_max_index> - 1
Set <index_var> = <index_var> - 1
Else - Actions
Watching Trigger
Events
Conditions
Actions
-------- The Core actions --------
Set <spell_max_index> = <spell_max_index> + 1
Set <spell_unit>[<spell_max_index>] = (The Desired unit)
-------- Activate the Delayed Trigger Effect --------
If - If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
<spell_max_index> Equal To 1
Then - Actions
Trigger - Turn on Delayed Trigger Effect
Else - Actions
and no jass please!
It actually doesn't heal the unit periodically. It just waits until the remaining duration reaches 0, and does its' business once it does, and gets removed from the loop thereafter. The principles behind this can be read here: Visualize: Dynamic Indexingi dont want it to be every second lol just heals instantly if there are units around him
Delayed Trigger Effect
Events
Event - Every <interval> seconds of game-time
Conditions
Actions
For each (Integer <index_var>) from 1 to <spell_max_index>, do (Actions)
Loop - Actions
Set <remaining_dur_var>[<index_var>] = <remaining_dur_var>[<index_var>] - <interval>
If - If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
<remaining_dur_var>[<index_var>] less than or equal to 0.00
Then - Actions
-------- Do the enumeration and filtering portion here --------
Set <temp_point> = (Position of <spell_unit>[<index_var>])
Set <enum_group> = Units within <spell_range> of <temp_point>
Unit Group - Pick every unit in <enum_group> and do (Actions)
Loop - Actions
-------- Apply filter here. If the unit doesn't pass the filter, remove it from the group --------
Set <hero_count> = (Number of units in <enum_group>)
-------- Do the healing mechanic here --------
-------- Dynamic Indexing clean-up --------
Set <spell_unit>[<index_var>] = <spell_unit>[<spell_max_index>]
Set <spell_unit>[<spell_max_index>] = No unit
Set <spell_max_index> = <spell_max_index> - 1
Set <index_var> = <index_var> - 1
Else - Actions
Watching Trigger
Events
Conditions
Actions
-------- The Core actions --------
Set <spell_max_index> = <spell_max_index> + 1
Set <spell_unit>[<spell_max_index>] = (The Desired unit)
-------- Activate the Delayed Trigger Effect --------
If - If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
<spell_max_index> Equal To 1
Then - Actions
Trigger - Turn on Delayed Trigger Effect
Else - Actions
i sure will do!What MyPad suggested is for creating an MUI spell. This design is done so that the spell works for multiple units/multiple casts from the same unit. This is great to learn and pretty much required for making MUI spells in GUI.
However, I know from seeing your other triggers that you probably only have 1 Boss casting this spell (Or whatever Event it is that you're using) and MUI is not an issue.
So I think this is what you're looking for:
This will Heal the boss for 10% health for each nearby Hero after a 5.00 second delay. I don't know what Events you wanted to use so I left them blank.
Boss Heal
Events
Conditions
Actions
Wait 5.00 seconds
Set Variable TempPoint = (Position of YourBossUnit)
Set Variable HealCount = 0
Custom script: set bj_wantDestroyGroup = true
Unit Group - Pick every unit in (Units within 500.00 of TempPoint) and do (Actions)
Loop - 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
Set Variable HealCount = (HealCount + 1)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
HealCount Greater than 0
Then - Actions
Unit - Set life of YourBossUnit to ((Percentage life of YourBossUnit) + ((Real(HealCount)) x 10.00))%
Else - Actions
Custom script: call RemoveLocation (udg_TempPoint)
You need to explain what you want/your issues in greater detail so people can help you out properly. Remember that it can be difficult to provide a solution when there's so many different methods to solving a problem. Try to remember this when asking for help!