So when a specific item is picked up, it'll turn on a loop trigger. During this loop trigger, it'll trigger a heal every 18 seconds for the lowest health hero out of all allied players for 25% of their max health. I'm also trying to make this passive stack when other heroes have this item as well. Right now, it kinda works I guess? but turns off after 1 timer loop. The Hashtable saves aren't saving correctly. I'm trying to not use any global variable (except the Unit Group) cause it's getting to the point where I have too much. I'll use it if needed, but I'd prefer not to. I'll also post a SS file of the results I got. Do note that the current GUI coding I'm posting on this thread is slightly different than the way I tested it. But basically, the "if/then/else + turn off trigger" was originally the final action of this trigger. I decided to move it to center and placed the actual healing actions on the "else" since it feels practical. So in its current iteration, it would just turn off instead of healing once.
-
Holy Grail passive
-

Events
-


Time - Every 18.00 seconds of game time
-
-

Conditions
-

Actions
-


Custom script: local integer i = 1
-


Custom script: local location p
-


Hashtable - Save 0 as (Key hg.) of (Key count.) in Hash.
-


Hashtable - Save 999999.00 as (Key hg.) of (Key lowHP.) in Hash.
-


Set VariableSet HolyGrailUG = (Units in (Playable map area) matching ((((Matching unit) belongs to an ally of Player 7 (Green).) Equal to True) and ((((Matching unit) is A Hero) Equal to True) and (((Matching unit) is alive) Equal to True))))
-


Unit Group - Pick every unit in HolyGrailUG and do (Actions)
-



Loop - Actions
-




If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-





If - Conditions
-






((Picked unit) has an item of type The Holy Grail) Equal to True
-
-





Then - Actions
-






Hashtable - Save ((Load (Key hg.) of (Key count.) from Hash.) + 1) as (Key hg.) of (Key count.) in Hash.
-






Game - Display to (All players) for 3.00 seconds the text: (hg count: + (String((Load (Key hg.) of (Key count.) from Hash.))))
-
-





Else - Actions
-
-
-
-


If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-



If - Conditions
-




(Load (Key hg.) of (Key count.) from Hash.) Equal to 0.00
-
-



Then - Actions
-




Game - Display to (All players) for 3.00 seconds the text: turn off hg passive
-




Trigger - Turn off (This trigger)
-
-



Else - Actions
-




Custom script: loop
-




Custom script: exitwhen i > LoadIntegerBJ(StringHashBJ("hg"), StringHashBJ("count"), udg_Hash)
-




Unit Group - Pick every unit in HolyGrailUG and do (Actions)
-





Loop - Actions
-






If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-







If - Conditions
-








(Life of (Picked unit)) Less than (Load (Key hg.) of (Key lowHP.) from Hash.)
-
-







Then - Actions
-








Hashtable - Save Handle Of(Picked unit) as (Key hg.) of (Key unit.) in Hash.
-








Game - Display to (All players) for 3.00 seconds the text: (hg unit: + (String((Load (Key hg.) of (Key unit.) from Hash.))))
-








Hashtable - Save (Life of (Picked unit)) as (Key hg.) of (Key lowHP.) in Hash.
-








Hashtable - Save (Life of (Load (Key hg.) of (Key unit.) in Hash.)) as (Key hg.) of (Key lowHP.) in Hash.
-








Game - Display to (All players) for 3.00 seconds the text: (hg lowHP: + (String((Load (Key hg.) of (Key lowHP.) from Hash.))))
-
-







Else - Actions
-
-
-
-




Unit - Set life of (Load (Key hg.) of (Key unit.) in Hash.) to ((Load (Key hg.) of (Key lowHP.) from Hash.) + ((Max life of (Load (Key hg.) of (Key unit.) in Hash.)) x 0.25))
-




Hashtable - Save (Life of (Load (Key hg.) of (Key unit.) in Hash.)) as (Key hg.) of (Key lowHP.) in Hash.
-




Game - Display to (All players) for 3.00 seconds the text: (finished healing: + (String((Load (Key hg.) of (Key lowHP.) from Hash.))))
-




Custom script: set p = GetUnitLoc(LoadUnitHandleBJ(StringHashBJ("hg"), StringHashBJ("unit"), udg_Hash))
-




Custom script: call AddSpecialEffectLocBJ( p, "Abilities\\Spells\\Human\\Resurrect\\ResurrectCaster.mdl" )
-




Special Effect - Destroy (Last created special effect)
-




Custom script: set i = i + 1
-




Custom script: endloop
-
-
-


Custom script: call RemoveLocation(p)
-


Custom script: set p = null
-
-
Attachments
Last edited:
