• 🏆 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!

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