Hey guys, I have a problem with the hero choosing system and was wondering if any of you knew whats up with it.
A brief explanation first. There are three ways of obtaining a hero,
firstly by randoming it by entering a region.
secondly by manually choosing it,
thirdly by -repicking a hero and getting a new one.
Each hero shoudl only be allowed to be chosen once.
When heroes are picked manually this is fine, and tehre is also arrays in place to prevent the same hero from being randomed twice.
However, the problem arises with -repick.
The unwanted hero has to be re-inserted into the array, while the new hero chosen must be removed.
(baiscally when u -repick your hero someone else must then be allowed to choose it thourgh any of the methods above and ure new hero ccant be the same as one someone already has)
what follows is the triggers for this system:
SETTING THE HERO VARS
MasterHeroSetup
Events Conditions Actions
-------- HERO SETUP -------- Set Hero[1] = Arch Druid|r (|c00FF0033Support Caster|r) 0065 <gen> Set Hero[2] = Death Mage|r (|c00FF0033Support Caster|r) 0066 <gen> Set Hero[3] = Demon|r (|c00FF0033Frontline Melee|r) 0074 <gen> Set Hero[4] = Disruptor|r (|c00FF0033Support Melee|r) 0075 <gen> Set Hero[5] = Berserker|r (|c00FF0033Frontline Melee|r) 0076 <gen> Set Hero[6] = Elven Ranger|r (|c00FF0033Ranged|r) 0078 <gen> Set Hero[7] = Burrower|r (|c00FF0033Frontline Melee|r) (Standard) 0080 <gen> Set Hero[8] = Elementalist|r (|c00FF0033Caster|r) 0082 <gen> Set Hero[9] = Shadow Ranger|r (|c00FF0033Ranged|r) 0013 <gen> Set Hero[10] = SwordMaster|r (|c00FF0033Melee|r) 0089 <gen> Set Hero[11] = Hill Giant|r (|c00FF0033Frontline Melee|r) 0087 <gen> Set Hero[12] = Barbarian|r (|c00FF0033Melee|r) 0239 <gen> Set Hero[13] = Vampire|r (|c00FF0033Support Melee|r) 0095 <gen> Set Hero[14] = Voodoo Priest|r (|c00FF0033Support Caster|r) 0225 <gen> Set Hero[15] = Shadowmancer|r (|c00FF0033Caster|r) 0159 <gen> Set Hero[16] = Court Wizard|r (|c00FF0033Support Caster|r) 0099 <gen> Set Hero[17] = Jungle Troll|r (|c00FF0033Ranged|r) 0122 <gen> Set Hero[18] = Forest Guardian|r (|c00FF0033Caster|r) 0180 <gen> Set Hero[19] = Arcane Summoner|r (|c00FF0033Caster|r) 0126 <gen> Set Hero[20] = Viper Spider|r (|c00FF0033Melee|r) 0152 <gen> Set Hero[21] = Lichmaster|r (|c00FF0033Caster|r) 0128 <gen> Set Hero[22] = Pit Daemon|r (|c00FF0033Frontline Melee|r) (Standard) 0131 <gen> Set Hero[23] = Diabloist|r (|c00FF0033Caster|r) 0132 <gen> Set Hero[24] = Sea Drake|r (|c00FF0033Support Caster|r) 0133 <gen> Set Hero[25] = Goblin Mechanic|r (|c00FF0033Melee|r) 0091 <gen> Unit - Hide Goblin Mechanic|r (|c00FF0033Melee|r) 0091 <gen> Set Random_Count = 25 For each (Integer A) from 1 to Random_Count, do (Actions)
Loop - Actions
Set HeroType[(Integer A)] = (Unit-type of Hero[(Integer A)])
For each (Integer B) from 1 to Random_Count, do (Actions)
Loop - Actions
Set Random_Data[(Integer B)] = (Integer B)
Set Random_TitanCount = 8 -------- ICON SETUP -------- Set HeroIcon[1] = ReplaceableTextures\CommandButtons\BTNFurion.blp Set HeroIcon[2] = ReplaceableTextures\CommandButtons\BTNKelThuzad.blp Set HeroIcon[3] = ReplaceableTextures\CommandButtons\BTNEvilIllidan.blp Set HeroIcon[4] = ReplaceableTextures\CommandButtons\BTNRevenant.blp Set HeroIcon[5] = ReplaceableTextures\CommandButtons\BTNHellScream.blp Set HeroIcon[6] = ReplaceableTextures\CommandButtons\BTNSylvanusWindrunner.blp Set HeroIcon[7] = ReplaceableTextures\CommandButtons\BTNHeroCryptLord.blp Set HeroIcon[8] = ReplaceableTextures\CommandButtons\BTNArchimonde.blp Set HeroIcon[9] = ReplaceableTextures\CommandButtons\BTNBansheeRanger.blp Set HeroIcon[10] = ReplaceableTextures\CommandButtons\BTNHeroBloodElfPrince.blp Set HeroIcon[11] = ReplaceableTextures\CommandButtons\BTNOneHeadedOgre.blp Set HeroIcon[12] = ReplaceableTextures\CommandButtons\BTNBeastMaster.blp Set HeroIcon[13] = ReplaceableTextures\CommandButtons\BTNTichondrius.blp Set HeroIcon[14] = ReplaceableTextures\CommandButtons\BTNWitchDoctor.blp Set HeroIcon[15] = ReplaceableTextures\CommandButtons\BTNSkeletonMage.blp Set HeroIcon[16] = ReplaceableTextures\CommandButtons\BTNJaina.blp Set HeroIcon[17] = ReplaceableTextures\CommandButtons\BTNForestTroll.blp Set HeroIcon[18] = ReplaceableTextures\CommandButtons\BTNAncientOfTheEarth.blp Set HeroIcon[19] = ReplaceableTextures\CommandButtons\BTNHeroArchMage.blp Set HeroIcon[20] = ReplaceableTextures\CommandButtons\BTNSpider.blp Set HeroIcon[21] = ReplaceableTextures\CommandButtons\BTNLichVersion2.blp Set HeroIcon[22] = ReplaceableTextures\CommandButtons\BTNSludgeCreature.blp Set HeroIcon[23] = ReplaceableTextures\CommandButtons\BTNKiljaedin.blp Set HeroIcon[24] = ReplaceableTextures\CommandButtons\BTNSeaDrake.blp Set HeroIcon[25] = ReplaceableTextures\CommandButtons\BTNGoblinSapper.blp
THE CHOOSE HERO BIT (ONE FOR EACH HERO) Choose Hero 1
Events
Unit - A unit enters HeroChoose1 <gen>
Conditions
And - All (Conditions) are true
Conditions
Hero_Taken[1] Equal to False (Unit-type of (Triggering unit)) Equal to Spirit (Hero Picker) (Number of units in (Units in HeroChoose1 <gen> matching (((Owner of (Matching unit)) Not equal to (Owner of (Triggering unit))) and ((Unit-type of (Matching unit)) Equal to Spirit (Hero Picker))))) Equal to 0
Actions
Set HeroCinematicPlayerNumber = (Player number of PlayerArray[(Player number of (Owner of (Triggering unit)))]) Set HeroCinematicHeroNumber = 1 Trigger - Run Hero Cinematics <gen> (checking conditions) Set HeroInfoText = (Player group((Owner of (Triggering unit)))) Cinematic - Clear the screen of text messages for HeroInfoText Game - Display to HeroInfoText for 120.00 seconds the text: Arch Druid (|c00FF0... Game - Display to HeroInfoText for 120.00 seconds the text: |c000099FFDifficult... Game - Display to HeroInfoText for 120.00 seconds the text: |c000099FFStrength|... Game - Display to HeroInfoText for 120.00 seconds the text: |c000099FFHero Powe... Game - Display to HeroInfoText for 120.00 seconds the text: |C0099CC99To select... Custom script: call DestroyForce(udg_HeroInfoText)
THE MASTER HERO CINEMATIC BIT
Hero Cinematics
Events Conditions Actions
Player Group - Add PlayerArray[HeroCinematicPlayerNumber] to PlayersViewingCinPG Set HeroINTEGER[HeroCinematicPlayerNumber] = HeroCinematicHeroNumber Set ViewingHeroCin[HeroCinematicPlayerNumber] = True Set HeroCinematicPoint = (Center of HeroChooseRegion[HeroCinematicHeroNumber]) Unit - Move SpiritPicker[HeroCinematicPlayerNumber] instantly to HeroCinematicPoint Custom script: call RemoveLocation(udg_HeroCinematicPoint) -------- Does not enable for refs -------- -------- ^^ refers to the orginal owner not the new one -------- Player - Enable Choose Hero (|c0000FF00X|r) (Hero Pickers) for (Owner of SpiritPicker[HeroCinematicPlayerNumber]) Animation - Change SpiritPicker[HeroCinematicPlayerNumber]'s vertex coloring to (50.00%, 50.00%, 50.00%) with 95.00% transparency Animation - Change SpiritPicker[HeroCinematicPlayerNumber]'s size to (60.00%, 60.00%, 60.00%) of its original size Unit - Set SpiritPicker[HeroCinematicPlayerNumber] movement speed to 0.00 Multiboard - Minimize ScoreMultiboard Camera - Apply HeroCamera[HeroCinematicHeroNumber] for PlayerArray[HeroCinematicPlayerNumber] over 0.75 seconds Wait 0.20 seconds Sound - Play HeroCinSound[HeroCinematicHeroNumber] at 100.00% volume, attached to Hero[HeroCinematicHeroNumber]
MASTER HERO CHOOSING TRIGGER (MANUAL)
Choose Heroes MASTER
Events
Unit - A unit Begins casting an ability
Conditions
And - All (Conditions) are true
Conditions
(Ability being cast) Equal to Choose Hero (|c0000FF00X|r) (Hero Pickers) Hero_Taken[HeroINTEGER[(Player number of PlayerArray[(Player number of (Owner of (Triggering unit)))])]] Equal to False
Actions
Set ViewingHeroCin[(Player number of PlayerArray[(Player number of (Owner of (Triggering unit)))])] = False Camera - Reset camera for (Owner of (Triggering unit)) to standard game-view over 0.00 seconds Set ChooseHeroText = (Player group((Owner of (Triggering unit)))) Cinematic - Clear the screen of text messages for ChooseHeroText Custom script: call DestroyForce(udg_ChooseHeroText) Set HeroChoosePointA = (Position of Hero[HeroINTEGER[(Player number of PlayerArray[(Player number of (Owner of (Triggering unit)))])]]) Sound - Play HeroChosen <gen> at 100.00% volume, located at HeroChoosePointA with Z offset 0.00 Special Effect - Create a special effect at HeroChoosePointA using Abilities\Spells\Other\Monsoon\MonsoonBoltTarget.mdl Special Effect - Destroy (Last created special effect) Custom script: call RemoveLocation(udg_HeroChoosePointA) Unit - Hide Hero[HeroINTEGER[(Player number of PlayerArray[(Player number of (Owner of (Triggering unit)))])]] Player Group - Remove (Owner of (Triggering unit)) from PlayersViewingCinPG Set Hero_Taken[HeroINTEGER[(Player number of PlayerArray[(Player number of (Owner of (Triggering unit)))])]] = True If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Owner of (Triggering unit)) is in Team1) Equal to True
Then - Actions
Set HeroChoosePointA = (Center of Team1StartZone <gen>) Unit - Create 1 HeroType[HeroINTEGER[(Player number of PlayerArray[(Player number of (Owner of (Triggering unit)))])]] for (Owner of (Triggering unit)) at HeroChoosePointA facing 0.00 degrees Custom script: call RemoveLocation(udg_HeroChoosePointA) Multiboard - Set the icon for ScoreMultiboard item in column 1, row ((Player number of PlayerArray[(Player number of (Owner of (Triggering unit)))]) + 1) to HeroIcon[HeroINTEGER[(Player number of PlayerArray[(Player number of (Owner of (Triggering unit)))])]]
Else - Actions
Set HeroChoosePointA = (Center of Team2StartZone <gen>) Unit - Create 1 HeroType[HeroINTEGER[(Player number of PlayerArray[(Player number of (Owner of (Triggering unit)))])]] for (Owner of (Triggering unit)) at HeroChoosePointA facing 180.00 degrees Multiboard - Set the icon for ScoreMultiboard item in column 1, row ((Player number of PlayerArray[(Player number of (Owner of (Triggering unit)))]) + 2) to HeroIcon[HeroINTEGER[(Player number of PlayerArray[(Player number of (Owner of (Triggering unit)))])]] Custom script: call RemoveLocation(udg_HeroChoosePointA)
Set PlayerHero[(Player number of PlayerArray[(Player number of (Owner of (Triggering unit)))])] = (Last created unit) Player Group - Add (Owner of (Triggering unit)) to PlayersWithHeroesPG If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Owner of (Triggering unit)) is in Team1) Equal to True
Then - Actions
Set HeroChoosePointA = (Center of Team1StartZone <gen>) Camera - Pan camera for (Owner of (Triggering unit)) to HeroChoosePointA over 1.00 seconds Custom script: call RemoveLocation(udg_HeroChoosePointA)
Else - Actions
Set HeroChoosePointA = (Center of Team2StartZone <gen>) Camera - Pan camera for (Owner of (Triggering unit)) to HeroChoosePointA over 1.00 seconds Custom script: call RemoveLocation(udg_HeroChoosePointA)
Game - Display to (All players matching (((Matching player) is in PlayersViewingCinPG) Equal to False)) for 9.00 seconds the text: (PlayerColor[(Player number of (Owner of (Triggering unit)))] + (((Name of (Owner of (Triggering unit))) + |r) + ( has chosen + (PlayerColor[(Player number of (Owner of (Triggering unit)))] + ((Name of PlayerHero[(Player number of PlayerArray[(Player number Set ChosenTextPG = (Player group((Owner of (Triggering unit)))) Game - Display to ChosenTextPG for 9.00 seconds the text: |C0099CC99You may r... Game - Display to ChosenTextPG for 9.00 seconds the text: |C0099CC99You can t... Game - Display to ChosenTextPG for 9.00 seconds the text: |c0099CC99USE your ... Custom script: call DestroyForce(udg_ChosenTextPG) Hero - Create |c007EBFF1Mercenary Soldier Contract|r and give it to PlayerHero[(Player number of PlayerArray[(Player number of (Owner of (Triggering unit)))])] Selection - Select PlayerHero[(Player number of PlayerArray[(Player number of (Owner of (Triggering unit)))])] for (Owner of (Triggering unit)) Sound - Play HeroSpawned <gen> at 100.00% volume, attached to PlayerHero[(Player number of PlayerArray[(Player number of (Owner of (Triggering unit)))])] Special Effect - Create a special effect attached to the origin of PlayerHero[(Player number of PlayerArray[(Player number of (Owner of (Triggering unit)))])] using Abilities\Spells\Other\Awaken\Awaken.mdl Special Effect - Destroy (Last created special effect) Set SpiritPicker[(Player number of PlayerArray[(Player number of (Owner of (Triggering unit)))])] = No unit Unit - Remove (Triggering unit) from the game Trigger - Run Hero Cinematic Skip OFF <gen> (checking conditions) -------- should prvent someone from randming/repicking this hero but dosnt -------- Set Random_Data[HeroINTEGER[(Player number of PlayerArray[(Player number of (Owner of (Triggering unit)))])]] = Random_Count Set Random_Count = (Random_Count - 1) -------- reduces random count by 1 preventing the last hero frombeing taken --------
MASTER HERO RANDOM TRIGGER
Random Hero
Events
Unit - A unit enters RandomRegion <gen>
Conditions
(Unit-type of (Triggering unit)) Equal to Spirit (Hero Picker)
Actions
Trigger - Turn off (This trigger) Set RandomHero = (Random integer number between 1 and Random_Count) -------- TEST RANDOM -------- Set RandomPoint = (Center of RandomRegion <gen>) Sound - Play HeroChosen <gen> at 100.00% volume, located at RandomPoint with Z offset 0.00 Special Effect - Create a special effect at RandomPoint using Abilities\Spells\Other\Monsoon\MonsoonBoltTarget.mdl Special Effect - Destroy (Last created special effect) Custom script: call RemoveLocation(udg_RandomPoint) If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Owner of (Triggering unit)) is in Team1) Equal to True
Then - Actions
Set RandomPoint = (Center of Team1StartZone <gen>) Unit - Create 1 HeroType[Random_Data[RandomHero]] for (Owner of (Triggering unit)) at RandomPoint facing 0.00 degrees Multiboard - Set the icon for ScoreMultiboard item in column 1, row ((Player number of PlayerArray[(Player number of (Owner of (Triggering unit)))]) + 1) to HeroIcon[Random_Data[RandomHero]]
Else - Actions
Set RandomPoint = (Center of Team2StartZone <gen>) Unit - Create 1 HeroType[Random_Data[RandomHero]] for (Owner of (Triggering unit)) at RandomPoint facing 180.00 degrees Multiboard - Set the icon for ScoreMultiboard item in column 1, row ((Player number of PlayerArray[(Player number of (Owner of (Triggering unit)))]) + 2) to HeroIcon[Random_Data[RandomHero]]
Set PlayerHero[(Player number of PlayerArray[(Player number of (Owner of (Triggering unit)))])] = (Last created unit) Custom script: call RemoveLocation(udg_RandomPoint) Player Group - Add (Owner of (Triggering unit)) to PlayersWithHeroesPG Set RanUnitType = (Unit-type of (Last created unit)) Selection - Select (Last created unit) for (Owner of (Triggering unit)) Hero - Create |c007EBFF1Mercenary Soldier Contract|r and give it to (Last created unit) -------- GET UNIT TYPE OF LAST CREATED UNIT -------- Unit Group - Pick every unit in (Units in HeroSelectionRegion <gen> matching ((Unit-type of (Matching unit)) Equal to RanUnitType)) and do (Actions)
Loop - Actions
Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Spells\Other\Monsoon\MonsoonBoltTarget.mdl Special Effect - Destroy (Last created special effect) Set RandomPoint = (Position of (Picked unit)) Sound - Play HeroChosen <gen> at 100.00% volume, located at RandomPoint with Z offset 0.00 Custom script: call RemoveLocation(udg_RandomPoint) Unit - Hide (Picked unit) Set Hero_Taken[Random_Data[RandomHero]] = True
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Owner of (Triggering unit)) is in Team1) Equal to True
Then - Actions
Set RandomPoint = (Center of Team1StartZone <gen>) Camera - Pan camera for (Owner of (Triggering unit)) to RandomPoint over 1.00 seconds
Else - Actions
Set RandomPoint = (Center of Team2StartZone <gen>) Camera - Pan camera for (Owner of (Triggering unit)) to RandomPoint over 1.00 seconds
Custom script: call RemoveLocation(udg_RandomPoint) Sound - Play HeroSpawned <gen> at 100.00% volume, attached to (Last created unit) Special Effect - Create a special effect attached to the origin of (Last created unit) using Abilities\Spells\Other\Awaken\Awaken.mdl Special Effect - Destroy (Last created special effect) Game - Display to (All players matching (((Matching player) is in PlayersViewingCinPG) Equal to False)) for 9.00 seconds the text: (PlayerColor[(Player number of (Owner of (Triggering unit)))] + (((Name of (Owner of (Triggering unit))) + |r) + ( has randomly chosen + (PlayerColor[(Player number of (Owner of (Triggering unit)))] + ((Name of (Last created unit)) + |r!))))) Set RandomTextPG = (Player group((Owner of (Triggering unit)))) Game - Display to RandomTextPG for 9.00 seconds the text: |C0099CC99You may r... Game - Display to RandomTextPG for 9.00 seconds the text: |C0099CC99You can t... Game - Display to RandomTextPG for 9.00 seconds the text: |c0099CC99USE your ... Custom script: call DestroyForce(udg_RandomTextPG) Set Random_Data[RandomHero] = Random_Count -------- SEARCH FOR THIS ^^ -------- Set Random_Count = (Random_Count - 1) Set SpiritPicker[(Player number of PlayerArray[(Player number of (Owner of (Triggering unit)))])] = No unit Unit - Remove (Triggering unit) from the game Trigger - Run Hero Cinematic Skip OFF <gen> (checking conditions) Trigger - Turn on (This trigger)
MASTER HERO -REPICK TRIGGER
Repick Hero
Events
Player - Player 1 (Red) types a chat message containing -repick as An exact match Player - Player 2 (Blue) types a chat message containing -repick as An exact match Player - Player 3 (Teal) types a chat message containing -repick as An exact match Player - Player 4 (Purple) types a chat message containing -repick as An exact match Player - Player 5 (Yellow) types a chat message containing -repick as An exact match Player - Player 6 (Orange) types a chat message containing -repick as An exact match Player - Player 7 (Green) types a chat message containing -repick as An exact match Player - Player 8 (Pink) types a chat message containing -repick as An exact match Player - Player 11 (Dark Green) types a chat message containing -repick as An exact match Player - Player 12 (Brown) types a chat message containing -repick as An exact match
Conditions
And - All (Conditions) are true
Conditions
PlayerHero[(Player number of PlayerArray[(Player number of (Triggering player))])] Not equal to No unit Or - Any (Conditions) are true
Conditions
((Triggering player) is in Team1) Equal to True ((Triggering player) is in Team2) Equal to True
Actions
Trigger - Turn off (This trigger) If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Triggering player) Current gold) Less than 250
Then - Actions
Set RepickTextPG = (Player group((Triggering player))) Game - Display to RepickTextPG the text: ((|c00FF0033 + You do not have enough Gold to repick your Hero.) + |r) Custom script: call DestroyForce(udg_RepickTextPG)
Else - Actions
Player - Add -250 to (Triggering player) Current gold Set RepickTextPG = (Player group((Triggering player))) Cinematic - Clear the screen of text messages for RepickTextPG Custom script: call DestroyForce(udg_RepickTextPG) Game - Display to (All players matching (((Matching player) is in PlayersViewingCinPG) Equal to False)) for 9.00 seconds the text: (PlayerColor[(Player number of (Triggering player))] + (((Name of (Triggering player)) + |r) + has repicked thier hero at a cost of 250 Gold!)) Set RepickedHeroType = (Unit-type of PlayerHero[(Player number of PlayerArray[(Player number of (Triggering player))])]) If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Or - Any (Conditions) are true
Conditions
(Item carried by PlayerHero[(Player number of PlayerArray[(Player number of (Triggering player))])] in slot 1) Not equal to No item (Item carried by PlayerHero[(Player number of PlayerArray[(Player number of (Triggering player))])] in slot 2) Not equal to No item (Item carried by PlayerHero[(Player number of PlayerArray[(Player number of (Triggering player))])] in slot 3) Not equal to No item (Item carried by PlayerHero[(Player number of PlayerArray[(Player number of (Triggering player))])] in slot 4) Not equal to No item (Item carried by PlayerHero[(Player number of PlayerArray[(Player number of (Triggering player))])] in slot 5) Not equal to No item (Item carried by PlayerHero[(Player number of PlayerArray[(Player number of (Triggering player))])] in slot 6) Not equal to No item
Then - Actions
-------- Actually need to store any items they have -------- For each (Integer A) from 1 to 6, do (Actions)
Loop - Actions
Hero - Give (Item carried by PlayerHero[(Player number of PlayerArray[(Player number of (Triggering player))])] in slot (Integer A)) to StashUnit[(Player number of PlayerArray[(Player number of (Triggering player))])]
Set RepickTextPG = (Player group((Triggering player))) Game - Display to RepickTextPG for 9.00 seconds the text: (The items you were... Custom script: call DestroyForce(udg_RepickTextPG) Set StashPoint = (Position of StashUnit[(Player number of PlayerArray[(Player number of (Triggering player))])