Mana% and Buff

Eleteguard

New Member
Reaction score
0
Based on the amount of mana the unit has the changes the level of a the buff it has.
80% mana - Level 1 of buff
70% mana - Level 2 of buff
and so on till 0%

The needs to be removed if the units mana gets above 80% also.
 

MoonSlinger

I Love using Cheap Tricks... only Results matters
Reaction score
74
I am not sure what kind of buff you are thinking of, so I assume

Assumptions:
- The "Buff" you want comes from an Aura (ability)
- Not all units will be affect by this "Buff" you mentioned

What you can try:
Object Editor:
- Make an ability based on whatever Aura you wanted (CustomAura)
- Give it 10 levels
- Set level 1 to have no buff, no effect
Level one will show nothing, and seem inert, but it will be there for easy manipulation.

Map Editor:
Make sure every unit you want your buff to affect to have the required ability
If you do not want the ability to be shown, convert it from an "Item Spell"
i.e. For Devotion Aura, use the item ability instead of the one Neutral Creep has.


Trigger1:
Event
Unit enters the map
Action:
If unit is the kind you want this effect to happen on
-- Add Triggering Unit to HaveBuff
-- Give unit the ability CustomAura

HaveBuff is a UnitGroup variable

Trigger2:
Periodic Event
Every 1 second of game time
Condition
HaveBuff is empty not equals to True
Action
Pick every unit in HaveBuff
-- If unit mana greater then 80%
-- -- set the level of Custom Aura for Picked Unit to 2
-- Else
-- -- -- If unit mana greater then 70%
-- -- -- set the level of Custom Aura for Picked Unit to 3

Follow on until you reach 10% or whatever lower limits you have.
 

MoonSlinger

I Love using Cheap Tricks... only Results matters
Reaction score
74
I thought of an easier way :D

You need:
Custom ability with 8 levels, to make things simple, set it such that
Lv8 skills for 80% mana
Lv7 skills for 70% mana
... etc... etc...

Trigger:
Code:
Periodic Event
Every 1 second of game time
Action
Pick every unit in playable map
-- Remove [COLOR="Red"]CustomBuff[/COLOR] from Picked Unit
-- If unit mana less then 80%
-- -- Create a dummy at position of Picked Unit
-- -- Set expiry timer for dummy to 0.8 seconds 
-- -- Set level of [COLOR="Red"]CustomSkill [/COLOR]for dummy to ( Integer( Current Mana of unit / Max mana of unit ) + 1)
-- -- Order dummy to cast spell on Picked Unit

CustomBuff is the buff that your active skill will give
Some skills like Heal / Curse cannot be cast on the same target when it already have the buff.

CustomSkill is the skill your dummy has that will cast on the units.
Make sure your dummy has enough Mana and Range to cast the spells.
Make sure your dummy already has the skill
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top