So, when i pick a hero using the pick ability it'll also run the random.trig same with clicking random, it'll also run the pick.trig. I just cant spot the problem, ty in advance.
Code:
Pick
Events
Unit - A unit Begins casting an ability
Conditions
(Ability being cast) Equal to Pick
Actions
Set pick = (Ability being cast)
Player - Set (Owner of (Casting unit)) Current lumber to 4
Camera - Reset camera for (Owner of (Triggering unit)) to standard game-view over 0.00 seconds
Camera - Set the camera bounds for (Owner of (Triggering unit)) to ABIL1 <gen>
-------- ----------------- --------
If ((Unit-type of (Triggering unit)) Equal to |c0066ff66Lady Death|r) then do (Unit - Create 1 |c0066ff66Lady Death|r for (Owner of (Triggering unit)) at (Center of ABIL1 <gen>) facing Default building facing degrees) else do (Do nothing)
If ((Unit-type of (Triggering unit)) Equal to |c00cc0000Warrior|r) then do (Unit - Create 1 |c00cc0000Warrior|r for (Owner of (Triggering unit)) at (Center of ABIL1 <gen>) facing Default building facing degrees) else do (Do nothing)
If ((Unit-type of (Triggering unit)) Equal to |c00cc0000Death Knight|r) then do (Unit - Create 1 |c00cc0000Death Knight|r for (Owner of (Triggering unit)) at (Center of ABIL1 <gen>) facing Default building facing degrees) else do (Do nothing)
If ((Unit-type of (Triggering unit)) Equal to |c0066ff66Bladedancer|r) then do (Unit - Create 1 |c0066ff66Bladedancer|r for (Owner of (Triggering unit)) at (Center of ABIL1 <gen>) facing Default building facing degrees) else do (Do nothing)
If ((Unit-type of (Triggering unit)) Equal to |c00cc0000Berserker|r) then do (Unit - Create 1 |c00cc0000Berserker|r for (Owner of (Triggering unit)) at (Center of ABIL1 <gen>) facing Default building facing degrees) else do (Do nothing)
If ((Unit-type of (Triggering unit)) Equal to |c006666ffWitch|r) then do (Unit - Create 1 |c006666ffWitch|r for (Owner of (Triggering unit)) at (Center of ABIL1 <gen>) facing Default building facing degrees) else do (Do nothing)
-------- ----------------- --------
Set Hero[(Player number of (Owner of (Triggering unit)))] = (Last created unit)
Set playerunits[(Player number of (Owner of (Triggering unit)))] = (Last created unit)
Game - Display to (All players) the text: ((Name of (Owner of (Triggering unit))) + ( has chosen + ((Name of (Triggering unit)) + to be his hero.)))
Selection - Select Active Skills 0025 <gen> for (Owner of (Triggering unit))
Camera - Pan camera for (Owner of (Triggering unit)) to (Position of (Triggering unit)) over 0.00 seconds
Unit - Change ownership of (Triggering unit) to Neutral Passive and Change color
Hero - Modify unspent skill points of (Last created unit): Subtract 1 points
Code:
Random
Events
Unit - A unit Begins casting an ability
Conditions
(Ability being cast) Equal to Random
Actions
Set Random = (Ability being cast)
Player - Set (Owner of (Casting unit)) Current lumber to 4
Camera - Reset camera for (Owner of (Triggering unit)) to standard game-view over 0.00 seconds
Camera - Set the camera bounds for (Owner of (Triggering unit)) to ABIL1 <gen>
-------- ----------------- --------
Unit - Create 1 RandomHero[(Random integer number between 1 and NUMCOUNT)] for (Owner of (Casting unit)) at (Center of ABIL1 <gen>) facing Default building facing degrees
-------- ----------------- --------
Set Hero[(Player number of (Owner of (Triggering unit)))] = (Last created unit)
Set playerunits[(Player number of (Owner of (Triggering unit)))] = (Last created unit)
Game - Display to (All players) the text: ((Name of (Owner of (Triggering unit))) + ( has randomed + (Name of (Last created unit))))
Selection - Select Active Skills 0025 <gen> for (Owner of (Triggering unit))
Camera - Pan camera for (Owner of (Triggering unit)) to (Position of (Triggering unit)) over 0.00 seconds
Hero - Modify unspent skill points of (Last created unit): Subtract 1 points
Unit - Change ownership of (Triggering unit) to Neutral Passive and Change color
Code:
Variables
Events
Map initialization
Conditions
Actions
Set RandomHero[1] = |c00cc0000Death Knight|r
Set RandomHero[2] = |c00cc0000Warrior|r
Set RandomHero[3] = |c0066ff66Bladedancer|r
Set RandomHero[4] = |c00cc0000Berserker|r
Set RandomHero[5] = |c006666ffWitch|r
Set RandomHero[6] = |c0066ff66Lady Death|r
-------- Extra for RandomHeroPick --------
Set NUMCOUNT = 6
For each (Integer A) from 1 to NUMCOUNT, do (Actions)
Loop - Actions
Set NUMBERS[(Integer A)] = (Integer A)
For each (Integer A) from 1 to 6, do (Actions)
Loop - Actions
Set NUMTEMP = (Random integer number between 1 and NUMCOUNT)
Set UniqueNUM[(Integer A)] = NUMBERS[NUMTEMP]
Set NUMBERS[NUMTEMP] = NUMBERS[NUMCOUNT]
Set NUMCOUNT = (NUMCOUNT - 1)