[Solved] Increase Ability Level By Trigger

Status
Not open for further replies.
Level 5
Joined
Jan 19, 2018
Messages
126
Hello all, I have a question regarding leveling abilities via trigger. I have an ability based on Periapt of Vitality (Item ability that I changed to unit ability) with 10 levels each level adding an additional 100 hp to the summoned unit. The problem is the ability is leveling but the unit is still only benefiting with the level 1 version. I used the game action to echo out the value of the level and it is indeed level 2, so it should be granting 200 hp instead of 100 hp but it isn't.

Could it have something to do with the fact that it is based off an item ability? Can base item abilities have levels that work properly? I Tried changed to hero ability too but no luck.

The level of the ability is set to the intelligence of the caster/10.
So the idea is a Hero with 50 Int will spawn an Arcane Elemental with 500 bonus hit points.

Thanks in advance.

  • Summon Arcane Elemental
    • Events
      • Unit - A unit Spawns a summoned unit
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Summoned unit)) Equal to Arcane Elemental (Level 1)
          • (Unit-type of (Summoned unit)) Equal to Arcane Elemental (Level 2)
          • (Unit-type of (Summoned unit)) Equal to Arcane Elemental (Level 3)
    • Actions
      • Unit - Set level of Summoned Unit Bonus Health for (Summoned unit) to ((Integer((Real((Intelligence of (Summoning unit) (Include bonuses)))))) / 10)
      • Game - Display to (All players) the text: (String((Level of Summoned Unit Bonus Health for (Summoned unit))))
 
Last edited:
Level 13
Joined
May 10, 2009
Messages
868
Unfortunately, that ability itself doesn't fully support levels. One thing you can do is set its maximum level to 2. For example: Level 1 = +100 HP, and Level 2 = 0 HP. Then, just give the ability to the unit, set its level to 2, and remove it. That way you'd be increasing a unit's HP permanently. You can also use that "tome ability" which increases health permanently.
 
Level 5
Joined
Jan 19, 2018
Messages
126
Unfortunately, that ability itself doesn't fully support levels. One thing you can do is set its maximum level to 2. For example: Level 1 = +100 HP, and Level 2 = 0 HP. Then, just give the ability to the unit, set its level to 2, and remove it. That way you'd be increasing a unit's HP permanently. You can also use that "tome ability" which increases health permanently.
If I remove the ability the unit's hit points return to normal. I tried a For loop to give the unit the ability x amount of times but it only benefits from the first one. I don't want to have to resort to a long chain of conditionals but I'm not seeing any other options. This is the for loop I tried as reference:
  • Summon Arcane Elemental
    • Events
      • Unit - A unit Spawns a summoned unit
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Summoned unit)) Equal to Arcane Elemental (Level 1)
          • (Unit-type of (Summoned unit)) Equal to Arcane Elemental (Level 2)
          • (Unit-type of (Summoned unit)) Equal to Arcane Elemental (Level 3)
    • Actions
      • For each (Integer A) from 1 to ((Integer(((Real((Intelligence of (Summoning unit) (Include bonuses)))) / 10.00))) - 1), do (Actions)
        • Loop - Actions
          • Unit - Add Summoned Unit Bonus Health (+100) to (Summoned unit)
 
Level 5
Joined
Jan 19, 2018
Messages
126
Be aware that doing that could cause performance problems if stats can get high enough (eg 10,000+ int). In such case one can use multiple different abilities of increasing amounts each.
Thanks for the tip! There are no crazy stats on my map, unit stats are very similar to what you find on standard melee maps
(You're really really lucky if your hero gets 100 of any stat)
so it I don't think it will be problematic if that is the case.

Thanks for the insight.
 
Status
Not open for further replies.
Top