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

[Trigger] giving lumber to a player (help pls)

Status
Not open for further replies.
Level 3
Joined
Jul 27, 2007
Messages
21
I nid a trigger sumthin like this. When a hero (Blademaster) levels up, it will get 2 lumber.
well my trigger is like this :

  • Lvl up
    • Events
      • Unit - A unit Gains a level
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Blademaster
    • Actions
      • Game - Display to (Player group((Triggering player))) for 6.00 seconds the text: |cff0894E6You hav g...
      • Player - Add 2 to (Triggering player) Current lumber
But my prob now is if i kill a boss of high level, i will jump a few levels (from lvl 1 straight away to 10). The lumber tat shud b given is 20 but still i just gain 2 lumber. how do i fix the trigger?
 
Level 8
Joined
May 27, 2007
Messages
170
Try something like this:

  • Hero Gains Level
    • Events
      • Unit - A unit Gains a level
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Blademaster
    • Actions
      • Player - Add (((Hero level of (Triggering unit)) - HeroLevel) x 2) to (Owner of (Triggering unit)) Current lumber
      • Set HeroLevel = (Hero level of (Triggering unit))
HeroLevel is an Integer variable which needs an initial value of 1.

That will just calculate how many levels the hero has gained and award the player two lumber for each level.

For example if the hero levels up from level 1 to level 2, the trigger would take the units new level, 2, and subtract it's old level (HeroLevel) then multiply that by 2 lumber. So you would have 2 - 1 x 2 which is equal to 1 x 2 which equals 2.

If your hero went from level 3 to level 7 for example, you would have 7 - 3 x 2 which is equal to 4 x 2 which equals 8.

Then it sets HeroLevel to the hero's new level ready for the next time it gains a level.
 
Level 3
Joined
Jul 27, 2007
Messages
21
HermanTheGibbon, Thx! i really appriciate ur help :D :thumbs_up:

When your blademaster gains a level you want to give him 2 bonus attribute points.
just use trigger
Add 2 lumber to owner of Leveling hero.
it's so simple, why all that fuzz
Urm... Do you even know wat trigger i wanted? :con:

Try adding lumber X level that unit grain to lumber instead.
Edit, when did you post?!
Err... why wud u ask tat? just yday. Why?
 
Status
Not open for further replies.
Top