UnitGuardUnitAI
not ratedThis function causes the "summon" unit to guard the "master" unit Diablo2 style, the function continues to run until the summon dies, if the master dies the summon will camp his grave.
It is suggested to add the 'Aloc' ability to units that will be controlled by this function.
Suggested usage:
Guard
Events
Unit - A unit Spawns a summoned unit
Conditions
(Unit-type of (Summoned unit)) Equal to Phoenix
Actions
Custom script: call UnitGuardUnitAI(GetSummonedUnit(),GetSummoningUnit())
NOTE: If the the master dies, the unit will be ordered toward the center of the map. If you don't want this behavior in your map, change the exitwhen line to:
exitwhen IsUnitDeadBJ(summon) or IsUnitDeadBJ(master)
It is suggested to add the 'Aloc' ability to units that will be controlled by this function.
Suggested usage:
Guard
Events
Unit - A unit Spawns a summoned unit
Conditions
(Unit-type of (Summoned unit)) Equal to Phoenix
Actions
Custom script: call UnitGuardUnitAI(GetSummonedUnit(),GetSummoningUnit())
NOTE: If the the master dies, the unit will be ordered toward the center of the map. If you don't want this behavior in your map, change the exitwhen line to:
exitwhen IsUnitDeadBJ(summon) or IsUnitDeadBJ(master)