I am using a tavern hero select system that works great, and for a random feature I am using this trigger:
Random
Events
Unit - A unit Begins casting an ability
Conditions
(Ability being cast) Equal to Random Hero
Actions
Set randomint = (Random integer number between 1 and numberofheros)
Unit - Create 1 Heros[randomint] for (Triggering player) at (Position of (Triggering unit)) facing Default building facing degrees
Set Heros[randomint] = Heros[numberofheros]
Set numberofheros = (numberofheros - 1)
Player - Set (Triggering player) Current lumber to 0
Player - Disable Random Hero for (Triggering player)
(got this trigger from a post by AceHart)
My problem is that I don't want anyone to have the same hero in a game, but when someone hand picks a hero, there is still a chance that someone else can get the same hero through the random feature. How do I make it so that when a player picks his hero, it removes that hero as well from the random list?
Random
Events
Unit - A unit Begins casting an ability
Conditions
(Ability being cast) Equal to Random Hero
Actions
Set randomint = (Random integer number between 1 and numberofheros)
Unit - Create 1 Heros[randomint] for (Triggering player) at (Position of (Triggering unit)) facing Default building facing degrees
Set Heros[randomint] = Heros[numberofheros]
Set numberofheros = (numberofheros - 1)
Player - Set (Triggering player) Current lumber to 0
Player - Disable Random Hero for (Triggering player)
(got this trigger from a post by AceHart)
My problem is that I don't want anyone to have the same hero in a game, but when someone hand picks a hero, there is still a chance that someone else can get the same hero through the random feature. How do I make it so that when a player picks his hero, it removes that hero as well from the random list?