[Solved] How to set a summoned unit's ability level based on the summoning spell level?

KPC

KPC

Level 8
Joined
Jun 15, 2018
Messages
230
Hello everyone,

I'm struggling with what seems like a simple problem, but I can't quite figure it out.

I have 2 levels of Infernal (the Dreadlord's ultimate ability) and I'd like the summoned Infernal to have a corresponding level of Permanent Immolation depending on which level of the ability summoned it:

  • Level 1 Infernal → Level 1 Permanent Immolation
  • Level 2 Infernal → Level 2 Permanent Immolation

Permanent Immolation is set up as a 2-level ability in the Object Editor. The problem is that both Level 1 and Level 2 Infernals are the same unit in the Object Editor - so I can't differentiate them there directly.

How can I dynamically set the Immolation level on the summoned Infernal based on which level of the Inferno ability was cast?
 
Since you only have 2 levels, simply duplicate the Infernal unit in the Object Editor.

Infernal (lvl1) and give it Level 1 Permanent Immolation.
Infernal (lvl2) and give it Level 2 Permanent Immolation.

Go to your Inferno spell. Under Data - Summoned Unit Type, set lvl 1 to summon the first Infernal, and lvl 2 to summon the second.
 
Since you only have 2 levels, simply duplicate the Infernal unit in the Object Editor.

Infernal (lvl1) and give it Level 1 Permanent Immolation.
Infernal (lvl2) and give it Level 2 Permanent Immolation.

Go to your Inferno spell. Under Data - Summoned Unit Type, set lvl 1 to summon the first Infernal, and lvl 2 to summon the second.
Hello, thanks for the answer. However, I see one issue with this solution, if I have 2 instances of the same unit and I change anything, I have to update it in two places, even though it's the same unit and ideally should only require one change.
 
Ahh you want to avoid the OE bloat(valid), then the minimal flow would be:
  • Lvl scale
    • Events
      • Unit - A unit Spawns a summoned unit
    • Conditions
      • (Unit-type of (Summoned unit)) Equal to Infernal
    • Actions
      • Unit - Set level of Inferno Immolation (Inferno) for (Summoned unit) to (Level of Inferno for (Summoning unit))
 
Last edited:
Make sure your summoning unit also has been checked it ability level, i'm afraid when other hero using Infernal Stone or Dreadlord with level 1 Infernal also being included.
Good point,
In that case
Lvl of Inferno for (Summoning unit) would return 0, so it’s safer to just guard against it:

• Set tempInt = (Level of Inferno for (Summoning unit))
• If (tempInt > 0) then
  Set level of Permanent Immolation for (Summoned unit) to tempInt

That way it only scales when the summoner actually has the inferno ability.
 
Good point,
In that case
Lvl of Inferno for (Summoning unit) would return 0, so it’s safer to just guard against it:

• Set tempInt = (Level of Inferno for (Summoning unit))
• If (tempInt > 0) then
  Set level of Permanent Immolation for (Summoned unit) to tempInt

That way it only scales when the summoner actually has the inferno ability.
What if Dreadlord with Level 2 Inferno Ability uses Inferno Stone?
 
What if Dreadlord with Level 2 Inferno Ability uses Inferno Stone?
If a Dreadlord with Inferno uses an Infernal Stone, (Level of Inferno for (Summoning unit)) will still return his ability level, even though the summon came from the item.
So yeah, in that case the Infernal would inherit level 2 Immolation.

At that point it becomes more of a design decision:

• Either allow all Infernals owned by that unit to scale with its Inferno level (simpler and consistent),
• Or add extra tracking (detect ability casts vs item use) if you strictly want to separate them.

wc3 doesn’t natively distinguish the source of the summon, so handling that distinction requires additional logic.
 
Back
Top