- Joined
- Feb 22, 2025
- Messages
- 315
Edit: Never mind, the Shaman has finally learned how to read his own spellbook.
Also, I noticed a memory leak was trying to sneak into the codebase like a level 1 scout. I've promptly squashed it. The Shaman's mana is now as stable as my caffeine intake.
I have a periodic AI trigger
that tells an Orc Shaman to cast Healing Wave on a low‑HP ally. Later in the same trigger loop, it also adds a Lightning Shield order via a custom GUI action:
The idea is that the Shaman should finish healing, then automatically cast Lightning Shield on the most surrounded ally.
I've read conflicting advice: some say a new order always interrupts the current one, while others claim BlzQueueTargetOrderById genuinely queues the order.
Note: I know that zero cast point/backswing and instant turn rate would make this trivial, but changing those would affect gameplay, and using a dummy feels like over‑engineering.
My questions?:
-- Does BlzQueueTargetOrderById truly enqueue the order so that the current spell (Healing Wave) finishes before Lightning Shield begins?
-- Are there any caveats? For example, if the Shaman takes damage (or attacks - since that order is sticky) or gets stunned between casts, will the queued order be lost?
-- Is it safer to separate the two spells into different trigger iterations ( with a
Still, I want to make sure the queue is reliable in a busy, combat‑heavy environment.
Thanks for any insight!
Also, I noticed a memory leak was trying to sneak into the codebase like a level 1 scout. I've promptly squashed it. The Shaman's mana is now as stable as my caffeine intake.
I have a periodic AI trigger
-
Shaman AI
-

Events
-


Time - Every 1.00 seconds of game time
-
-

Conditions
-


(ShamanGroup is empty) Equal to False
-
-

Actions
-


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



Loop - Actions
-




Set Shaman_TempUnit = (Picked unit)
-




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





If - Conditions
-






(Shaman_TempUnit is alive) Equal to True
-
-





Then - Actions
-






Set Shaman_TempPoint = (Position of Shaman_TempUnit)
-






Set Shaman_HealTarget = No unit
-






Set Shaman_HealPct = 70.00
-






Set Shaman_TempGroup = (Units within 1000.00 of Shaman_TempPoint matching ((((Matching unit) belongs to an ally of (Owner of Shaman_TempUnit).) Equal to True) and ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is alive) Equal to True) and ((Percentage lif
-






-------- // Find the most injured unit (lowest health %) --------
-






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







Loop - Actions
-








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









If - Conditions
-










(Percentage life of (Picked unit)) Less than Shaman_HealPct
-
-









Then - Actions
-










Set Shaman_HealPct = (Percentage life of (Picked unit))
-










Set Shaman_HealTarget = (Picked unit)
-
-









Else - Actions
-
-
-
-






-------- ///////////////////// --------
-






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







If - Conditions
-








Shaman_HealTarget Not equal to No unit
-








(Mana of Shaman_TempUnit) Greater than or equal to 90.00
-
-







Then - Actions
-








Custom script: if BlzGetUnitAbilityCooldown(udg_Shaman_TempUnit, 'AOhw', 1) <= 0.01 then
-








Unit - Order Shaman_TempUnit to Healing Wave Shaman_HealTarget
-








Custom script: endif
-
-







Else - Actions
-
-






Custom script: call RemoveLocation(udg_Shaman_TempPoint)
-






Custom script: call DestroyGroup(udg_Shaman_TempGroup)
-






-------- -------- Lightning Shield Logic -------- --------
-






Set Shaman_BuffTarget = No unit
-






Set Shaman_BuffScore = 0
-






Set Shaman_TempPoint = (Position of Shaman_TempUnit)
-






Set Shaman_TempGroup = (Units within 900.00 of Shaman_TempPoint matching (((((Matching unit) belongs to an ally of (Owner of Shaman_TempUnit).) Equal to True) and (((Matching unit) has buff Lightning Shield) Equal to False)) and ((((Matching unit) is A Hero) Equal to False) and (((
-






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







Loop - Actions
-








Set Shaman_TempUnit2 = (Picked unit)
-








Set Shaman_TempPoint2 = (Position of Shaman_TempUnit2)
-








Set Shaman_TempGroup2 = (Units within 300.00 of Shaman_TempPoint2 matching ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of Shaman_TempUnit).) Equal to True)).)
-








Set Shaman_TempCount = (Number of units in Shaman_TempGroup2)
-








Custom script: call DestroyGroup(udg_Shaman_TempGroup2)
-








Custom script: call RemoveLocation(udg_Shaman_TempPoint2)
-








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









If - Conditions
-










Shaman_TempCount Greater than or equal to 3
-
-









Then - Actions
-










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











If - Conditions
-












Shaman_TempCount Greater than Shaman_BuffScore
-
-











Then - Actions
-












Set Shaman_BuffScore = Shaman_TempCount
-












Set Shaman_BuffTarget = Shaman_TempUnit2
-
-











Else - Actions
-
-
-









Else - Actions
-
-
-
-






Custom script: call DestroyGroup(udg_Shaman_TempGroup)
-






Custom script: call RemoveLocation(udg_Shaman_TempPoint)
-






-------- ///////////////////// --------
-






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







If - Conditions
-








Shaman_BuffTarget Not equal to No unit
-








(Mana of Shaman_TempUnit) Greater than or equal to 65.00
-








(Ability Cooldown Remaining of Shaman_TempUnit for ability Lightning Shield..) Less than or equal to 0.01
-
-







Then - Actions
-








Unit - For Shaman_TempUnit add Lightning Shield with target Shaman_BuffTarget to order queue.
-
-







Else - Actions
-
-
-





Else - Actions
-
-
-
-
-
that tells an Orc Shaman to cast Healing Wave on a low‑HP ally. Later in the same trigger loop, it also adds a Lightning Shield order via a custom GUI action:
-
Unit - For Shaman_TempUnit add Lightning Shield with target Shaman_BuffTarget to order queue.
call BlzQueueTargetOrderById( udg_Shaman_TempUnit, 852110, udg_Shaman_BuffTarget )endfunctionThe idea is that the Shaman should finish healing, then automatically cast Lightning Shield on the most surrounded ally.
I've read conflicting advice: some say a new order always interrupts the current one, while others claim BlzQueueTargetOrderById genuinely queues the order.
Note: I know that zero cast point/backswing and instant turn rate would make this trivial, but changing those would affect gameplay, and using a dummy feels like over‑engineering.
My questions?:
-- Does BlzQueueTargetOrderById truly enqueue the order so that the current spell (Healing Wave) finishes before Lightning Shield begins?
-- Are there any caveats? For example, if the Shaman takes damage (or attacks - since that order is sticky) or gets stunned between casts, will the queued order be lost?
-- Is it safer to separate the two spells into different trigger iterations ( with a
Skip remaining actions after the heal) instead of relying on the queue?Still, I want to make sure the queue is reliable in a busy, combat‑heavy environment.
Thanks for any insight!
Last edited:
