• 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 change the level of any Neutral Hostile enemy in the map Editor?

Status
Not open for further replies.
Level 2
Joined
Jan 5, 2024
Messages
9
Within Tool Pallet/Unit Palette it is possible to add Neutral Hostile monsters, however they already have predefined levels and even in Random Unit, if you change the level above 12 no more enemies appear. As I am creating huge scenarios with these monsters, I would like to know if it is possible to set levels for Neutral Hostile enemies that I place on the map? The only ones I can define so far are for heroes.
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
It's not possible to do without some kind of special trick.

Here's how you can do it using the Percentage Life (aka Hit Points) of the Neutral Hostile unit:
dragon fake lvl.png

^ I'm setting the Dragon to Level 25. This change will occur when the game starts.
  • Set Neutral Level to Life Percentage
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units owned by Neutral Hostile.) and do (Actions)
        • Loop - Actions
          • Set VariableSet Neutral_Unit = (Picked unit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Percentage life of Neutral_Unit) Less than or equal to 99.00
            • Then - Actions
              • Unit - Set Unit: Neutral_Unit's Integer Field: Level ('ulev') to Value: (Integer(((Percentage life of Neutral_Unit) + 0.01)))
              • Unit - Set life of Neutral_Unit to 100.00%
            • Else - Actions
This will pick every Neutral Hostile unit on the map when the game first starts, look at their % of Hit Points, and Set their Level to that number. If they're at 100% Hit Points already (default) then nothing will happen. Note: Life is the same thing as Hit Points.

I attached a map with an example. You can copy and paste the trigger into your own map.
 

Attachments

  • Neutral Creep Level Fix.w3m
    21.7 KB · Views: 5
Last edited:
Level 2
Joined
Jan 5, 2024
Messages
9
It's not possible to do without some kind of special trick.

Here's how you can do it using the Percentage Life (aka Hit Points) of the Neutral Hostile unit:
View attachment 458106
^ I'm setting the Dragon to Level 25. This change will occur when the game starts.
  • Set Neutral Level to Life Percentage
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units owned by Neutral Hostile.) and do (Actions)
        • Loop - Actions
          • Set VariableSet Neutral_Unit = (Picked unit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Percentage life of Neutral_Unit) Less than or equal to 99.00
            • Then - Actions
              • Unit - Set Unit: Neutral_Unit's Integer Field: Level ('ulev') to Value: (Integer(((Percentage life of Neutral_Unit) + 0.01)))
              • Unit - Set life of Neutral_Unit to 100.00%
            • Else - Actions
This will pick every Neutral Hostile unit on the map when the game first starts, look at their % of Hit Points, and Set their Level to that number. If they're at 100% Hit Points already (default) then nothing will happen. Note: Life is the same thing as Hit Points.

I attached a map with an example. You can copy and paste the trigger into your own map.
Thanks for the help, but in this model you built, won't the dragon get weaker? This way he will only have 25% of his life, so he will be a level 25 dragon weaker than a level 10 dragon that is his base.

Or did you add some command that makes them maintain 100% health regardless of the % I put?
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
Thanks for the help, but in this model you built, won't the dragon get weaker? This way he will only have 25% of his life, so he will be a level 25 dragon weaker than a level 10 dragon that is his base.

Or did you add some command that makes them maintain 100% health regardless of the % I put?
I know triggers are difficult and confusing at first but if you read carefully you should see the answer is usually there:
  • Unit - Set life of Neutral_Unit to 100.00%
Like you mentioned, I have an Action to fully heal the unit during this level-changing process.
 
Level 2
Joined
Jan 5, 2024
Messages
9
I know triggers are difficult and confusing at first but if you read carefully you should see the answer is usually there:
  • Unit - Set life of Neutral_Unit to 100.00%
Like you mentioned, I have an Action to fully heal the unit during this level-changing process.
Thanks for your help friend, it really worked, the only problem is that the monster continues to have the same life, the same statuses. To be perfect, the only thing left to do is for the monster to raise its stats as well as its level, is this possible? I imagine it only works on heros.
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
Thanks for your help friend, it really worked, the only problem is that the monster continues to have the same life, the same statuses. To be perfect, the only thing left to do is for the monster to raise its stats as well as its level, is this possible? I imagine it only works on heros.
Yes, it's possible, but you can't give a non-Hero unit the Strength, Agility, and Intelligence attributes.

But you can just increase the stats directly: hp, mana, attack damage, hp regen, mana regen, movement speed, attack rate, etc.

Here's an example:
  • Set Neutral Level to Life Percentage
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units owned by Neutral Hostile.) and do (Actions)
        • Loop - Actions
          • Set VariableSet Neutral_Unit = (Picked unit)
          • Set VariableSet Neutral_Percentage_Life = (Percentage life of Neutral_Unit)
          • -------- --------
          • -------- If it isn't at 100% Life then I assume that you want to change it's Level to a new value: --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Neutral_Percentage_Life Less than or equal to 99.00
            • Then - Actions
              • Unit - Set Unit: Neutral_Unit's Integer Field: Level ('ulev') to Value: (Integer((Neutral_Percentage_Life + 0.01)))
            • Else - Actions
          • -------- --------
          • -------- Get the Level and convert it to a Real so we can modify it easily: --------
          • Set VariableSet Neutral_Level = (Real((Unit: Neutral_Unit's Integer Field: Level ('ulev'))))
          • -------- --------
          • -------- Get our bonus stats -> 4% more hp per level, 2% more mana per level, 3% more attack damage per level: --------
          • Set VariableSet Neutral_HP_Multiplier = (Neutral_Level x 0.04)
          • Set VariableSet Neutral_Mana_Multiplier = (Neutral_Level x 0.02)
          • Set VariableSet Neutral_Attack_Dmg_Multiplier = (Neutral_Level x 0.03)
          • -------- --------
          • -------- Apply these bonus stats to the unit (if it's higher than level 1): --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Neutral_Level Greater than 1.00
            • Then - Actions
              • Unit - Set Max HP of Neutral_Unit to (Integer(((Real((Max HP of Neutral_Unit))) x (1.00 + Neutral_HP_Multiplier))))
              • Unit - Set Max Mana of Neutral_Unit to (Integer(((Real((Max Mana of Neutral_Unit))) x (1.00 + Neutral_Mana_Multiplier))))
              • Unit - Set Base Damage of Neutral_Unit to (Integer(((Real((Base Damage of Neutral_Unit for weapon index 0))) x (1.00 + Neutral_Attack_Dmg_Multiplier)))) for weapon index: 0
            • Else - Actions
          • -------- --------
          • -------- Restore it back to full HP after all calculations have been made: --------
          • Unit - Set life of Neutral_Unit to 100.00%
This gives Neutral Hostile units 4% more HP, 2% more Mana, and 3% more Attack Damage per Level.

So a Level 5 unit gets +20% HP, +10% Mana, and +15% Attack Damage.

In the example map I have two triggers. The second (disabled) trigger is setup to only work for non-Hero units and you can add more Conditions to it to filter out unwanted units like Structures.
 

Attachments

  • Neutral Creep Level Fix 2.w3m
    23.7 KB · Views: 5
Last edited:
Level 2
Joined
Jan 5, 2024
Messages
9
Yes, it's possible, but you can't give a non-Hero unit the Strength, Agility, and Intelligence attributes.

But you can just increase the stats directly: hp, mana, attack damage, hp regen, mana regen, movement speed, attack rate, etc.

Here's an example:
  • Set Neutral Level to Life Percentage
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units owned by Neutral Hostile.) and do (Actions)
        • Loop - Actions
          • Set VariableSet Neutral_Unit = (Picked unit)
          • Set VariableSet Neutral_Percentage_Life = (Percentage life of Neutral_Unit)
          • -------- --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Neutral_Percentage_Life Less than or equal to 99.00
            • Then - Actions
              • Unit - Set Unit: Neutral_Unit's Integer Field: Level ('ulev') to Value: (Integer((Neutral_Percentage_Life + 0.01)))
            • Else - Actions
          • -------- --------
          • -------- Get the Level and convert it to a Real so we can modify it easily: --------
          • Set VariableSet Neutral_Level = (Real((Unit: Neutral_Unit's Integer Field: Level ('ulev'))))
          • -------- --------
          • -------- Get our bonus stats -> 4% more hp per level, 2% more mana per level, 3% more attack damage per level: --------
          • Set VariableSet Neutral_HP_Multiplier = (Neutral_Level x 0.04)
          • Set VariableSet Neutral_Mana_Multiplier = (Neutral_Level x 0.02)
          • Set VariableSet Neutral_Attack_Dmg_Multiplier = (Neutral_Level x 0.03)
          • -------- --------
          • -------- Apply these bonus stats to the unit (if it's higher than level 1): --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Neutral_Level Greater than 1.00
            • Then - Actions
              • Unit - Set Max HP of Neutral_Unit to (Integer(((Real((Max HP of Neutral_Unit))) x (1.00 + Neutral_HP_Multiplier))))
              • Unit - Set Max Mana of Neutral_Unit to (Integer(((Real((Max Mana of Neutral_Unit))) x (1.00 + Neutral_Mana_Multiplier))))
              • Unit - Set Base Damage of Neutral_Unit to (Integer(((Real((Base Damage of Neutral_Unit for weapon index 0))) x (1.00 + Neutral_Attack_Dmg_Multiplier)))) for weapon index: 0
            • Else - Actions
          • -------- --------
          • -------- Restore it back to full HP after all calculations have been made: --------
          • Unit - Set life of Neutral_Unit to 100.00%
This gives Neutral Hostile units 4% more HP, 2% more Mana, and 3% more Attack Damage per Level.

So a Level 5 unit gets +20% HP, +10% Mana, and +15% Attack Damage.

In the example map I have two triggers. The second (disabled) trigger is setup to only work for non-Hero units and you can add more Conditions to it to filter out unwanted units like Structures for example.
Dude, thank you so much! You are a genius! Thanks for your help!

If I want to increase these stats even further, where do I make these changes?

From my tests I realized that I still need to increase my Status a little, I believe that Hostiles with 10% more HP, 8% more Mana and 7% more Attack Damage per Level would be perfect.
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
Dude, thank you so much! You are a genius! Thanks for your help!

If I want to increase these stats even further, where do I make these changes?

From my tests I realized that I still need to increase my Status a little, I believe that Hostiles with 10% more HP, 8% more Mana and 7% more Attack Damage per Level would be perfect.
No problem :)

See this Action inside of the trigger?
  • -------- Get our bonus stats -> 4% more hp per level, 2% more mana per level, 3% more attack damage per level: --------
This is called a Comment which is just a note that I left for you to read. I left a few of them throughout to help explain what's happening.

Under that comment I put the Variables that determine the Multipliers for HP, Mana, and Attack Damage:
  • Set VariableSet Neutral_HP_Multiplier = (Neutral_Level x 0.04)
  • Set VariableSet Neutral_Mana_Multiplier = (Neutral_Level x 0.02)
  • Set VariableSet Neutral_Attack_Dmg_Multiplier = (Neutral_Level x 0.03)
You can see inside of those Variables the different values being set: 0.04, 0.02, and 0.03.

These values represent the 4% hp, 2% mana, and 3% attack dmg.

So setting Neutral_HP_Multiplier = (Neutral_Level x 0.10) would make it add 10% more HP per level.
 
Last edited:
Level 2
Joined
Jan 5, 2024
Messages
9
No problem :)

See this Action inside of the trigger?
  • -------- Get our bonus stats -> 4% more hp per level, 2% more mana per level, 3% more attack damage per level: --------
This is called a Comment which is just a note that I left for you to read. I leave a few of them throughout to help explain what's happening.

Under that comment I put the Variables that determine the Multipliers for HP, Mana, and Attack Damage:
  • Set VariableSet Neutral_HP_Multiplier = (Neutral_Level x 0.04)
  • Set VariableSet Neutral_Mana_Multiplier = (Neutral_Level x 0.02)
  • Set VariableSet Neutral_Attack_Dmg_Multiplier = (Neutral_Level x 0.03)
You can see inside of those Variables the different values being set: 0.04, 0.02, and 0.03.

These values represent the 4% hp, 2% mana, and 3% attack dmg.

So setting Neutral_HP_Multiplier = (Neutral_Level x 0.10) would make it add 10% more HP per level.
Thank you friend!
I will be eternally grateful for your help!
 
Status
Not open for further replies.
Top