• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Solved] Hero Pick Variable Store

Status
Not open for further replies.
Level 9
Joined
Dec 16, 2017
Messages
343
Hello guys, i am trying to store the heroes that people pick from tavern so later on i can put all of them in the arena, i tried this, but seems that it doesn't work like i wanted, i can pick heroes from 1 to 5 in my map, how can i do it properly? I'd like to use this variable i create from each hero picked also for giving item to players after each boss, and teleport to duel area.
I can add them to a unit group, my question is,if i never empty this group during the whole game, can it crash?And if i shall empty it,when shall i do it?I'd use this group of units in the game for like 14-15 times during the whole map

I use 1.28.5 WE patch

  • This is my hero pick trigger
  • Hero Selection
    • Events
      • Unit - A unit Sells a unit
    • Conditions
    • Actions
      • For each (Integer IntA) from 1 to 46, 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[IntA]
            • Then - Actions
              • Set BuyingU = (Buying unit)
              • Set SoldU = (Sold unit)
              • Set HeroSpawn = (Center of RegionHeroSpawn <gen>)
              • Set MaxPlayers = (Number of players in (All players))
              • Set Player = (Owner of (Buying unit))
              • Set PlayerInteger = (Player number of (Owner of (Sold unit)))
              • Set Hero[PlayerInteger] = (Sold unit)
              • Unit Group - Add Hero[PlayerInteger] to ArenaHeroes
              • Unit - Explode BuyingU
              • Unit - Move SoldU instantly to HeroSpawn
              • Camera - Pan camera for (Owner of SoldU) to HeroSpawn over 0.05 seconds
              • Selection - Select SoldU for (Owner of SoldU)
              • Unit - Make SoldU face 270.00 over 0.00 seconds
              • Special Effect - Create a special effect at (Position of SoldU) using Abilities\Spells\Human\Resurrect\ResurrectTarget.mdl
              • Special Effect - Destroy (Last created special effect)
              • For each (Integer IntB) from 1 to 46, do (Actions)
                • Loop - Actions
                  • For each (Integer CurrentPlayer) from 1 to MaxPlayers, do (Actions)
                    • Loop - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • HeroClass[IntA] Equal to HeroClass[IntB]
                        • Then - Actions
                          • Player - Make HeroType[IntB] Unavailable for training/construction by (Player(CurrentPlayer))
                          • Unit - Change ownership of ClassHall[HeroClass[IntB]] to (Owner of Hero[PlayerInteger]) and Change color
                        • Else - Actions
              • Game - Display to (All players) the text: ((|c00996600 + (Name of (Owner of (Buying unit)))) + (|r + ( |c0000cc00decided to conquer the legion forces with|r + (|c00990000 + ((Name of (Sold unit)) + |r)))))
              • Custom script: call RemoveLocation(udg_HeroSpawn)
            • Else - Actions
  • [/COLOR]
This is the first boss trigger when he dies.
  • Big Timmy Death
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Dying unit) Equal to BigTimmy
    • Actions
      • Trigger - Turn off (This trigger)
      • Trigger - Turn off Big Timmy Enrage <gen>
      • Trigger - Turn off Big Timmy Teleport <gen>
      • Trigger - Turn off Big Timmy Shout <gen>
      • Trigger - Turn on Head Pick Up Initial <gen>
      • Trigger - Run Big Timmy Loot Drop <gen> (ignoring conditions)
      • Set DoomPlaying = False
      • Trigger - Run Music <gen> (ignoring conditions)
      • Cinematic - Send transmission to (All players) from No unit named Big Timmy: Play TimmyDeath <gen> and display Arghhhh!. Modify duration: Set to 2.00 seconds and Wait
      • Player - Add 5 to Player 1 (Red) Current lumber
      • Player - Add 250 to Player 1 (Red) Current gold
      • Player - Add 5 to Player 2 (Blue) Current lumber
      • Player - Add 250 to Player 2 (Blue) Current gold
      • Player - Add 5 to Player 3 (Teal) Current lumber
      • Player - Add 250 to Player 3 (Teal) Current gold
      • Player - Add 5 to Player 4 (Purple) Current lumber
      • Player - Add 250 to Player 4 (Purple) Current gold
      • Player - Add 5 to Player 5 (Yellow) Current lumber
      • Player - Add 250 to Player 5 (Yellow) Current gold
      • Trigger - Run Wave 5 Timer <gen> (ignoring conditions)
      • Unit Group - Pick every unit in ArenaHeroes and do (Actions)
        • Loop - Actions
          • Hero - Create |c00FF0000Token 1|r and give it to (Picked unit)
          • Special Effect - Create a special effect attached to the overhead of (Picked unit) using Abilities\Spells\Other\Awaken\Awaken.mdl
          • Special Effect - Destroy (Last created special effect)
      • Trigger - Turn off Boss Time Big Timmy <gen>
      • Game - Display to (All players) the text: (You defeated Big Timmy in + (|c00FFFF00 + ((String(BossTime[1])) + |r seconds!)))
      • Quest - Create a quest requirement for QuestTimmy with the description (You defeated Big Timmy in + (|c00FFFF00 + ((String(BossTime[1])) + |r seconds!)))
      • Cinematic - Send transmission to (All players) from a Player 11 (Dark Green) Ghost named The Guardian of Hyj... at (Center of RegionWorldTreeVisibility <gen>): Play No sound and display What is that? It ap.... Modify duration: Set to 5.00 seconds and Wait
      • Wait 5.00 seconds
      • Cinematic - Send transmission to (All players) from a Player 11 (Dark Green) Ghost named The Guardian of Hyj... at (Center of RegionWorldTreeVisibility <gen>): Play No sound and display That rabid beast is.... Modify duration: Set to 12.00 seconds and Wait
      • Wait 2.00 seconds
      • Cinematic - Send transmission to (All players) from a Player 11 (Dark Green) Ghost named The Guardian of Hyj... at (Center of RegionWorldTreeVisibility <gen>): Play No sound and display Perhaps put it towa.... Modify duration: Set to 8.00 seconds and Wait
 
Last edited:
Status
Not open for further replies.
Top