[Spell] a spall that add attack and add more mana

Level 12
Joined
Feb 13, 2012
Messages
426
hello i want to make a spell that use the inner fire spell that will add attack and to add 100 mana to the unit mana pool
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
Inner Fire already adds Attack Damage so I assume you just want to add Mana:
  • Events
    • Unit - A unit Starts the effect of an ability
  • Conditions
    • (Ability being cast) Equal to Inner Fire
  • Actions
    • Unit - Set mana of (Target unit of ability being cast) to (Mana of (Target unit of ability being cast)) + 100.00)
This will set the mana of the target to be equal to it's current value + 100.00.

So if the unit had 50/200 mana, it will now be 50 + 100 = 150/200. This won't ever go above it's maximum mana.

If you wish to add other bonuses it would depend on the type of bonus. You can create a Dummy unit which will cast any ability of your choice, for example, you could have it cast Bloodlust on the target in addition to Inner Fire for bonus movement speed and attack rate. You could also Add an Ability to the target which adds bonuses, for example, add a custom Item Attack Damage Bonus (+5) ability to increase it's attack damage by a flat 5. Then remove the ability after the unit loses it's Inner Fire buff. This would require that you track the unit periodically using a Loop trigger + Unit Group variable. Remember that some Item abilities will stack with one another, so you may need to Remove the ability before trying to Add it again to prevent multiple Inner Fires from stacking this ability.
 
Level 12
Joined
Feb 13, 2012
Messages
426
Inner Fire already adds Attack Damage so I assume you just want to add Mana:
  • Events
    • Unit - A unit Starts the effect of an ability
  • Conditions
    • (Ability being cast) Equal to Inner Fire
  • Actions
    • Unit - Set mana of (Target unit of ability being cast) to (Mana of (Target unit of ability being cast)) + 100.00)
This will set the mana of the target to be equal to it's current value + 100.00.

So if the unit had 50/200 mana, it will now be 50 + 100 = 150/200. This won't ever go above it's maximum mana.

If you wish to add other bonuses it would depend on the type of bonus. You can create a Dummy unit which will cast any ability of your choice, for example, you could have it cast Bloodlust on the target in addition to Inner Fire for bonus movement speed and attack rate. You could also Add an Ability to the target which adds bonuses, for example, add a custom Item Attack Damage Bonus (+5) ability to increase it's attack damage by a flat 5. Then remove the ability after the unit loses it's Inner Fire buff. This would require that you track the unit periodically using a Loop trigger + Unit Group variable. Remember that some Item abilities will stack with one another, so you may need to Remove the ability before trying to Add it again to prevent multiple Inner Fires from stacking this ability.
the idea was to use something like the pendent of mana ability to add more mana to the mana limit like it dose for heros just as long as the effect last on the unit and the buff is gone the manna pool limit returns to normel
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
Okay, so you want to increase it's Maximum Mana. Remember that units have current life/mana and maximum life/mana, two different things.

Anyway, you can use the Pendant of Mana ability to achieve this.

First, open the Object Editor and copy the Pendant item ability and create a new version called Inner Fire Mana Bonus.

Second, open the Trigger Editor and create two new variables:
InnerFire_Unit = Unit
InnerFire_Group = Unit Group

Third, create a trigger that adds our new ability to the target unit and tracks it in our Unit Group variable:
  • Inner Fire Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Inner Fire
    • Actions
      • Set Variable InnerFire_Unit = (Target unit of ability being cast)
      • Unit - Remove Inner Fire Mana Bonus from InnerFire_Unit
      • Unit - Add Inner Fire Mana Bonus to InnerFire_Unit
      • Unit Group - Add InnerFire_Unit to InnerFire_Group
      • Trigger - Turn on Inner Fire Loop
Note that I remove any previously added copy of this ability to prevent it from stacking.

Lastly, create a trigger that periodically checks the status of the Inner Fire buff on the units in our Unit Group:
  • Inner Fire Loop
    • Events
      • Time - Every 0.03 seconds
    • Conditions
    • Actions
      • Unit Group - Pick every unit in InnerFire_Group and (do Actions)
        • Loop - Actions
          • Set Variable InnerFire_Unit = (Picked unit)
          • If all conditions are true then do (Actions)
            • If - Conditions
              • (InnerFire_Unit has buff Inner Fire) Equal to False
            • Then - Actions
              • Unit - Remove Inner Fire Mana Bonus from InnerFire_Unit
              • Unit Group - Remove InnerFire_Unit from InnerFire_Group
              • If all conditions are true then do (Actions)
                • If - Conditions
                  • (InnerFire_Group is empty) Equal to True
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions
            • Else - Actions
When a unit no longer has the buff it gets removed from the Unit Group and has it's Pendant ability removed, causing it's maximum mana to get reduced back to normal. We also want to ensure that this trigger turns off once all of the buffs have been removed.

This last trigger should be set to Initially OFF. Uncheck the little box in the top right corner.
 
Last edited:
Top