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

How to make it such that attribute gain every 3 levels?

Status
Not open for further replies.
Level 10
Joined
Jun 7, 2008
Messages
420
How to make it such that 1 SKILL POINT gain every 3 levels instead of every level?

Ah allright sorry my bad I didn;t mean attribute I ment skill points. How to make it gain one skill point per 3 levels.

Edited: my bad sry
 
Last edited:
Hi, is there any way to make it such that an attribute point is allotted every 3 levels instead of one?

Thanks!!

  • Events
    • Unit - A unit gains a level
  • Conditions
    • (Hero level of Triggering unit mod 3) is equal to 0
  • Actions
    • Hero - Modify Strength of TriggeringUnit Add XX
    • Hero - Modify Agility of TriggeringUnit Add XX
    • Hero - Modify Intelligence of TriggeringUnit Add XX
 
Level 37
Joined
Mar 6, 2006
Messages
9,243
Modify heroes to not have any attribute bonus at object editor.

  • Untitled Trigger 022
    • Events
      • Unit - A unit Gains a level
    • Conditions
      • ((Level of (Triggering unit)) mod 3) Equal to 0
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Triggering unit)) Equal to Paladin
        • Then - Actions
          • Hero - Modify Strength of (Triggering unit): Add 2
          • Hero - Modify Agility of (Triggering unit): Add 1
          • Hero - Modify Intelligence of (Triggering unit): Add 1
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Triggering unit)) Equal to Archmage
            • Then - Actions
              • Hero - Modify Strength of (Triggering unit): Add 1
              • Hero - Modify Agility of (Triggering unit): Add 1
              • Hero - Modify Strength of (Triggering unit): Add 3
            • Else - Actions
You can only add integers with triggers, but if you want to add 2.3 per level, you can kind of do that too. Use a real for the unit, then convert it to an integer and give that integer to the unit. Real -> integer will round it down, so then you take the amount that gets lost in the conversion and keep it saved. Then each time the unit gains attribute points, you keep adding the number that gets cut down due to the conversion to the previous number. Then check whether the number is over 1, if it is then give one additional attribute point to the unit.

For example, you want to give 2.6 str per level.

At first level up, he gains 2 str, 0.6 will be left over. Save that 0.6. The next time the unit gains str, it gets 2 str again, but now the "overfolw" is 0.6 + 0.6 = 1.2. Give one additional str point, and save that 0.2 and so on.'

EDIT: Ah, too late. Well I hope the decimal system helps.
 
Level 14
Joined
Mar 4, 2009
Messages
1,156
this should be good :D

EVENT
hero gains a level
ACTION
if custom value of hero is equal to 3
set custom value of hero to 0
else
set custom value of hero to custom value of hero +1
set skill points of hero to skill points of hero - 1


as i remember you said "every 3 levels" and this will work
 
Status
Not open for further replies.
Top