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

Increasing ability apon leveling up

Status
Not open for further replies.
Level 13
Joined
Oct 16, 2010
Messages
731
Hi

Had a similar situation with changing the level of an originally "item" ability. Previously with the "item stat bonus" abilities but now with the "item health" ability. The idea is that you pick up an item and it gives you bonus health depending on your level. The ability is not actually on the item as it is triggered to add the ability when the item is picked up, the level is then changed on pickup and level up, and removed when it is dropped.

Situation again is that the ability doesn't actually level up, even when i added a message to show the ability level (which showed correctly) it's bonuses didn't add up (it stayed level 1).

Any ideas?

P.S. I'm aware that i could set the unit as a variable but it's just to see if it would actually work (had planned to have different ones which did damage, armor, mana etc)

  • Relic Pick Up
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • ((Hero manipulating item) is A Hero) Equal to True
    • Actions
      • -------- Vitality Relic --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-type of (Item being manipulated)) Equal to |c00540081Vitality Relic|r
          • (Level of Vitality Relic for (Hero manipulating item)) Equal to 0
        • Then - Actions
          • Unit - Add Vitality Relic to (Hero manipulating item)
          • Unit - Set level of Vitality Relic for (Hero manipulating item) to (Hero level of (Hero manipulating item))
        • Else - Actions
  • Relic Update
    • Events
      • Unit - A unit Gains a level
    • Conditions
    • Actions
      • -------- Vitality Relic --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Leveling Hero) has an item of type |c00540081Vitality Relic|r) Equal to True
        • Then - Actions
          • Unit - Set level of Vitality Relic for (Leveling Hero) to (Hero level of (Leveling Hero))
        • Else - Actions
  • Relic Drop
    • Events
      • Unit - A unit Loses an item
    • Conditions
    • Actions
      • -------- Vitality Relic --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-type of (Item being manipulated)) Equal to |c00540081Vitality Relic|r
          • ((Hero manipulating item) has an item of type |c00540081Vitality Relic|r) Equal to False
        • Then - Actions
          • Unit - Remove Vitality Relic from (Hero manipulating item)
        • Else - Actions
 
Level 21
Joined
Aug 13, 2011
Messages
739
The Manual of Health ability is very reliable for both adding and removing HP :psmile:

And dropping the Vitality Relic will not kill the hero if it has lower HP than the HP lost from the relic.
 

Attachments

  • Vitality Relic.w3x
    10 KB · Views: 82
Level 13
Joined
Oct 16, 2010
Messages
731
That works perfectly! Thanks! :D I'm guessing it'd work the same for adding mana. Any thoughts on adding armor, damage and movement speed? (I'm gunna guess those will be more complicated)

EDIT: I just tried on your map with two relics and it's stackable. Given that I'm not sure everything else will be stackable is there anyway I can remove that?

EDIT 2: Sorted the stacking thing :)

EDIT 3: Okay stacking failed... It works on pickup but dropping doesn't work... Seems to think that they still have the item (no loss of stats) when they don't as it was dropped..
 
Last edited:
Level 21
Joined
Aug 13, 2011
Messages
739
There shouldn't be any issues with stacking anymore.

And for the other bonuses, you could use aura abilities (endurance, devotion, etc.) if the item abilities don't work the way you need them to. Although I'm pretty sure leveling the boots of speed item ability worked for me in the past with no issues.
 

Attachments

  • Vitality Relic Not Stackable.w3x
    10.7 KB · Views: 87
Status
Not open for further replies.
Top