• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Solved] how to disable hero after a player picked it?

Status
Not open for further replies.
Level 5
Joined
Jan 2, 2013
Messages
84
Probably been asked many times, but the search filter gave too many answers that i gave up

I got a hero tavern that I want only 1 hero per game, not per player. How do I do that?
 
Level 5
Joined
Jul 31, 2020
Messages
103
Go to your Tavern in the object editor, Abilities - Normal, add "Sell Units (Asud)", then scroll down to Techtree - Units Sold, and remove every hero from the list.

Now, trigger editor. You'll need 2 triggers, they look like so in GUI:
One to initialize the Tavern with all the heroes you want it to sell.
  • Init Tavern
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Neutral Building - Add Alchemist to Tavern 0000 <gen> with 0 in stock and a max stock of 1
      • Neutral Building - Add Sea Witch to Tavern 0000 <gen> with 0 in stock and a max stock of 1
      • Neutral Building - Add Tinker to Tavern 0000 <gen> with 0 in stock and a max stock of 1
      • Neutral Building - Add Beastmaster to Tavern 0000 <gen> with 0 in stock and a max stock of 1
      • Neutral Building - Add Brewmaster to Tavern 0000 <gen> with 0 in stock and a max stock of 1
      • Neutral Building - Add Dark Ranger to Tavern 0000 <gen> with 0 in stock and a max stock of 1
      • Neutral Building - Add Firelord to Tavern 0000 <gen> with 0 in stock and a max stock of 1
      • Neutral Building - Add Pit Lord to Tavern 0000 <gen> with 0 in stock and a max stock of 1
And one that removes the sold hero from it.
  • Remove from Tavern
    • Events
      • Unit - A unit Sells a unit
    • Conditions
      • (Triggering unit) Equal to Tavern 0000 <gen>
    • Actions
      • Neutral Building - Remove (Unit-type of (Sold unit)) from (Triggering unit)
Short explanation is, well, you need Sell Units on the Tavern for those Add/Remove unit-type functions to work on it. And you need to add the heroes to it during runtime in order to be able to remove them; otherwise they would just stay available, Remove unit-type would do nothing.
 
Status
Not open for further replies.
Top