• 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.

Random Hero Starting Attributes

Status
Not open for further replies.
Level 4
Joined
Nov 25, 2008
Messages
76
Hello, I'm not quite sure if this is the right place to ask this. If it isn't please bear with me.

Anyway, I would like for each hero to have random starting attributes instead of a given one. Let's say, a player picks a class of warrior and his starting strength attribute is 12. While another picks the same class and his strength attribute is 15. Is this possible, if so how? I'm thinking triggers, but I'm not quite sure...

As always +rep for any help that points to the right direction...
 
Level 4
Joined
Mar 23, 2008
Messages
90
if you use taverns or mercenary outposts (only buildings that sells a unit) this would work

  • Warrior
    • Events
      • Unit - A unit is sold
      • Conditions
        • (Unit-type of (Sold unit)) Equal to Warrior
        • Actions
          • Wait 1.00 seconds
          • Hero - Modify Strength of (Last created unit): Set to (Random integer number between 10 and 20)

modify numbers as you want

or if u use regions to make units use this
  • Warrior
    • Events
      • Unit - A unit enters create warrior region <gen>
    • Conditions
    • Actions
      • Remove (entering unit) from the game
      • Unit - A unit enters create warrrior region <gen>
      • Unit - Create 1 Warrior for (Owner of (Entering unit)) at (Center of Created warrior region <gen>) facing Default building facing degrees
      • Wait 1.00 seconds
      • Hero - Modify Strength of (Sold unit): Set to (Random integer number between 10 and 20)
ive tested it and it works fine for me. dont know if you need the "wait" triggers
 
Level 7
Joined
Jul 19, 2008
Messages
58
  • Warrior
    • Events
      • Unit - A unit enters create warrior region <gen>
    • Conditions
    • Actions
      • Remove (entering unit) from the game
      • Unit - A unit enters create warrrior region <gen>
      • Unit - Create 1 Warrior for (Owner of (Entering unit)) at (Center of Created warrior region <gen>) facing Default building facing degrees
      • Wait 1.00 seconds
      • Hero - Modify Strength of (Sold unit): Set to (Random integer number between 10 and 20)

lol wow, you sure you tested this one and it worked? why is the event in actions??

  • Warrior
    • Events
      • Unit - A unit enters create warrior region <gen>
    • Conditions
    • Actions
      • Unit - Remove (Triggering Unit) from the game
      • Unit - Create 1 Warrior for (Owner of (Triggering Unit)) at (Center of WHATEVER_REGION001 <gen>) facing Default building facing X degrees
      • Hero - Modify Strength of (Last Created Unit): Set to (Random integer number between 10 and 20)
 
Level 4
Joined
Mar 23, 2008
Messages
90
Unfortunately I use triggers to create heroes, although I will see if I can convert it. Thanks anyway!

yeah i suppose u can do it with triggers. this is an example trigger
  • Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Wait 2.00 seconds
      • Unit - Create 1 Mountain King for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees
      • Set Warriorhero = (Last created unit)
      • Trigger - Run set attribute <gen> (ignoring conditions)
  • set attribute
    • Events
    • Conditions
    • Actions
      • Hero - Modify Strength of Warriorhero: Set to (Random integer number between 10 and 20)
      • Hero - Modify Agility of Warriorhero: Set to (Random integer number between 10 and 20)
      • Hero - Modify Intelligence of Warriorhero: Set to (Random integer number between 10 and 20)
then remove the leak i dont really know how to do.
 
Status
Not open for further replies.
Top