How can I create a Random Hero Chooser?

Status
Not open for further replies.

XPTO25

X

XPTO25

Ok, I'm makeing a map in WE.

As you guys probably have seen in the Tool Palette, the are two buttons "Random Unit" and "Random Building" to choose a random unit or building to appear where you put it.

So... I would like to know how can I make one of those buttons but for Heros. To be "Random Hero".

I would really apreciate your help guys. :ogre_haosis:
 
You can not.

You can however script a system to do that. Just make an array list of hero types and use a random index to get a random hero type from that. Then it is a mater of creating it where ever you want. Repeate for every random hero you need.

You may wish to increase level, give items and learn spells of them after doing this.
 
  • hero setup
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Hero[1] = Paladin
      • Set Hero[2] = Archmage
      • Set Hero[3] = Mountain King
      • Set Hero[4] = Blood Mage
      • Set Number_of_heros = 4
  • random hero trigger
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to random_hero_item
    • Actions
      • Item - Remove (Item being manipulated)
      • Set temp_point = (Position of (Triggering unit))
      • Unit - Create 1 Hero[(Random integer number between 1 and Number_of_heros)] for (Owner of (Triggering unit)) at temp_point facing Default building facing degrees
      • Custom script: call RemoveLocation(udg_temp_point)
 
  • hero setup
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Hero[1] = Paladin
      • Set Hero[2] = Archmage
      • Set Hero[3] = Mountain King
      • Set Hero[4] = Blood Mage
      • Set Number_of_heros = 4
  • random hero trigger
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to random_hero_item
    • Actions
      • Item - Remove (Item being manipulated)
      • Set temp_point = (Position of (Triggering unit))
      • Unit - Create 1 Hero[(Random integer number between 1 and Number_of_heros)] for (Owner of (Triggering unit)) at temp_point facing Default building facing degrees
      • Custom script: call RemoveLocation(udg_temp_point)

The item should be rune and use trigger as spell trigger.
However I prefer a Locust Unit sold as Random Button.
 
Status
Not open for further replies.
Back
Top