Hey guys, I have a problem with a mounting trigger using this event. Since I was dealing with heroes mounting, I didn't want to use the mount and dismount skill because it resets level, skills, items, variable sets, ect... So I used this trigger where if the player right clicks the horse with the fighter selected, they merge into a unit. Everything works, until I found a problem with the event, where the player can right click twice really fast to make two mounted units instead. I tried putting in a cooldown, MountCooldownForPlayer = true, but it doesn't seem to work. Here is the trigger
Mounting Fighter
Events
Unit - A unit Is issued an order targeting an object
Conditions
(Is (Target unit of issued order) near (Triggering unit) and withing a range of 150.00) Equal to True
(Issued order) Not equal to (Order(attack))
Or - Any (Conditions) are true
Conditions
And - All (Conditions) are true
Conditions
(Unit-type of (Triggering unit)) Equal to Horse
(Unit-type of (Target unit of issued order)) Equal to Fighter
And - All (Conditions) are true
Conditions
(Unit-type of (Triggering unit)) Equal to Fighter
(Unit-type of (Target unit of issued order)) Equal to Horse
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Number of units in (Units currently selected by (Owner of (Triggering unit)))) Equal to 1
Then - Actions
Else - Actions
Skip remaining actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Unit-type of (Triggering unit)) Equal to Horse
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Target unit of issued order) Equal to Leader[(Player number of (Owner of (Triggering unit)))]
Then - Actions
Set NewPlayerHero[(Player number of (Owner of (Target unit of issued order)))] = True
Else - Actions
Do nothing
Set MountLevel = (Hero level of (Target unit of issued order))
Set MountLife = (Integer((Percentage life of (Target unit of issued order))))
Set MountMana = (Integer((Percentage mana of (Target unit of issued order))))
Sound - Play TamingTarget1 <gen> at 100.00% volume, located at (Position of (Triggering unit)) with Z offset 0.00
Unit - Replace (Target unit of issued order) with a Fighter (Rider) using The old unit's relative life and mana
Unit - Remove (Triggering unit) from the game
Hero - Set (Last replaced unit) Hero-level to MountLevel, Hide level-up graphics
Unit - Set life of (Last replaced unit) to (Real(MountLife))%
Unit - Set mana of (Last replaced unit) to (Real(MountMana))%
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
NewPlayerHero[(Player number of (Owner of (Triggering unit)))] Equal to True
Then - Actions
Set Leader[(Player number of (Owner of (Triggering unit)))] = (Last replaced unit)
Set NewPlayerHero[(Player number of (Owner of (Triggering unit)))] = False
Else - Actions
Do nothing
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Unit-type of (Triggering unit)) Equal to Fighter
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Triggering unit) Equal to Leader[(Player number of (Owner of (Triggering unit)))]
Then - Actions
Set NewPlayerHero[(Player number of (Owner of (Triggering unit)))] = True
Else - Actions
Do nothing
Set MountLevel = (Hero level of (Triggering unit))
Set MountLife = (Integer((Percentage life of (Triggering unit))))
Set MountMana = (Integer((Percentage mana of (Triggering unit))))
Sound - Play TamingTarget1 <gen> at 100.00% volume, located at (Position of (Triggering unit)) with Z offset 0.00
Unit - Replace (Triggering unit) with a Fighter (Rider) using The old unit's relative life and mana
Unit - Remove (Target unit of issued order) from the game
Hero - Set (Last replaced unit) Hero-level to MountLevel, Hide level-up graphics
Unit - Set life of (Last replaced unit) to (Real(MountLife))%
Unit - Set mana of (Last replaced unit) to (Real(MountMana))%
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
NewPlayerHero[(Player number of (Owner of (Triggering unit)))] Equal to True
Then - Actions
Set Leader[(Player number of (Owner of (Triggering unit)))] = (Last replaced unit)
Set NewPlayerHero[(Player number of (Owner of (Triggering unit)))] = False
Else - Actions
Do nothing
Else - Actions
Anyone got any solutions?
Mounting Fighter
Events
Unit - A unit Is issued an order targeting an object
Conditions
(Is (Target unit of issued order) near (Triggering unit) and withing a range of 150.00) Equal to True
(Issued order) Not equal to (Order(attack))
Or - Any (Conditions) are true
Conditions
And - All (Conditions) are true
Conditions
(Unit-type of (Triggering unit)) Equal to Horse
(Unit-type of (Target unit of issued order)) Equal to Fighter
And - All (Conditions) are true
Conditions
(Unit-type of (Triggering unit)) Equal to Fighter
(Unit-type of (Target unit of issued order)) Equal to Horse
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Number of units in (Units currently selected by (Owner of (Triggering unit)))) Equal to 1
Then - Actions
Else - Actions
Skip remaining actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Unit-type of (Triggering unit)) Equal to Horse
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Target unit of issued order) Equal to Leader[(Player number of (Owner of (Triggering unit)))]
Then - Actions
Set NewPlayerHero[(Player number of (Owner of (Target unit of issued order)))] = True
Else - Actions
Do nothing
Set MountLevel = (Hero level of (Target unit of issued order))
Set MountLife = (Integer((Percentage life of (Target unit of issued order))))
Set MountMana = (Integer((Percentage mana of (Target unit of issued order))))
Sound - Play TamingTarget1 <gen> at 100.00% volume, located at (Position of (Triggering unit)) with Z offset 0.00
Unit - Replace (Target unit of issued order) with a Fighter (Rider) using The old unit's relative life and mana
Unit - Remove (Triggering unit) from the game
Hero - Set (Last replaced unit) Hero-level to MountLevel, Hide level-up graphics
Unit - Set life of (Last replaced unit) to (Real(MountLife))%
Unit - Set mana of (Last replaced unit) to (Real(MountMana))%
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
NewPlayerHero[(Player number of (Owner of (Triggering unit)))] Equal to True
Then - Actions
Set Leader[(Player number of (Owner of (Triggering unit)))] = (Last replaced unit)
Set NewPlayerHero[(Player number of (Owner of (Triggering unit)))] = False
Else - Actions
Do nothing
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Unit-type of (Triggering unit)) Equal to Fighter
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Triggering unit) Equal to Leader[(Player number of (Owner of (Triggering unit)))]
Then - Actions
Set NewPlayerHero[(Player number of (Owner of (Triggering unit)))] = True
Else - Actions
Do nothing
Set MountLevel = (Hero level of (Triggering unit))
Set MountLife = (Integer((Percentage life of (Triggering unit))))
Set MountMana = (Integer((Percentage mana of (Triggering unit))))
Sound - Play TamingTarget1 <gen> at 100.00% volume, located at (Position of (Triggering unit)) with Z offset 0.00
Unit - Replace (Triggering unit) with a Fighter (Rider) using The old unit's relative life and mana
Unit - Remove (Target unit of issued order) from the game
Hero - Set (Last replaced unit) Hero-level to MountLevel, Hide level-up graphics
Unit - Set life of (Last replaced unit) to (Real(MountLife))%
Unit - Set mana of (Last replaced unit) to (Real(MountMana))%
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
NewPlayerHero[(Player number of (Owner of (Triggering unit)))] Equal to True
Then - Actions
Set Leader[(Player number of (Owner of (Triggering unit)))] = (Last replaced unit)
Set NewPlayerHero[(Player number of (Owner of (Triggering unit)))] = False
Else - Actions
Do nothing
Else - Actions
Anyone got any solutions?