• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!

Restrictions to pick heros

Status
Not open for further replies.
Level 3
Joined
May 30, 2012
Messages
29
Hi ,i created this trigger to block one hero if a player pick a specific hero

  • No2HealersPal
    • Events
      • Unit - A unit Sells a unit
    • Conditions
      • And - All (Conditions) are true
        • Conditions
          • (Unit-type of (Sold unit)) Equal to Paladin
          • Or - Any (Conditions) are true
            • Conditions
              • (Selling unit) Equal to TavernN1 0000 <gen>
              • (Selling unit) Equal to TavernN2 0001 <gen>
              • (Selling unit) Equal to TavernN3 0057 <gen>
    • Actions
      • Player Group - Pick every player in (All allies of Player 6 (Orange)) and do (Actions)
        • Loop - Actions
          • Player - Make Shadow Hunter Unavailable for training/construction by (Picked player)

we see if one player pick paladin, the team cant choose shandow hunter, but if pick shandow hunter first, team cant choose paladin.

the problem is, if player go random hero. will get shandow hunter and paladin togheter. if paladin has been picked, and one player of team decide random, he will get shandow hunter.

Help plz.


  • ManualHeroL
    • Events
      • Unit - A unit Sells a unit
    • Conditions
      • And - All (Conditions) are true
        • Conditions
          • ((Sold unit) is A Hero) Equal to True
          • Or - Any (Conditions) are true
            • Conditions
              • (Selling unit) Equal to TavernN1 0000 <gen>
              • (Selling unit) Equal to TavernN2 0001 <gen>
              • (Selling unit) Equal to TavernN3 0057 <gen>
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • HeroChosenByPlayer[(Player number of (Owner of (Sold unit)))] Equal to True
        • Then - Actions
          • Unit - Remove (Sold unit) from the game
        • Else - Actions
          • For each (Integer A) from 1 to RandomCount, do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Unit-type of (Sold unit)) Equal to HeroType[(Integer A)]
                • Then - Actions
                  • Set HeroType[(Integer A)] = HeroType[RandomCount]
                  • Set RandomCount = (RandomCount - 1)
                • Else - Actions
          • Set HeroChosenByPlayer[(Player number of (Owner of (Sold unit)))] = True
          • Unit - Move (Sold unit) instantly to (Center of StartPointL <gen>)
          • Game - Display to (All players) the text: (((Name of (Owner of (Buying unit))) + has chosen ) + (Name of (Sold unit)))
          • Player Group - Pick every player in (All allies of Player 6 (Orange)) and do (Actions)
            • Loop - Actions
              • Player - Make (Unit-type of (Sold unit)) Unavailable for training/construction by (Picked player)
          • For each (Integer A) from 1 to 24, do (Actions)
            • Loop - Actions
              • Player - Make HeroType[(Integer A)] Unavailable for training/construction by (Owner of (Buying unit))
              • Camera - Pan camera for (Owner of (Sold unit)) to (Center of StartPointL <gen>) over 1.00 seconds
              • Selection - Clear selection for (Owner of (Sold unit))
              • Selection - Add (Sold unit) to selection for (Owner of (Sold unit))
Too,if all team decide go random, can be given paladin and shadow hunter.... Fix it plz!

  • Tarvern
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set HeroType[1] = Paladin
      • Set HeroType[2] = Archmage
      • Set HeroType[3] = Mountain King
      • Set HeroType[4] = Blood Mage
      • Set HeroType[5] = Blademaster
      • Set HeroType[6] = Far Seer
      • Set HeroType[7] = Tauren Chieftain
      • Set HeroType[8] = Shadow Hunter
      • Set HeroType[9] = Death Knight
      • Set HeroType[10] = Lich
      • Set HeroType[11] = Dreadlord
      • Set HeroType[12] = Crypt Lord
      • Set HeroType[13] = Keeper of the Grove
      • Set HeroType[14] = Priestess of the Moon
      • Set HeroType[15] = Demon Hunter
      • Set HeroType[16] = Warden
      • Set HeroType[17] = Alchemist
      • Set HeroType[18] = Naga Sea Witch
      • Set HeroType[19] = Tinker
      • Set HeroType[20] = Beastmaster
      • Set HeroType[21] = Dark Ranger
      • Set HeroType[22] = Firelord
      • Set HeroType[23] = Pandaren Brewmaster
      • Set HeroType[24] = Pit Lord
      • Set RandomCount = 24
      • Set TotalHero = 24
      • For each (Integer A) from 1 to 24, do (Actions)
        • Loop - Actions
          • Set RandomData[(Integer A)] = (Integer A)
      • For each (Integer B) from 1 to 24, do (Actions)
        • Loop - Actions
          • Set RandomData[(Integer B)] = (Integer B)
      • Trigger - Turn off (This trigger)
 
Last edited:
Level 29
Joined
Oct 24, 2012
Messages
6,543
y are u doing this ?
  • For each (Integer A) from 1 to 24, do (Actions)
  • Loop - Actions
  • Set RandomData[(Integer A)] = (Integer A)
  • For each (Integer B) from 1 to 24, do (Actions)
  • Loop - Actions
  • Set RandomData[(Integer B)] = (Integer B)
also dont use integer A/B make ur own integer. integer A/B are less efficient and slower.

take out the and condition.
  • And - All (Conditions) are true
  • Conditions
  • ((Sold unit) is A Hero) Equal to True
  • Or - Any (Conditions) are true
  • Conditions
  • (Selling unit) Equal to TavernN1 0000 <gen>
  • (Selling unit) Equal to TavernN2 0001 <gen>
  • (Selling unit) Equal to TavernN3 0057 <gen>
as for ur problem u can have a random pick then de-index that unit and any other unit u dont want them to pick from.
example if u pick unit 2 and u dont want any else to have unit 4 and 5 also then, move ur max index which is 24 atm to that spot then reduce the index then move the next one and the same again. this will stop them from being able to get the units even when using pick random unit.
 
Status
Not open for further replies.
Top