A friend of mine had asked me to write some JASS codes for him. My problem is how to pick all heroes for a player? His code requires to add the mana of computer player's heroes every 60 seconds elapsed in game time. Can anyone help me? Thanks!
IsUnitType(u, UNIT_TYPE_HERO) returns true if u is a hero.
function IsUnitHeroFilter takes nothing returns boolean return IsUnitType(GetFilterUnit(), UNIT_TYPE_HERO) endfunction
function GetHeroGroup takes player p returns group local filterfunc f = Filter(function IsUnitHeroFilter) local group g = CreateGroup() call GroupEnumUnitsOfPlayer(g, p, f) call DestroyFilter(f) return g endfunction