Help with Custom Passive Ability

Haven't found a thread about what I need so....

The idea works around two different abilities, a hidden passive ability, like one from an item that gives 100 mana, and a passive hero ability to work as placeholder.
Can someone give me an exemple on how to create a trigger do to the following:

1. When Hero learn the placeholder passive ability he also gets (or learns) the hidden ability via trigger;
2. When the placeholder passive ability levels up, also increases the level of the hidden ability via trigger.
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
Can someone give me an exemple on how to create a trigger do to the following:

1. When Hero learn the placeholder passive ability he also gets (or learns) the hidden ability via trigger;
2. When the placeholder passive ability levels up, also increases the level of the hidden ability via trigger.
  • Events
    • Unit - A unit Learns a skill
  • Conditions
    • (Learned skill) Equal to Your Hero Ability
  • Actions
    • Unit - Add Item Mana Bonus (100) to (Triggering unit)
That'll add 100 mana at level 1, 200 mana at level 2, and 300 mana at level 3, etc. Most item abilities stack like this.

If you need more control then you can do this:
  • Events
    • Unit - A unit Learns a skill
  • Conditions
    • (Learned skill) Equal to Your Hero Ability
  • Actions
    • Set Ability_Level = (Level of Your Hero Ability for (Triggering unit))
    • If all conditions are true then do (Actions)
      • If - Conditions
        • Ability_Level Equal to 1
      • Then - Actions
        • Unit - Add Item Mana Bonus (100) to (Triggering unit)
      • Else - Actions
    • If all conditions are true then do (Actions)
      • If - Conditions
        • Ability_Level Equal to 2
      • Then - Actions
        • Unit - Add Item Mana Bonus (50) to (Triggering unit)
      • Else - Actions
    • If all conditions are true then do (Actions)
      • If - Conditions
        • Ability_Level Equal to 3
      • Then - Actions
        • Unit - Add Item Mana Bonus (75) to (Triggering unit)
      • Else - Actions
That'll add a total of 100, 150, 225.

If the item ability doesn't stack then you'll need to create multiple item abilities and Remove the old one before Adding the new one:
  • Events
    • Unit - A unit Learns a skill
  • Conditions
    • (Learned skill) Equal to Your Hero Ability
  • Actions
    • Set Ability_Level = (Level of Your Hero Ability for (Triggering unit))
    • If all conditions are true then do (Actions)
      • If - Conditions
        • Ability_Level Equal to 1
      • Then - Actions
        • Unit - Add Item Mana Bonus (100) to (Triggering unit)
      • Else - Actions
    • If all conditions are true then do (Actions)
      • If - Conditions
        • Ability_Level Equal to 2
      • Then - Actions
        • Unit - Remove Item Mana Bonus (100) from (Triggering unit)
        • Unit - Add Item Mana Bonus (150) to (Triggering unit)
      • Else - Actions
    • If all conditions are true then do (Actions)
      • If - Conditions
        • Ability_Level Equal to 3
      • Then - Actions
        • Unit - Remove Item Mana Bonus (150) from (Triggering unit)
        • Unit - Add Item Mana Bonus (225) to (Triggering unit)
      • Else - Actions
This has the same outcome as the previous trigger but ensures that our unit only ever has 1 of these mana abilities.
 
Last edited:
Thank you so much for helping @Uncle.

1. on "Set Ability_Level = (Level of Your Hero Ability for (Triggering unit))" where can I place the last part of that line "(Level of Your Hero Ability for (Triggering unit))"...

I'm new to triggers, so alot of stuff are still confusing to me, mostly prefer to check the triggers on a map to see how they work better, so sorry for my lack of knowledge on how to recreate them from here.
 

Attachments

  • image_2025-01-03_154613466.png
    image_2025-01-03_154613466.png
    15.6 KB · Views: 7

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
Thank you so much for helping @Uncle.

1. on "Set Ability_Level = (Level of Your Hero Ability for (Triggering unit))" where can I place the last part of that line "(Level of Your Hero Ability for (Triggering unit))"...

I'm new to triggers, so alot of stuff are still confusing to me, mostly prefer to check the triggers on a map to see how they work better, so sorry for my lack of knowledge on how to recreate them from here.
Ability01_level should be an Integer variable.

Then click the red Value field and scroll through the list of Functions. You will see that everything is categorized alphabetically.

Look for the function called:
Unit - Level Of Ability For Unit.

Click on that function and you'll see an
Ability field. Click on that and choose from your list of abilities. Once done, click OK a few times.

I recommend using the Search For Text box to help find the rest of the Actions. Don't be too specific with your search though, try using one word at a time.
 
Last edited:
Everything seems to be working properly, thank you again Uncle!

Can I use the same method for a couple more passive custom abilities, with different effects based on item abilities, and should I worry about something?
 

Attachments

  • image_2025-01-03_160908104.png
    image_2025-01-03_160908104.png
    25.2 KB · Views: 8
Last edited:

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
Everything seems to be working properly, thank you again Uncle!
No problem :peasant-cheers-back:

Can I use the same method for a couple more passive custom abilities, with different effects based on item abilities, and should I worry about anything?
Yes, this is a pretty safe thing to do.

I guess you may want to create custom copies of the item abilities but that should only matter if you try to Remove them.
 
Last edited:
Top