From the words gold, lumber, food and altar; I guees this is for melee like.
Problem is the techtree req, no idea how to reset that.
But this allows to buy a new hero for free can also be the same hero.
-
Initialisierung
-

Events
-

Conditions
-

Actions
-


Melee Game - Give trained Heroes a Scroll of Town Portal (for all players)
-


Melee Game - Limit Heroes to 1 per Hero-type (for all players)
-


Player Group - Pick every player in (All players) and do (Actions)
-



Loop - Actions
-




Trigger - Add to Repick <gen> the event (Player - (Picked player) types a chat message containing -repick as An exact match)
-




Player - Set (Picked player) Available free Heroes to 1
-
Repick
-

Events
-

Conditions
-

Actions
-


Set Group = (Units owned by (Triggering player))
-


Custom script: set udg_Unit = FirstOfGroup(udg_Group)
-


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



If - Conditions
-




(Unit is A Hero) Equal to True
-



Then - Actions
-




-------- Drop Inventory --------
-




For each (Integer B) from 1 to 6, do (Actions)
-





Loop - Actions
-






Hero - Drop the item from slot (Integer B) of Unit
-




Set UnitType = (Unit-type of Unit)
-




Unit - Remove Unit from the game
-




-------- Remove Gold & Lumber cost from next hero --------
-




Player - Set (Triggering player) Available free Heroes to 1
-




-------- Allow this hero again --------
-




Custom script: call SetPlayerTechMaxAllowed(GetTriggerPlayer(), udg_UnitType, GetPlayerTechMaxAllowed(GetTriggerPlayer(), udg_UnitType) + 1)
-




-------- Allow any hero again --------
-




Custom script: call SetPlayerTechMaxAllowed(GetTriggerPlayer(), 'HERO', GetPlayerTechMaxAllowed(GetTriggerPlayer(), 'HERO') + 1)
-



Else - Actions
-


Custom script: call DestroyGroup(udg_Group)