• 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] Attribute Addition

Status
Not open for further replies.
Level 3
Joined
Jun 25, 2006
Messages
32
I want the trigger to add 0.2 Int to a Hero when it kills a unit but it doesn't work.
What am I doing wrong?

  • Int Gain
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Real((Level of IntGain for (Killing unit)))) Greater than or equal to 1.00
    • Actions
      • Hero - Modify Intelligence of (Killing unit): Add (1 / 5)
 
Last edited by a moderator:
  • Int Gain
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Real((Level of IntGain for (Killing unit)))) Greater than or equal to 1.00
    • Actions
      • Hero - Modify Intelligence of (Killing unit): Add (1 / 5)
:confused: Thats quite easy and i think it should work
Maybe get sure that it is the right ability (for example with a text message to be sure that it will trigger )
And remember that if the hero has 20 int and will get + 0.2 it wont be recogniseable till he has more that 21
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
Remember, you can not add a "real" ammount of stats since hero stats are "integer" even though they can gain "real" ammounts of stats on level up but they do not take effect.
You can only add whole numbers of stats (1,2,3. . .)
You can not add decimal stats (0.1,0.2,0.3. . .)

Thus 1/5 = 0 so you are adding 0 stats to it which is correct and it is working how you ordered it to.
You need to make a global real that every time a unit is killed it adds 0.2 to and once it reaches 1 it adds 1 to the units stats. To do this you need to use an if then else action and the conditions is IF global_real = 1.00 (real comparision), the then actions are set global_real = 0 and set the heroes stats equal to heroe's stats+1, the else is set global_real = global_real+0.2.

Very simple if I say so my self and I do say so my self. . .
 
Level 11
Joined
Jul 12, 2005
Messages
764
Kinda like this, but do it with a variable array, so it'll be MUI/player.
  • Set RealVar = RealVar + 0.2
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • RealVar is equal to 1
      • Then - Actions
        • Unit - Add 1 Strenght to Killing unit
        • Set RealVar = 0
      • Else - Actions
 
Last edited by a moderator:
Level 8
Joined
Sep 13, 2006
Messages
431
Yep, pask's works fine. Here's the finished thing...

  • AttributeGain
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Level of YourAbil for (Killing unit)) Greater than or equal to 1
    • Actions
      • Set IntelligenceReal[(Player number of (Owner of (Killing unit)))] = (IntelligenceReal[(Player number of (Owner of (Killing unit)))] + 0.20)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • IntelligenceReal[(Player number of (Owner of (Killing unit)))] Equal to 1.00
        • Then - Actions
          • Hero - Modify Intelligence of (Killing unit): Add 1
          • Set IntelligenceReal[(Player number of (Owner of (Killing unit)))] = 0.00
        • Else - Actions
 
Status
Not open for further replies.
Top